-
Notifications
You must be signed in to change notification settings - Fork 2
67 lines (63 loc) · 1.85 KB
/
pytest.yaml
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
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
---
name: Run tests
on: # yamllint disable-line rule:truthy
workflow_call:
inputs:
codecov:
description: 'run codecov action after testing'
default: true
required: false
type: boolean
matrix-filter:
description: 'jq filter string indicating which configuration(s)
should be included'
default: '.'
required: false
type: string
repository:
description: 'repository to test if different from current'
default: ''
required: false
type: string
setup-repository:
description: 'repository used during job setup'
default: 'colcon/ci'
required: false
type: string
secrets:
CODECOV_TOKEN:
description: 'token to use when running codecov action after testing'
required: false
jobs:
setup:
runs-on: ubuntu-latest
outputs:
strategy: ${{ steps.load.outputs.strategy }}
steps:
- uses: actions/checkout@v4
with:
repository: ${{ inputs.setup-repository }}
- id: load
run: |
strategy=$(jq -c -M '${{ inputs.matrix-filter }}' strategy.json)
echo "strategy=${strategy}" >> $GITHUB_OUTPUT
pytest:
needs: [setup]
strategy: ${{ fromJson(needs.setup.outputs.strategy) }}
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v4
with:
repository: ${{ inputs.repository }}
- uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python }}
- uses: actions/checkout@v4
with:
repository: ${{ inputs.setup-repository }}
path: ./.github-ci-action-repo
- uses: ./.github-ci-action-repo
- uses: codecov/codecov-action@v4
env:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
if: ${{ inputs.codecov }}