File tree Expand file tree Collapse file tree 5 files changed +404
-231
lines changed
Expand file tree Collapse file tree 5 files changed +404
-231
lines changed Original file line number Diff line number Diff line change 1+ name : Run tests
2+
3+ on :
4+ pull_request :
5+ push :
6+ branches :
7+ - master
8+
9+ env :
10+ TIMEOUT : 20m
11+
12+ jobs :
13+ lint :
14+ runs-on : ubuntu-latest
15+ if : ${{ !github.event.pull_request.draft }}
16+ steps :
17+ - name : " Checkout PR"
18+ uses : TykTechnologies/github-actions/.github/actions/checkout-pr@main
19+ with :
20+ token : ${{ secrets.ORG_GH_TOKEN }}
21+
22+ - name : " Get base ref"
23+ run : |
24+ git fetch origin ${{ env.BRANCH_NAME }}
25+ git rev-parse origin/${{ env.BRANCH_NAME }}
26+
27+ - name : Setup Golang
28+ uses : actions/setup-go@v5
29+ with :
30+ go-version-file : go.mod
31+ cache-dependency-path : go.sum
32+
33+ - name : golangci-lint
34+ uses : golangci/golangci-lint-action@v8
35+ timeout-minutes : 20
36+ with :
37+ version : v2.5.0
38+ only-new-issues : ${{ github.event_name == 'pull_request' }}
39+ # Output formats configured in .golangci.yml (v2 approach)
40+ # Generates: text to stdout + checkstyle JSON for SonarQube
41+ args : --issues-exit-code=0 -v ./...
42+ skip-cache : false
43+ skip-save-cache : false
44+
45+ - uses : actions/upload-artifact@v4
46+ if : ${{ always() }}
47+ with :
48+ name : golangcilint
49+ retention-days : 1
50+ path : |
51+ golangci-lint-report.json
52+
53+ unit-tests :
54+ runs-on : ubuntu-latest
55+ outputs :
56+ latest-version : ${{ steps.get-latest-version.outputs.version }}
57+ steps :
58+ - name : Checkout Code
59+ uses : actions/checkout@v4
60+ with :
61+ ref : ${{ github.event.pull_request.head.ref }}
62+
63+ - name : Setup Golang
64+ uses : actions/setup-go@v5
65+ with :
66+ go-version : 1.24.x
67+
68+ - name : Run unit tests
69+ env :
70+ GIT_TOKEN : ${{ secrets.GITHUB_TOKEN }}
71+ run : go test ./...
Load Diff This file was deleted.
Load Diff This file was deleted.
You can’t perform that action at this time.
0 commit comments