Add Go linting job to unit tests workflow (#3)
Reviewed-on: Siteworxpro/Go-Template#3 Co-authored-by: Ron Rise <ron@siteworxpro.com> Co-committed-by: Ron Rise <ron@siteworxpro.com>
This commit is contained in:
@@ -1,38 +0,0 @@
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- "*"
|
||||
|
||||
name: 🧪 ✨ Unit Tests Workflow
|
||||
|
||||
jobs:
|
||||
test-go:
|
||||
env:
|
||||
GO_VERSION: '1.24.3'
|
||||
NODE_TLS_REJECT_UNAUTHORIZED: 0
|
||||
name: 🔍 🐹 Go Tests
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
|
||||
- name: 🛡️ 🔒 Add Siteworx CA Certificates
|
||||
run: |
|
||||
curl -Ls https://siteworxpro.com/hosted/Siteworx+Root+CA.pem -o /usr/local/share/ca-certificates/sw.crt
|
||||
update-ca-certificates
|
||||
|
||||
- name: ⚙️ 🐹 Set up Go Environment
|
||||
uses: actions/setup-go@v2
|
||||
with:
|
||||
go-version: ${{ env.GO_VERSION }}
|
||||
cache: true
|
||||
|
||||
- name: 📖 🔍 Checkout Repository Code
|
||||
uses: actions/checkout@v2
|
||||
with:
|
||||
fetch-depth: 1
|
||||
|
||||
- name: 📦 📥 Install Dependencies
|
||||
run: |
|
||||
go mod download
|
||||
|
||||
- name: ✅ 🔍 Run Go Lint
|
||||
uses: golangci/golangci-lint-action@v8.0.0
|
@@ -1,15 +1,44 @@
|
||||
on:
|
||||
workflow_dispatch: {}
|
||||
push:
|
||||
branches:
|
||||
- "*"
|
||||
|
||||
name: 🧪 ✨ Unit Tests Workflow
|
||||
name: 🧪 ✨ Tests Workflow
|
||||
|
||||
env:
|
||||
GO_VERSION: '1.24.3'
|
||||
|
||||
jobs:
|
||||
lint-go:
|
||||
name: 🔍 🐹 Go Lint
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
|
||||
- name: 🛡️ 🔒 Add Siteworx CA Certificates
|
||||
run: |
|
||||
curl -Ls https://siteworxpro.com/hosted/Siteworx+Root+CA.pem -o /usr/local/share/ca-certificates/sw.crt
|
||||
update-ca-certificates
|
||||
|
||||
- name: ⚙️ 🐹 Set up Go Environment
|
||||
uses: actions/setup-go@v2
|
||||
with:
|
||||
go-version: ${{ env.GO_VERSION }}
|
||||
cache: true
|
||||
|
||||
- name: 📖 🔍 Checkout Repository Code
|
||||
uses: actions/checkout@v2
|
||||
with:
|
||||
fetch-depth: 1
|
||||
|
||||
- name: 📦 📥 Install Dependencies
|
||||
run: |
|
||||
go mod download
|
||||
|
||||
- name: ✅ 🔍 Run Go Lint
|
||||
uses: golangci/golangci-lint-action@v8.0.0
|
||||
|
||||
test-go:
|
||||
env:
|
||||
GO_VERSION: '1.24.3'
|
||||
NODE_TLS_REJECT_UNAUTHORIZED: 0
|
||||
name: 🔍 🐹 Go Tests
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
@@ -39,6 +68,8 @@ jobs:
|
||||
go test -v ./... -coverprofile=coverage.out
|
||||
|
||||
- name: 📊 📈 Upload Coverage Report
|
||||
env:
|
||||
NODE_TLS_REJECT_UNAUTHORIZED: 0
|
||||
uses: christopherhx/gitea-upload-artifact@v4
|
||||
with:
|
||||
name: coverage-report
|
||||
|
Reference in New Issue
Block a user