Merge pull request #122 from saltstack-formulas/renovate/techneg-ci-p… #584
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: Test & release | |
| on: | |
| - pull_request | |
| - push | |
| concurrency: | |
| group: ${{ github.workflow }}-${{ github.ref }} | |
| cancel-in-progress: ${{ github.ref != format('refs/heads/{0}', github.event.repository.default_branch) }} | |
| permissions: {} | |
| jobs: | |
| should-run: | |
| name: Prep / Should run | |
| runs-on: ubuntu-latest | |
| timeout-minutes: 5 | |
| outputs: | |
| should-run: ${{ steps.action.outputs.should-run }} | |
| steps: | |
| - id: action | |
| uses: techneg-it/should-workflow-run@eff19348eb884f57e05bc6f05ae48ece3af14714 # v1.0.1 | |
| pre-commit: | |
| name: Lint / `pre-commit` | |
| needs: should-run | |
| if: fromJSON(needs.should-run.outputs.should-run) | |
| container: techneg/ci-pre-commit:v2.5.39@sha256:9e9ecd6ffcafa30e7e7db152ea3b54de80e348fdbc4e1a25ea5c987868091dd5 | |
| permissions: | |
| contents: read | |
| runs-on: ubuntu-latest | |
| timeout-minutes: 5 | |
| steps: | |
| - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 | |
| with: | |
| persist-credentials: false | |
| - name: Export `CI_CACHE_ID` from container | |
| run: echo "CI_CACHE_ID=$(cat /.ci_cache_id)" >> $GITHUB_ENV | |
| - uses: actions/cache@27d5ce7f107fe9357f9df03efb73ab90386fccae # v5.0.5 | |
| with: | |
| path: ~/.cache/pre-commit | |
| key: "${{ env.CI_CACHE_ID }}|\ | |
| ${{ hashFiles('.pre-commit-config.yaml') }}" | |
| - name: Run `pre-commit` | |
| run: | | |
| git config --global --add safe.directory $(pwd) | |
| pre-commit run --all-files --color always --verbose | |
| results: | |
| name: Release / Collect results | |
| permissions: | |
| checks: read | |
| runs-on: ubuntu-latest | |
| timeout-minutes: 15 | |
| steps: | |
| - uses: poseidon/wait-for-status-checks@899c768d191b56eef585c18f8558da19e1f3e707 # v0.6.0 | |
| with: | |
| ignore: Release / Collect results | |
| token: ${{ secrets.GITHUB_TOKEN }} | |
| - run: echo "::notice ::Workflow success!" |