Skip to content

Commit

Permalink
ci: pre-commit jobs
Browse files Browse the repository at this point in the history
* Add pre-commit check to CI

* fixes
  • Loading branch information
emlowe authored Oct 30, 2024
1 parent b3d697d commit ed45bc2
Showing 1 changed file with 68 additions and 0 deletions.
68 changes: 68 additions & 0 deletions .github/workflows/pre-commit.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
name: 🚨 pre-commit

on:
pull_request:
push:
branches:
- "long_lived/**"
- main
- "release/**"

concurrency:
group: ${{ github.event_name == 'pull_request' && format('{0}-{1}', github.workflow_ref, github.event.pull_request.number) || github.run_id }}
cancel-in-progress: true

jobs:
pre-commit:
name: ${{ matrix.os.name }} ${{ matrix.python.major_dot_minor }}
runs-on: ${{ matrix.os.runs-on }}
timeout-minutes: 20
strategy:
fail-fast: false
matrix:
os:
- name: Linux
matrix: linux
runs-on: ubuntu-latest
- name: macOS
matrix: macos
runs-on: macos-13-arm64
python:
- major_dot_minor: "3.10"
- major_dot_minor: "3.11"
- major_dot_minor: "3.12"

steps:
- name: Clean workspace
uses: Chia-Network/actions/clean-workspace@main

- uses: Chia-Network/actions/git-mark-workspace-safe@main

- name: disable git autocrlf
run: |
git config --global core.autocrlf false
- uses: actions/checkout@v4

- uses: Chia-Network/actions/setup-python@main
with:
python-version: ${{ matrix.python.major_dot_minor }}

- name: Create virtual environment
uses: Chia-Network/actions/create-venv@main
id: create-venv

- name: Activate virtual environment
uses: Chia-Network/actions/activate-venv@main
with:
directories: ${{ steps.create-venv.outputs.activate-venv-directories }}

- name: Run poetry install
uses: Chia-Network/actions/poetry@main
with:
poetry-command: "install --with dev"

- env:
CHIA_MANAGE_CLVM_CHECK_USE_CACHE: "false"
CHIA_MANAGE_MYPY_CHECK_EXCLUSIONS: "true"
run: poetry run pre-commit run --all-files --verbose

0 comments on commit ed45bc2

Please sign in to comment.