-
Notifications
You must be signed in to change notification settings - Fork 2
140 lines (116 loc) · 3.51 KB
/
test.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
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
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
name: test
on:
pull_request:
push:
branches: [main]
jobs:
pyrenew-hew-test:
name: Run pyrenew_hew tests and collect coverage
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: "3.12"
- name: cache poetry
uses: actions/cache@v4
with:
path: ~/.local
key: ${{ runner.os }}-poetry
- name: install poetry
run: pip install poetry
- name: install package
run: poetry install --with test
- name: run tests
run: |
poetry run pytest \
--mpl --mpl-default-tolerance=10 \
--cov=pyrenew_hew --cov-report=term --cov-report=xml:pyrenew_hew-coverage.xml .
- name: Upload results to Codecov
uses: codecov/codecov-action@v5
with:
env_vars: OS,PYTHON
fail_ci_if_error: true
flags: pyrenew_hew
files: pyrenew_hew-coverage.xml
token: ${{ secrets.CODECOV_TOKEN }}
verbose: true
pipelines-test:
name: Run pipelines tests and collect coverage
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: "3.12"
- name: cache poetry
uses: actions/cache@v4
with:
path: ~/.local
key: ${{ runner.os }}-poetry
- name: install poetry
run: pip install poetry
- name: install package
run: poetry install --with test
- name: run tests
run: |
poetry run pytest \
--mpl --mpl-default-tolerance=10 \
--cov=pipelines --cov-report=term --cov-report=xml:pipelines-coverage.xml .
- name: Upload results to Codecov
uses: codecov/codecov-action@v5
with:
env_vars: OS,PYTHON
fail_ci_if_error: true
flags: pipelines
files: pipelines-coverage.xml
token: ${{ secrets.CODECOV_TOKEN }}
verbose: true
hewr-test:
name: Run hewr tests and collect coverage
runs-on: ubuntu-latest
env:
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }}
steps:
- uses: actions/checkout@v4
- uses: r-lib/actions/setup-r@v2
with:
use-public-rspm: true
- uses: r-lib/actions/setup-r-dependencies@v2
with:
extra-packages: any::covr, any::xml2
needs: coverage
working-directory: hewr
- name: Test coverage
run: |
cov <- covr::package_coverage(
path = "hewr",
quiet = FALSE,
clean = FALSE,
install_path = file.path(normalizePath(Sys.getenv("RUNNER_TEMP"), winslash = "/"), "package")
)
covr::to_cobertura(cov)
shell: Rscript {0}
- uses: codecov/codecov-action@v5
with:
fail_ci_if_error: true
files: ./cobertura.xml
plugins: noop
flags: hewr
disable_search: true
token: ${{ secrets.CODECOV_TOKEN }}
- name: Show testthat output
if: always()
run: |
find '${{ runner.temp }}/package' -name 'testthat.Rout*' -exec cat '{}' \; || true
shell: bash
- name: Upload test results
if: failure()
uses: actions/upload-artifact@v4
with:
name: coverage-test-failures
path: ${{ runner.temp }}/package