Skip to content

.github/workflows/_test.yml #2

.github/workflows/_test.yml

.github/workflows/_test.yml #2

Workflow file for this run

on:
workflow_call:
inputs:
python-version:
type: string
description: The version of python to install
required: true
runs-on:
type: string
description: The runner to run this job on
required: true
secrets:
CODECOV_TOKEN:
required: true
env:
# https://github.com/pytest-dev/pytest/issues/2042
PY_IGNORE_IMPORTMISMATCH: "1"
jobs:
run:
runs-on: ${{ inputs.runs-on }}
steps:
- name: Checkout
uses: actions/checkout@v4
with:
# Need this to get version number from last tag
fetch-depth: 0
- if: inputs.python-version == 'dev_container'
name: Install dev_container versions of python packages
uses: ./.github/actions/install_requirements
with:
docker-image: : ${{ github.event.inputs.docker-image }}

Check failure on line 35 in .github/workflows/_test.yml

View workflow run for this annotation

GitHub Actions / .github/workflows/_test.yml

Invalid workflow file

You have an error in your yaml syntax on line 35
- if: inputs.python-version == 'dev_container'
name: Write the requirements as an artifact
run: pip freeze --exclude-editable > /tmp/dev-requirements.txt
- if: inputs.python-version == 'dev_container'
name: Upload dev-requirements.txt
uses: actions/upload-artifact@v4
with:
name: dev-requirements
path: /tmp/dev-requirements.txt
- if: inputs.python-version != 'dev_container'
name: Install latest versions of python packages
uses: ./.github/actions/install_requirements
with:
python-version: ${{ inputs.python-version }}
pip-install: ".[dev]"
- name: Run tests
run: tox -e tests
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v4
with:
name: ${{ inputs.python-version }}/${{ inputs.runs-on }}
files: cov.xml
env:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}