ci: test against module, oldstable, and stable Go versions, update golangci-lint go v2.12, update minimum go to v1.21 #53
Workflow file for this run
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
| name: CI | |
| on: | |
| push: | |
| branches: [ main ] | |
| pull_request: | |
| branches: [ main ] | |
| env: | |
| GOTOOLCHAIN: local | |
| permissions: # added using https://github.com/step-security/secure-workflows | |
| contents: read | |
| jobs: | |
| # | |
| # golangci-lint | |
| # | |
| linters: | |
| permissions: | |
| contents: read # for actions/checkout to fetch code | |
| pull-requests: read # for golangci/golangci-lint-action to fetch pull requests | |
| name: Linters | |
| runs-on: ${{ matrix.os }} | |
| timeout-minutes: 10 | |
| strategy: | |
| matrix: | |
| os: [ubuntu-latest, macos-latest, windows-latest] | |
| steps: | |
| - uses: actions/setup-go@v7 | |
| with: | |
| go-version: stable | |
| cache: false # see actions/setup-go#368 | |
| - uses: actions/checkout@v6 | |
| - uses: golangci/golangci-lint-action@v9 | |
| with: | |
| version: v2.12 | |
| skip-cache: true | |
| args: --timeout=5m | |
| # | |
| # Project checks | |
| # | |
| project: | |
| name: Project Checks | |
| if: github.repository == 'containerd/log' | |
| runs-on: ubuntu-latest | |
| timeout-minutes: 5 | |
| steps: | |
| - uses: actions/setup-go@v7 | |
| with: | |
| go-version: stable | |
| cache: false # see actions/setup-go#368 | |
| - uses: actions/checkout@v6 | |
| with: | |
| path: src/github.com/containerd/log | |
| fetch-depth: 25 | |
| - uses: containerd/project-checks@v1.2.2 | |
| with: | |
| working-directory: src/github.com/containerd/log | |
| repo-access-token: ${{ secrets.GITHUB_TOKEN }} | |
| tests: | |
| name: Tests / ${{ matrix.go-version || 'go.mod' }} | |
| runs-on: ubuntu-latest | |
| timeout-minutes: 5 | |
| strategy: | |
| matrix: | |
| go-version: | |
| - "" # leave empty to use go-version-file (go.mod) | |
| - oldstable | |
| - stable | |
| steps: | |
| - uses: actions/checkout@v6 | |
| with: | |
| path: src/github.com/containerd/log | |
| - uses: actions/setup-go@v7 | |
| with: | |
| go-version: ${{ matrix.go-version }} | |
| go-version-file: src/github.com/containerd/log/go.mod # used when go-version is empty | |
| - name: Set env | |
| shell: bash | |
| run: | | |
| echo "GOPATH=${{ github.workspace }}" >> $GITHUB_ENV | |
| echo "${{ github.workspace }}/bin" >> $GITHUB_PATH | |
| - run: | | |
| go test -v -race | |
| working-directory: src/github.com/containerd/log |