-
Notifications
You must be signed in to change notification settings - Fork 0
101 lines (94 loc) · 2.71 KB
/
coverage-run.yml
File metadata and controls
101 lines (94 loc) · 2.71 KB
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
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
on:
workflow_call:
inputs:
fetch-depth:
type: number
default: 1
required: false
lfs:
type: boolean
default: false
required: false
working-directory:
type: string
default: .
required: false
main_branch:
type: string
required: true
python_versions:
type: string
required: true
main_python_version:
type: string
required: true
pip_install:
type: string
default: -r requirements.txt -r tests/requirements.txt
apt_install:
type: string
required: false
gist-id:
type: string
required: true
gist-filename:
type: string
default: coverage.json
run:
type: string
required: false
env:
type: string
required: false
default: '{}'
secrets:
gist-auth:
required: true
jobs:
run_tests:
name: "Run tests"
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
python-version: ${{ fromJSON(inputs.python_versions) }}
steps:
- uses: actions/checkout@v4
if: github.event_name == 'pull_request' || github.ref == 'refs/heads/${{ inputs.main_branch }}'
with:
fetch-depth: ${{ inputs.fetch-depth }}
lfs: ${{ inputs.lfs }}
- name: Install system dependencies
if: ${{ inputs.apt_install }}
shell: bash
run: |
sudo apt install -y ${{ inputs.apt_install }}
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install ${{ inputs.pip_install }}
- name: Run custom command line
if: ${{ inputs.run != '' }}
uses: kostrykin/report-test-coverage-action@v1.2.0
with:
working-directory: ${{ inputs.working-directory }}
report: ${{ matrix.python-version == inputs.main_python_version }}
gist-id: ${{ inputs.gist-id }}
gist-auth: ${{ secrets.gist-auth }}
gist-filename: ${{ inputs.gist-filename }}
run: ${{ inputs.run }}
env: ${{ fromJSON(inputs.env) }}
- name: Run default command line
if: ${{ inputs.run == '' }}
uses: kostrykin/report-test-coverage-action@v1.2.0
with:
working-directory: ${{ inputs.working-directory }}
report: ${{ matrix.python-version == inputs.main_python_version }}
gist-id: ${{ inputs.gist-id }}
gist-auth: ${{ secrets.gist-auth }}
gist-filename: ${{ inputs.gist-filename }}
env: ${{ fromJSON(inputs.env) }}