Skip to content

Commit

Permalink
move unit tests into a composite action
Browse files Browse the repository at this point in the history
  • Loading branch information
mikealfare committed Nov 22, 2023
1 parent c689ef2 commit 99087d9
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 15 deletions.
22 changes: 22 additions & 0 deletions .github/actions/run-unit-tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
name: Unit Tests / Python ${{ inputs.python-version }}
inputs:
python-version:
required: true
default: '3.8'
runs:
using: 'composite'
steps:
- name: Check out the repository
uses: actions/checkout@v3
with:
persist-credentials: false
- name: Set up Python ${{ inputs.python-version }}
uses: actions/setup-python@v4
with:
python-version: ${{ inputs.python-version }}
- name: Install dependencies
run: |
python -m pip install --user --upgrade pip
python -m pip install .[test]
- name: Run unit tests
run: python -m pytest tests/unit
16 changes: 1 addition & 15 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -71,24 +71,10 @@ jobs:
python-version: ['3.8', '3.9', '3.10', '3.11']

steps:
- name: Check out the repository
uses: actions/checkout@v3
with:
persist-credentials: false

- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
- uses: actions/run-unit-tests
with:
python-version: ${{ matrix.python-version }}

- name: Install dependencies
run: |
python -m pip install --user --upgrade pip
python -m pip install .[test]
- name: Run unit tests
run: python -m pytest tests/unit

- name: Get current date
if: always()
id: date
Expand Down

0 comments on commit 99087d9

Please sign in to comment.