chore(deps): update github/codeql-action action to v4 #164
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| on: | |
| push: | |
| branches: [main] | |
| pull_request: | |
| branches: [main] | |
| name: Build | |
| defaults: | |
| run: | |
| shell: bash | |
| jobs: | |
| lint: | |
| name: Lint files | |
| runs-on: 'ubuntu-latest' | |
| steps: | |
| - uses: actions/checkout@v3.0.2 | |
| - uses: actions/setup-go@v2 | |
| with: | |
| go-version: '1.16.x' | |
| - uses: actions/cache@v2 | |
| with: | |
| # In order: | |
| # * Module download cache | |
| # * Build cache (Linux) | |
| # * Build cache (Mac) | |
| # * Build cache (Windows) | |
| path: | | |
| ~/go/pkg/mod | |
| ~/.cache/go-build | |
| ~/Library/Caches/go-build | |
| %LocalAppData%\go-build | |
| key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }} | |
| restore-keys: | | |
| ${{ runner.os }}-go- | |
| - name: golangci-lint | |
| uses: golangci/golangci-lint-action@v3.1.0 | |
| with: | |
| version: v1.42.0 | |
| coverage: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v3.0.2 | |
| with: | |
| fetch-depth: 2 | |
| - uses: actions/setup-go@v2 | |
| with: | |
| go-version: '1.16.x' | |
| - name: List | |
| run: go list -mod=mod all | |
| - name: Run coverage | |
| run: | | |
| go get -u github.com/ory/go-acc | |
| go mod vendor | |
| $(go env GOPATH)/bin/go-acc --ignore 'examples' ./... | |
| - name: Upload coverage to Codecov | |
| run: | | |
| curl -Os https://uploader.codecov.io/latest/linux/codecov | |
| chmod +x codecov | |
| ./codecov -t ${{ secrets.CODECOV_TOKEN }} | |
| test: | |
| strategy: | |
| matrix: | |
| go-version: [1.15.x, 1.16.x, 1.17.x] | |
| runs-on: 'ubuntu-latest' | |
| steps: | |
| - name: Install Go | |
| uses: actions/setup-go@v2 | |
| with: | |
| go-version: ${{ matrix.go-version }} | |
| - name: Checkout code | |
| uses: actions/checkout@v3.0.2 | |
| - uses: actions/cache@v2 | |
| with: | |
| # In order: | |
| # * Module download cache | |
| # * Build cache (Linux) | |
| # * Build cache (Mac) | |
| # * Build cache (Windows) | |
| path: | | |
| ~/go/pkg/mod | |
| ~/.cache/go-build | |
| ~/Library/Caches/go-build | |
| %LocalAppData%\go-build | |
| key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }} | |
| restore-keys: | | |
| ${{ runner.os }}-go- | |
| - name: Test | |
| run: go test -v -race |