Skip to content

Commit

Permalink
ci: runs test only for non-style commit. (#73)
Browse files Browse the repository at this point in the history
  • Loading branch information
paquiteau authored Jan 8, 2024
1 parent 8872cac commit aa1daeb
Show file tree
Hide file tree
Showing 2 changed files with 42 additions and 27 deletions.
40 changes: 40 additions & 0 deletions .github/workflows/style.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
name: Style checking

on:
push:
branches: [ "master" ]
pull_request:
branches: [ "master" ]

workflow_dispatch:

env:
PYTHON_VERSION: "3.10"
BART_VERSION: "0.8.00"
ref_backend: "finufft"

jobs:
linter-check:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Set up Python ${{ env.PYTHON_VERSION }}
uses: actions/setup-python@v4
with:
python-version: ${{ env.PYTHON_VERSION }}
cache: pip

- name: Install Python deps
shell: bash
run: |
python -m pip install --upgrade pip
python -m pip install -e .[test,dev]
- name: Black Check
shell: bash
run: black . --diff --color --check

- name: ruff Check
shell: bash
run: ruff src
29 changes: 2 additions & 27 deletions .github/workflows/test-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,34 +14,9 @@ env:
ref_backend: "finufft"

jobs:
linter-check:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Set up Python ${{ env.PYTHON_VERSION }}
uses: actions/setup-python@v4
with:
python-version: ${{ env.PYTHON_VERSION }}
cache: pip

- name: Install Python deps
shell: bash
run: |
python -m pip install --upgrade pip
python -m pip install -e .[test,dev]
- name: Black Check
shell: bash
run: black . --diff --color --check

- name: ruff Check
shell: bash
run: ruff src

test-cpu:
runs-on: ubuntu-latest
needs: linter-check
if: ${{ !contains(github.event.head_commit.message, "style")}}
strategy:
matrix:
backend: [finufft, pynfft, pynufft, bart, sigpy]
Expand Down Expand Up @@ -115,7 +90,7 @@ jobs:

test-gpu:
runs-on: GPU
needs: linter-check
if: ${{ !contains(github.event.head_commit.message, "style")}}
strategy:
matrix:
backend: [gpunufft, cufinufft]
Expand Down

0 comments on commit aa1daeb

Please sign in to comment.