-
Notifications
You must be signed in to change notification settings - Fork 15
93 lines (82 loc) · 2.82 KB
/
Copy path_test.yaml
File metadata and controls
93 lines (82 loc) · 2.82 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
# -*- mode: yaml; coding: utf-8 -*-
#
# Copyright (C) 2023 Benjamin Thomas Schwertfeger
# All rights reserved.
# https://github.com/btschwertfeger
#
# Template workflow to run the unit tests of the package and upload the
# coverage report of the ubuntu-latest/3.11 matrix cell to Codecov.
#
name: Test Spot
on:
workflow_call:
inputs:
os:
type: string
required: true
python-version:
type: string
required: true
secrets:
CODECOV_TOKEN:
required: false
permissions: read-all
jobs:
Test:
name: Test ${{ inputs.os }} ${{ inputs.python-version }}
runs-on: ${{ inputs.os }}
env:
OS: ${{ inputs.os }}
PYTHON: ${{ inputs.python-version }}
steps:
- name: Harden Runner
uses: step-security/harden-runner@9af89fc71515a100421586dfdb3dc9c984fbf411 # v2.19.4
with:
disable-sudo: true
egress-policy: audit
- name: Checkout repository
uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
- name: Set up Python ${{ inputs.python-version }}
uses: actions/setup-python@ece7cb06caefa5fff74198d8649806c4678c61a1 # v6.3.0
with:
python-version: ${{ inputs.python-version }}
- name: Install dependencies
run: python -m pip install --user --upgrade pip
- name: Install package
run: python -m pip install --user . -r requirements-dev.txt
- name: Run unit tests
run: >
pytest -vv --retries 1 -n auto --cov --cov-report=xml
--junitxml=junit-unittests.xml -o junit_family=legacy tests
- name: Upload coverage to Codecov
if: |
inputs.os == 'ubuntu-latest'
&& inputs.python-version == '3.11'
&& github.actor == 'btschwertfeger'
&& (github.event_name == 'push' || github.event_name == 'release')
uses: codecov/codecov-action@fb8b3582c8e4def4969c97caa2f19720cb33a72f # v7.0.0
with:
token: ${{ secrets.CODECOV_TOKEN }}
files: coverage.xml
env_vars: OS,PYTHON
fail_ci_if_error: true
flags: unittests
report_type: coverage
name: codecov-umbrella
verbose: true
- name: Upload test results to Codecov
if: |
inputs.os == 'ubuntu-latest'
&& inputs.python-version == '3.11'
&& github.actor == 'btschwertfeger'
&& (github.event_name == 'push' || github.event_name == 'release')
uses: codecov/codecov-action@fb8b3582c8e4def4969c97caa2f19720cb33a72f # v7.0.0
with:
token: ${{ secrets.CODECOV_TOKEN }}
files: junit-unittests.xml
env_vars: OS,PYTHON
fail_ci_if_error: true
flags: unittests
report_type: test_results
name: codecov-umbrella
verbose: true