name: CI on: pull_request: branches: - v* - develop/* jobs: build: runs-on: ubuntu-latest strategy: matrix: go_tags: [ 'stdlib', 'goccy', 'es256k', 'all'] go: [ '1.17.x', '1.16.x' ] name: "Test [ Go ${{ matrix.go }} / Tags ${{ matrix.go_tags }} ]" steps: - name: Checkout repository uses: actions/checkout@v2 - name: Cache Go modules uses: actions/cache@v2 with: path: | ~/go/pkg/mod ~/.cache/go-build key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }} restore-keys: | ${{ runner.os }}-go- - name: Install Go stable version if: matrix.go != 'tip' uses: actions/setup-go@v2 with: go-version: ${{ matrix.go }} - name: Install Go tip if: matrix.go == 'tip' run: | git clone --depth=1 https://go.googlesource.com/go $HOME/gotip cd $HOME/gotip/src ./make.bash echo "::set-env name=GOROOT::$HOME/gotip" echo "::add-path::$HOME/gotip/bin" echo "::add-path::$(go env GOPATH)/bin" - name: Install stringer run: go install golang.org/x/tools/cmd/stringer@latest - name: Install jose run: sudo apt-get install -y --no-install-recommends jose - run: make generate - name: Test with coverage run: make cover-${{ matrix.go_tags }} - name: Upload code coverage to codecov if: matrix.go == '1.17.x' uses: codecov/codecov-action@v1 with: file: ./coverage.out - name: Check difference between generation code and commit code run: make check_diffs