Merge pull request #620 from renovate-bot/renovate/actions-cache-5.x #1505
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
| --- | |
| # yamllint disable rule:line-length | |
| name: "CI Workflow" | |
| on: # yamllint disable-line rule:truthy | |
| push: | |
| branches: | |
| - main | |
| tags: ["*"] | |
| pull_request: | |
| # The branches below must be a subset of the branches above | |
| branches: | |
| - main | |
| workflow_dispatch: | |
| jobs: | |
| pre-commit: | |
| name: "Pre-commit checks" | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout repository | |
| # https://github.com/actions/checkout | |
| uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 | |
| with: | |
| submodules: "recursive" | |
| - name: Install uv | |
| # https://github.com/astral-sh/setup-uv | |
| uses: astral-sh/setup-uv@37802adc94f370d6bfd71619e3f0bf239e1f3b78 # v7.6.0 | |
| with: | |
| save-cache: ${{ github.ref == 'refs/heads/main' }} | |
| - name: Install pre-commit | |
| run: uv tool install pre-commit | |
| - name: Enable cache for pre-commit hooks | |
| # https://github.com/actions/cache | |
| uses: actions/cache@668228422ae6a00e4ad889ee87cd7109ec5666a7 # v5.0.4 | |
| with: | |
| path: ~/.cache/pre-commit | |
| # yamllint disable-line rule:line-length | |
| key: pre-commit|${{ hashFiles('.pre-commit-config.yaml') }} | |
| restore-keys: | | |
| pre-commit| | |
| - name: Run pre-commit checks | |
| run: pre-commit run -a | |
| - name: Run pre-commit gc | |
| run: pre-commit gc | |
| # This job builds the devcontainer image, but doesn't do anything with it. | |
| # It's just here to make sure the image builds successfully. | |
| devcontainer: | |
| name: "Build devcontainer image" | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout repository | |
| # https://github.com/actions/checkout | |
| uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 | |
| with: | |
| submodules: "recursive" | |
| - name: Set up Docker Buildx | |
| # https://github.com/docker/setup-buildx-action | |
| uses: docker/setup-buildx-action@4d04d5d9486b7bd6fa91e7baf45bbb4f8b9deedd # v4.0.0 | |
| id: setup-buildx | |
| - name: Expose variables required for actions cache | |
| # https://github.com/crazy-max/ghaction-github-runtime | |
| uses: crazy-max/ghaction-github-runtime@04d248b84655b509d8c44dc1d6f990c879747487 # v4.0.0 | |
| - name: Build devcontainer | |
| run: npx -- @devcontainers/cli build --workspace-folder . --cache-from type=gha,scope=devcontainer --cache-to type=gha,mode=min,scope=devcontainer | |
| # This is a dummy job to determine success of the CI workflow | |
| ci-success: | |
| name: CI Workflow - Success | |
| needs: | |
| - devcontainer | |
| - pre-commit | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Success | |
| run: echo "Previous jobs were successful" |