...
1name: CI
2on:
3 pull_request:
4 branches:
5 - v*
6 - develop/*
7
8jobs:
9 build:
10 runs-on: ubuntu-latest
11 strategy:
12 matrix:
13 go_tags: [ 'stdlib', 'goccy', 'es256k', 'all']
14 go: [ '1.17.x', '1.16.x' ]
15 name: "Test [ Go ${{ matrix.go }} / Tags ${{ matrix.go_tags }} ]"
16 steps:
17 - name: Checkout repository
18 uses: actions/checkout@v2
19 - name: Cache Go modules
20 uses: actions/cache@v2
21 with:
22 path: |
23 ~/go/pkg/mod
24 ~/.cache/go-build
25 key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
26 restore-keys: |
27 ${{ runner.os }}-go-
28 - name: Install Go stable version
29 if: matrix.go != 'tip'
30 uses: actions/setup-go@v2
31 with:
32 go-version: ${{ matrix.go }}
33 - name: Install Go tip
34 if: matrix.go == 'tip'
35 run: |
36 git clone --depth=1 https://go.googlesource.com/go $HOME/gotip
37 cd $HOME/gotip/src
38 ./make.bash
39 echo "::set-env name=GOROOT::$HOME/gotip"
40 echo "::add-path::$HOME/gotip/bin"
41 echo "::add-path::$(go env GOPATH)/bin"
42 - name: Install stringer
43 run: go install golang.org/x/tools/cmd/stringer@latest
44 - name: Install jose
45 run: sudo apt-get install -y --no-install-recommends jose
46 - run: make generate
47 - name: Test with coverage
48 run: make cover-${{ matrix.go_tags }}
49 - name: Upload code coverage to codecov
50 if: matrix.go == '1.17.x'
51 uses: codecov/codecov-action@v1
52 with:
53 file: ./coverage.out
54 - name: Check difference between generation code and commit code
55 run: make check_diffs
56
View as plain text