-
Notifications
You must be signed in to change notification settings - Fork 1
41 lines (36 loc) · 1.06 KB
/
reusable-pytest.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
on:
workflow_call:
inputs:
local_package_name:
required: true
type: string
python_versions:
required: false
default: >-
["3.9", "3.10", "3.11", "3.12"]
description: JSON string containing the list of python versions to test
type: string
fail_fast:
required: false
default: false
description: Cancel all in-progress and queued pytest jobs if any job in the matrix fails
type: boolean
jobs:
pytest:
runs-on: ubuntu-latest
strategy:
fail-fast: ${{ inputs.fail_fast }}
matrix:
python_version: ${{ fromJson(inputs.python_versions) }}
steps:
- uses: actions/checkout@v4
- uses: mamba-org/setup-micromamba@v2
with:
environment-file: environment.yml
create-args: >-
python=${{ matrix.python_version }}
- name: Pytest in conda environment
shell: bash -l {0}
run: |
python -m pip install --no-deps .
pytest --cov=${{ inputs.local_package_name }}