From 6dd76f2667e445168ec80f640a222d60fdd2aba7 Mon Sep 17 00:00:00 2001 From: Ron Rise Date: Wed, 18 Jun 2025 02:22:57 +0000 Subject: [PATCH] Add Go linting job to unit tests workflow (#3) Reviewed-on: https://gitea.siteworxpro.com/Siteworxpro/Go-Template/pulls/3 Co-authored-by: Ron Rise Co-committed-by: Ron Rise --- .gitea/workflows/lint.yml | 38 -------------------------------------- .gitea/workflows/test.yml | 39 +++++++++++++++++++++++++++++++++++---- 2 files changed, 35 insertions(+), 42 deletions(-) delete mode 100644 .gitea/workflows/lint.yml diff --git a/.gitea/workflows/lint.yml b/.gitea/workflows/lint.yml deleted file mode 100644 index ec0016b..0000000 --- a/.gitea/workflows/lint.yml +++ /dev/null @@ -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 \ No newline at end of file diff --git a/.gitea/workflows/test.yml b/.gitea/workflows/test.yml index d466399..ca23123 100644 --- a/.gitea/workflows/test.yml +++ b/.gitea/workflows/test.yml @@ -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