Testing #504
This file contains hidden or 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: "Testing" | |
on: | |
push: | |
branches: | |
- main | |
pull_request: | |
branches: | |
- main | |
types: | |
- opened | |
- synchronize | |
workflow_run: | |
workflows: ["lint"] | |
types: | |
- completed | |
workflow_dispatch: | |
jobs: | |
test: | |
strategy: | |
matrix: | |
python-version: ["3.9", "3.10", "3.11", "3.12"] | |
os: [ubuntu-latest, windows-latest, macos-latest] | |
name: Install and test package on ${{ matrix.os }} for Python ${{ matrix.python-version }} | |
runs-on: ${{ matrix.os }} | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v3 | |
- name: Setup Python ${{ matrix.python-version }} | |
uses: actions/setup-python@v4 | |
with: | |
python-version: ${{ matrix.python-version }} | |
- name: Install package [pip] | |
run: | | |
python -m pip install --upgrade pip | |
pip install -r requirements.txt | |
pip install pytest coverage | |
- name: Run tests with Pytest | |
run: | | |
coverage run -m pytest | |
- name: Coverage | |
run: | | |
coverage report | |
coverage json | |
- name: Metadata check | |
if: ${{ matrix.python-version == '3.8' && matrix.os == 'ubuntu-latest' }} | |
run: | | |
python .github/scripts/metadata_checker | |
- name: Upload coverage to Codecov | |
if: ${{ matrix.python-version == '3.8' && matrix.os == 'ubuntu-latest' }} | |
uses: codecov/codecov-action@v3 | |
with: | |
token: ${{ secrets.CODECOV_TOKEN }} |