feat!: upgrade to v3 #3
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: pre-commit | |
permissions: | |
contents: read | |
on: | |
workflow_dispatch: | |
pull_request: | |
branches: | |
- main | |
- master | |
jobs: | |
pre-commit: | |
runs-on: ubuntu-24.04 | |
steps: | |
- name: Install OS dependencies | |
run: sudo apt-get install -y libsqlite3-dev libbz2-dev # TODO remove once https://github.com/actions/runner-images/issues/11279 is resolved | |
- uses: actions/checkout@v4 | |
- name: Cache ASDF | |
uses: actions/cache@v4 | |
id: asdf-cache | |
with: | |
path: ~/.asdf/ | |
key: ${{ runner.os }}-asdf-${{ hashFiles('.tool-versions') }} | |
restore-keys: ${{ runner.os }}-asdf- | |
- name: Cache pip | |
uses: actions/cache@v4 | |
with: | |
path: ~/.cache/pip/ | |
key: ${{ runner.os }}-pip-${{ hashFiles('**/requirements*.txt', '.pre-commit-config.yaml') }} | |
restore-keys: | | |
${{ runner.os }}-pip- | |
- name: Setup ASDF | |
uses: asdf-vm/actions/setup@v3 | |
if: ${{ steps.asdf-cache.outputs.cache-hit == 'true' }} | |
- name: Install ASDF | |
uses: asdf-vm/actions/install@v3 | |
if: ${{ steps.asdf-cache.outputs.cache-hit != 'true' }} | |
- name: Reshim installed ASDF tools | |
shell: bash | |
run: asdf reshim | |
- name: Install pip dependencies | |
run: pip install -r requirements.txt | |
- name: Run pre-commit | |
run: pre-commit run --show-diff-on-failure --color=always --all-files |