Skip to content

Commit

Permalink
cleanup push_pr workflow and include Python 3.12
Browse files Browse the repository at this point in the history
  • Loading branch information
schuenke committed Jan 17, 2025
1 parent 1588bd3 commit af1ce38
Showing 1 changed file with 38 additions and 32 deletions.
70 changes: 38 additions & 32 deletions .github/workflows/push_pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,44 +5,50 @@ on:
# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:

permissions:
contents: read

jobs:
tests:
name: Code tests (Python ${{ matrix.python-version }}, ${{ matrix.os }})
runs-on: ${{ matrix.os }}
name: Code tests
runs-on: ubuntu-latest

strategy:
fail-fast: false
matrix:
os: ["ubuntu-latest"]
python-version: ["3.8", "3.9", "3.10", "3.11"]
python-version: ["3.8", "3.9", "3.10", "3.11", "3.12"]
include-sigpy: [true, false]

steps:
- uses: actions/checkout@v4
with:
submodules: true
lfs: true
- uses: conda-incubator/setup-miniconda@v2
- name: Checkout Repository
uses: actions/checkout@v4

- name: Cache pip dependencies
uses: actions/cache@v3
with:
auto-update-conda: true
python-version: ${{ matrix.python-version }}
activate-environment: test
environment-file: .github/requirements.yml
auto-activate-base: false
channels: conda-forge
- shell: bash -l {0}
run: |
conda info
conda list
# - name: Lint
# shell: bash -l {0}
# run: |
# python -m flake8 pypulseq
- name: Run pytest
shell: bash -l {0}
path: ~/.cache/pip
key: ${{ runner.os }}-pip-${{ hashFiles('**/requirements*.txt') }}
restore-keys: |
${{ runner.os }}-pip-
- name: Install PyPulseq and dependencies
run: |
pip install .
pytest -m "not slow and not sigpy"
- name: Run pytest[sigpy]
shell: bash -l {0}
pip install --upgrade --upgrade-strategy eager .[test]
if [ ${{ matrix.include-sigpy }} == "true" ]; then
pip install sigpy
fi
- name: Run PyTest
run: |
pip install .[sigpy]
pytest -m "not slow"
continue-on-error: true
if [ ${{ matrix.include-sigpy }} == "true" ]; then
pytest -m "not slow"
else
pytest -m "not slow and not sigpy"
fi
continue-on-error: ${{ matrix.include-sigpy }}

concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}

# Cancel in-progress runs when a new workflow with the same group name is triggered
cancel-in-progress: true

0 comments on commit af1ce38

Please sign in to comment.