Skip to content

Commit

Permalink
Properly implement workflow_call procedure
Browse files Browse the repository at this point in the history
  • Loading branch information
janbridley committed May 10, 2024
1 parent 32984ad commit 0646b07
Show file tree
Hide file tree
Showing 2 changed files with 36 additions and 39 deletions.
44 changes: 5 additions & 39 deletions .github/workflows/CI.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,47 +14,13 @@ on:


jobs:
set_up_tests:
runs-on: ubuntu-latest
steps:
# Steps common to both groups
- uses: actions/checkout@v4
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: |
python -m pip install -r requirements.txt
python -m pip install -r tests/requirements.txt
- name: Install package
run: |
python --version
python -c "import parsnip; print('parsnip', parsnip.__version__)"
python -m pip install . -v --progress-bar off
- name: Test with pytest
run: |
python -m pytest -v
modern_python_tests:
needs: set_up_tests
runs-on: ubuntu-latest
strategy:
fail-fast: true
matrix:
python-version: [3.9, 3.10, 3.11, 3.12]
steps:
- name: Echo success
run: |
echo "Successfully ran tests for ${{ matrix.python-version }}"
legacy_python_tests:
needs: set_up_tests
runs-on: ubuntu-latest
strategy:
matrix:
python-version: [3.6, 3.7, 3.8]
steps:
- name: Echo success
run: |
echo "Successfully ran tests for ${{ matrix.python-version }}"
# Pull in the test script from run_tests and distribute python from matrix versions
uses: ./.github/workflows/run_tests.yaml
with:
python-version: ${{ matrix.python-version }}
31 changes: 31 additions & 0 deletions .github/workflows/run_tests.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
name: Run tests

on:
workflow_call:
inputs:
python-version:
required: true
type: string

jobs:
run_test:
runs-on: ubuntu-latest
steps:
# Steps common to both groups
- uses: actions/checkout@v4
- name: Set up Python ${{ inputs.python-version }}
uses: actions/setup-python@v5
with:
python-version: ${{ inputs.python-version }}
- name: Install dependencies
run: |
python -m pip install -r requirements.txt
python -m pip install -r tests/requirements.txt
- name: Install package
run: |
python --version
python -m pip install . -v --progress-bar off
python -c "import parsnip; print('parsnip', parsnip.__version__)"
- name: Test with pytest
run: |
python -m pytest -v

0 comments on commit 0646b07

Please sign in to comment.