init commit #1
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Tests | |
on: | |
workflow_dispatch: {} | |
workflow_call: {} | |
push: {} | |
jobs: | |
test: | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
# was unable to biuld with: 3.7, 3.8, or 3.9 | |
python-version: ["3.10", "3.11"] | |
steps: | |
# checkout code | |
- name: Checkout Code | |
uses: actions/checkout@v3 | |
# install python | |
- name: Set up Python ${{ matrix.python-version }} | |
uses: actions/setup-python@v4 | |
with: | |
python-version: ${{ matrix.python-version }} | |
cache: 'pip' | |
# install the project | |
- name: Install dependencies | |
run: | | |
pip install .[build] | |
pip install .[test] | |
pip install . | |
# do linting | |
- name: Lint with ruff | |
run: | | |
# stop the build if there are Python syntax errors or undefined names | |
# ruff --format=github --select=E9,F63,F7,F82 --target-version=py37 . | |
ruff ./src | |
# run the tests | |
- name: Test with pytest | |
run: | | |
pytest src --junit-xml=test-results.xml | |
- name: Surface failing tests | |
if: always() | |
uses: pmeier/pytest-results-action@main | |
with: | |
path: test-results.xml | |
summary: true | |
display-options: fEX | |
fail-on-empty: true |