22on :
33 push :
44 branches :
5- - ' * '
5+ - " * "
66 pull_request :
77 branches :
88 - master
@@ -13,30 +13,30 @@ jobs:
1313 name : scan for vulnerabilities
1414 runs-on : ubuntu-latest
1515 steps :
16- # Go
17- - name : Set up Go
18- uses : actions/setup-go@v4
19- with :
20- go-version : 1.20.x
21-
2216 # Checkout code
2317 - name : Checkout repository
2418 uses : actions/checkout@v3
25-
19+
2620 # Configure runner environment
2721 - name : Set up runner environment
2822 run : ./.github/workflows/assets/utils.sh setup
2923 env :
3024 GITHUB_USER : ${{ github.actor }}
3125 ACCESS_TOKEN : ${{ secrets.ACCESS_TOKEN }}
32-
26+
3327 # Get commit message
3428 - name : Get commit message
3529 run : |
3630 echo 'commit_msg<<EOF' >> $GITHUB_ENV
3731 git log --format=%B -n 1 ${{ github.sha }} >> $GITHUB_ENV
3832 echo 'EOF' >> $GITHUB_ENV
3933
34+ # Go
35+ - name : Set up Go
36+ uses : actions/setup-go@v4
37+ with :
38+ go-version : 1.20.x
39+
4040 # List direct dependencies
4141 - name : List dependencies
4242 run : go list -mod=readonly -f '{{if not .Indirect}}{{.}}{{end}}' -m all > go.list
@@ -54,46 +54,34 @@ jobs:
5454 needs : scan
5555 strategy :
5656 matrix :
57- go-version : [1.18.x, 1. 19.x, 1.20.x]
57+ go-version : [1.19.x, 1.20.x]
5858 os : [ubuntu-latest]
5959 runs-on : ${{ matrix.os }}
6060 timeout-minutes : 15
6161 steps :
62- # Go
63- - name : Set up Go
64- uses : actions/setup-go@v4
65- with :
66- go-version : ${{ matrix.go-version }}
67-
6862 # Checkout code
6963 - name : Checkout repository
7064 uses : actions/checkout@v3
71-
65+
7266 # Configure runner environment
7367 - name : Set up runner environment
7468 run : ./.github/workflows/assets/utils.sh setup
7569 env :
7670 GITHUB_USER : ${{ github.actor }}
7771 ACCESS_TOKEN : ${{ secrets.ACCESS_TOKEN }}
78-
72+
7973 # Get commit message
8074 - name : Get commit message
8175 run : |
8276 echo 'commit_msg<<EOF' >> $GITHUB_ENV
8377 git log --format=%B -n 1 ${{ github.sha }} >> $GITHUB_ENV
8478 echo 'EOF' >> $GITHUB_ENV
8579
86- # If "vendor" is in cache, restore.
87- # To run conditional steps use:
88- # if: steps.vendor-cache.outputs.cache-hit != 'true'
89- - name : Restore modules from cache
90- id : vendor-cache
91- uses : actions/cache@v3
92- env :
93- cache-name : vendor
80+ # Go
81+ - name : Set up Go
82+ uses : actions/setup-go@v4
9483 with :
95- path : ./vendor
96- key : ${{ env.cache-name }}-${{ hashFiles('go.sum') }}
84+ go-version : ${{ matrix.go-version }}
9785
9886 # Style consistency and static analysis using 'golangci-lint'
9987 # https://github.com/marketplace/actions/run-golangci-lint
@@ -117,7 +105,3 @@ jobs:
117105 name : assets
118106 path : |
119107 coverage.html
120-
121- # Populate vendor cache to speed up future runs
122- - name : Populate vendor cache
123- run : go mod vendor
0 commit comments