Skip to content

Test

Test #198

Workflow file for this run

name: Test
on:
workflow_run:
workflows: ["Docker build"]
types:
- completed
jobs:
in-docker:
runs-on: ubuntu-latest
container:
image: docker://${{ github.repository }}:sha-${{ github.sha }}
if: ${{ github.event.workflow_run.conclusion == 'success' }}
steps:
- uses: actions/checkout@v3
- name: Install dev dependencies
run: |
poetry install --all-extras
- name: Test
run: poetry run pytest tests/
in-os:
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
python-version: ["3.10"]
os: [ubuntu-latest]
steps:
- uses: actions/checkout@v3
- name: Ubuntu cache
uses: actions/cache@v3
if: startsWith(matrix.os, 'ubuntu')
with:
path: ~/.cache/pip
key:
${{ matrix.os }}-${{ matrix.python-version }}-${{ hashFiles('**/pyproject.toml') }}
restore-keys: |
${{ matrix.os }}-${{ matrix.python-version }}-
- name: macOS cache
uses: actions/cache@v3
if: startsWith(matrix.os, 'macOS')
with:
path: ~/Library/Caches/pip
key:
${{ matrix.os }}-${{ matrix.python-version }}-${{ hashFiles('**/pyproject.toml') }}
restore-keys: |
${{ matrix.os }}-${{ matrix.python-version }}-
- name: Windows cache
uses: actions/cache@v3
if: startsWith(matrix.os, 'windows')
with:
path: c:\users\runneradmin\appdata\local\pip\cache
key:
${{ matrix.os }}-${{ matrix.python-version }}-${{ hashFiles('**/pyproject.toml') }}
restore-keys: |
${{ matrix.os }}-${{ matrix.python-version }}-
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
- name: Install dev dependencies
run: |
python -m pip install --upgrade pip
python -m pip install --upgrade poetry==1.3.2
poetry install --all-extras
- name: Test
shell: bash
run: |
poetry run pytest tests/ -s --cov=${{ github.event.repository.name }}/ --cov-report=term-missing ${@-}
poetry run coverage xml
- name: Report Coverage
if: matrix.os == 'ubuntu-latest' && matrix.python-version == '3.11'
uses: codecov/codecov-action@v3