fix2 #135
Workflow file for this run
This file contains 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: # Start the job on all PRs | |
push: | |
branches: | |
- master | |
- main | |
jobs: | |
precommit: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
- name: Set up Python | |
uses: actions/setup-python@v4 | |
with: | |
python-version: "3.10" | |
- name: Install Rust Toolchain | |
uses: dtolnay/rust-toolchain@nightly | |
- name: Cache pip dependencies | |
uses: actions/cache@v3 | |
with: | |
path: ~/.cache/pip | |
key: ${{ runner.os }}-pip- | |
restore-keys: | | |
${{ runner.os }}-pip- | |
- name: Cache shfmt binary | |
uses: actions/cache@v3 | |
with: | |
path: /usr/local/bin/shfmt | |
key: ${{ runner.os }}-shfmt- | |
restore-keys: | | |
${{ runner.os }}-shfmt- | |
- name: Cache Pre-Commit environments | |
uses: actions/cache@v3 | |
with: | |
path: ~/.cache/pre-commit | |
key: ${{ runner.os }}-pc-${{ hashFiles('.pre-commit-config.yaml') }} | |
restore-keys: | | |
${{ runner.os }}-pc-${{ hashFiles('.pre-commit-config.yaml') }} | |
${{ runner.os }}-pc- | |
- name: Install dependencies | |
run: | | |
echo "uname=$(uname)" | |
make setuppc | |
- name: Run pre-commits | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
run: | | |
DEFAULT_BRANCH=$(git symbolic-ref refs/remotes/origin/HEAD | sed 's@^refs/remotes/origin/@@') | |
echo "Default branch = $DEFAULT_BRANCH" | |
echo "Current SHA = ${{ github. sha }}" | |
pre-commit run --from-ref origin/$DEFAULT_BRANCH --to-ref "${{ github. sha }}" |