Merge pull request #825 from containers/renovate/golangci-golangci-li… #2744
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: validate | |
| on: | |
| push: | |
| branches: | |
| - main | |
| - podman-* | |
| pull_request: | |
| branches: | |
| - main | |
| - podman-* | |
| permissions: read-all | |
| env: | |
| LINT_VERSION: v2.12.2 | |
| jobs: | |
| codespell: | |
| runs-on: ubuntu-24.04 | |
| steps: | |
| - uses: actions/checkout@v6 | |
| - name: install deps | |
| # Version of codespell bundled with Ubuntu is way old, so use pip. | |
| run: pip install --break-system-packages codespell==v2.4.1 | |
| - name: run codespell | |
| run: make codespell | |
| lint: | |
| runs-on: ubuntu-24.04 | |
| defaults: | |
| run: | |
| working-directory: ./common | |
| steps: | |
| - uses: actions/checkout@v6 | |
| with: | |
| fetch-depth: 2 | |
| - uses: actions/setup-go@v6 | |
| with: | |
| go-version: 1.26.x | |
| # By default the go cache will only use go.sum in the root which we don't have, | |
| # make it use for all checksum files. | |
| # https://github.com/actions/setup-go?tab=readme-ov-file#caching-dependency-files-and-build-outputs | |
| cache-dependency-path: "**/go.sum" | |
| - name: install deps | |
| run: | | |
| sudo apt-get -qq update | |
| sudo apt-get -qq install libseccomp-dev libgpgme-dev libbtrfs-dev libsubid-dev | |
| - name: lint-common | |
| uses: golangci/golangci-lint-action@v9 | |
| with: | |
| version: "${{ env.LINT_VERSION }}" | |
| args: --verbose | |
| working-directory: ./common | |
| - name: lint-image | |
| uses: golangci/golangci-lint-action@v9 | |
| with: | |
| version: "${{ env.LINT_VERSION }}" | |
| args: --verbose | |
| working-directory: ./image | |
| - name: lint-storage | |
| uses: golangci/golangci-lint-action@v9 | |
| with: | |
| version: "${{ env.LINT_VERSION }}" | |
| args: --verbose | |
| working-directory: ./storage | |
| - name: validate seccomp | |
| run: ./tools/validate_seccomp.sh ./pkg/seccomp | |
| git-validate: | |
| # only run this on PRs | |
| if: github.event_name == 'pull_request' | |
| runs-on: ubuntu-24.04 | |
| env: | |
| # Base commit sha that we use the lint the commit from | |
| EPOCH_TEST_COMMIT: "${{ github.event.pull_request.base.sha }}" | |
| steps: | |
| - uses: actions/checkout@v6 | |
| with: | |
| # By default github actions creates a merge commit which fails the validation, | |
| # we only must validate the actual commits of the author. | |
| ref: ${{ github.event.pull_request.head.sha }} | |
| # Fetch all commits, a sparse checkout with only the commits count in the PR will not result in the right range. | |
| fetch-depth: 0 | |
| - uses: actions/setup-go@v6 | |
| with: | |
| go-version: 1.26.x | |
| # See comment on lint task | |
| cache-dependency-path: "**/go.sum" | |
| - name: run git-validation | |
| run: make .install.gitvalidation && make git-validation | |
| go-vendor: | |
| runs-on: ubuntu-24.04 | |
| steps: | |
| - uses: actions/checkout@v6 | |
| - uses: actions/setup-go@v6 | |
| with: | |
| go-version: 1.26.x | |
| # See comment on lint task | |
| cache-dependency-path: "**/go.sum" | |
| - name: vendor | |
| run: make vendor | |
| - name: check if tree is clean | |
| run: hack/tree_status.sh |