refactor: Refactor PR checks into single workflow

Refactor the pre-commit and python test workflows into a single workflow
in order to use pre-commit check as a gate for Python tests. This will help
limit execution of Python tests.
This commit is contained in:
Jon Grace-Cox
2024-12-30 07:38:23 -05:00
committed by Jon Grace-Cox
parent 96d102f307
commit 9d660b5652
2 changed files with 24 additions and 32 deletions

View File

@@ -1,6 +1,6 @@
---
name: Python tests
name: PR Check
on:
pull_request:
@@ -8,11 +8,32 @@ on:
- master
jobs:
build:
pre-commit:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: '3.12'
- name: Install dependencies
run: |
python -m pip install --upgrade pip setuptools wheel
pip install -r build-requirements.txt
pip install pre-commit
- name: Run pre-commit
run: pre-commit run --all-files
python-tests:
needs: pre-commit
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Set up Python
uses: actions/setup-python@v4

View File

@@ -1,29 +0,0 @@
---
name: Pre-commit hooks
on:
pull_request:
branches:
- master
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: '3.12'
- name: Install dependencies
run: |
python -m pip install --upgrade pip setuptools wheel
pip install -r build-requirements.txt
pip install pre-commit
- name: Run pre-commit
run: pre-commit run --all-files