update workflow #2
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: CI | |
on: | |
push: | |
branches: [ "main" ] | |
pull_request: | |
branches: [ "main" ] | |
workflow_dispatch: | |
jobs: | |
linter-check: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v3 | |
- name: Set up Python "3.10" | |
uses: actions/setup-python@v4 | |
with: | |
python-version: "3.10" | |
- name: Black setup | |
shell: bash | |
run: pip install black ruff mypy | |
- name: Black Check | |
shell: bash | |
run: black . --diff --color --check | |
test-cpu: | |
runs-on: ubuntu-latest | |
needs: linter-check | |
strategy: | |
fail-fast: true | |
matrix: | |
python-version: ["3.12", "3.9"] | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Set up Python ${{ matrix.python-version }} | |
uses: actions/setup-python@v4 | |
with: | |
python-version: ${{ matrix.python-version }} | |
- name: Install Dependencies | |
shell: bash | |
run: | | |
python --version | |
python -m pip install --upgrade pip | |
python -m pip install .[test] | |
- name: Run Tests | |
shell: bash | |
run: | | |
pytest -n auto --cov=src --cov-report xml:coverage.xml --cov-report term-missing:skip-covered |