Skip to content

Test

Test #777

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.event.workflow_run.head_sha }}
if: ${{ github.event.workflow_run.conclusion == 'success' }}
steps:
- uses: actions/checkout@v3
with:
ref: ${{ github.event.workflow_run.head_branch }}
fetch-depth: 0
- name: Install dev dependencies
run: |
poetry install --all-extras
- name: Test
run: poetry run pytest tests/ --trace-config
in-os:
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
python-version: ["3.11"]
os: [ubuntu-latest]
steps:
- uses: actions/checkout@v3
with:
ref: ${{ github.event.workflow_run.head_branch }}
fetch-depth: 0
- 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 --trace-config --cov=${{ github.event.repository.name }}/ --cov-report=term-missing ${@-}
poetry run coverage xml
- name: Report Coverage
if: github.ref_name == 'main' && matrix.os == 'ubuntu-latest' && matrix.python-version == '3.11'
uses: codecov/codecov-action@v4