chore: autoupdate pre-commit hooks #323
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: | |
| pull_request: | |
| branches: [main] | |
| push: | |
| branches: [main] | |
| workflow_dispatch: | |
| permissions: | |
| contents: read | |
| concurrency: | |
| group: ${{ github.workflow }}-${{ github.ref }} | |
| cancel-in-progress: true | |
| defaults: | |
| run: | |
| shell: bash -el {0} | |
| jobs: | |
| test: | |
| name: Run Tests (${{ matrix.os }}) | |
| runs-on: ${{ matrix.os }} | |
| strategy: | |
| matrix: | |
| os: [ubuntu-latest, macos-latest] | |
| steps: | |
| - uses: actions/checkout@v7 | |
| - name: Setup BATS | |
| uses: bats-core/bats-action@4.0.0 | |
| - name: Install bash and GNU parallel (macOS only) | |
| if: matrix.os == 'macos-latest' | |
| run: | | |
| brew install bash parallel | |
| echo "$(brew --prefix)/bin" >> "$GITHUB_PATH" | |
| - name: Verify bash version | |
| if: matrix.os == 'macos-latest' | |
| run: | | |
| echo "Resolved bash: $(which bash)" | |
| bash -c 'echo "BASH_VERSION=$BASH_VERSION"' | |
| - name: Run BATS tests | |
| run: bats --jobs 4 --timing tests/*.bats | |
| run-ci: | |
| name: Run CI (${{ matrix.os }}) | |
| runs-on: ${{ matrix.os }} | |
| strategy: | |
| matrix: | |
| os: [ubuntu-latest, macos-latest] | |
| steps: | |
| - uses: actions/checkout@v7 | |
| - name: Install pre-commit | |
| run: | | |
| pip install --upgrade pip | |
| pip install --upgrade pre-commit | |
| - name: Cache pre-commit hooks | |
| id: cache-pre-commit-hooks | |
| uses: actions/cache@v6 | |
| env: | |
| CACHE_NUMBER: 1 | |
| with: | |
| path: ~/.cache/pre-commit | |
| key: ${{ runner.os }}-precommit-${{ hashFiles('.pre-commit-config.yaml') }}-${{ env.CACHE_NUMBER }} # yamllint disable-line rule:line-length | |
| - name: Install pre-commit hook environments | |
| if: steps.cache-pre-commit-hooks.outputs.cache-hit != 'true' | |
| run: | | |
| pre-commit install-hooks | |
| - name: Run pre-commit hooks | |
| run: | | |
| pre-commit run --all-files |