mirror of
https://github.com/jongracecox/anybadge.git
synced 2025-07-21 12:21:03 +02:00
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:
committed by
Jon Grace-Cox
parent
96d102f307
commit
9d660b5652
@@ -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
|
29
.github/workflows/pre_commit_check.yaml
vendored
29
.github/workflows/pre_commit_check.yaml
vendored
@@ -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
|
Reference in New Issue
Block a user