github.com/lestrrat-go/jwx/v2@v2.0.21/.github/workflows/ci.yml (about)

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