-
Notifications
You must be signed in to change notification settings - Fork 100
139 lines (121 loc) · 3.67 KB
/
Copy pathci-tests.yaml
File metadata and controls
139 lines (121 loc) · 3.67 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
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
name: CI
on:
push:
branches:
- master
pull_request:
branches:
- master
concurrency:
group: ${{ github.head_ref || github.run_id }}
cancel-in-progress: true
jobs:
test-python:
name: "Tests Python (${{ matrix.environment }}, ${{ matrix.os }})"
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
environment: [py310, py314]
os: [ubuntu-latest, macos-latest]
steps:
- uses: actions/checkout@v7
- uses: prefix-dev/setup-pixi@v0.10.2
with:
pixi-version: v0.76.2
cache: true
cache-write: ${{ github.event_name == 'push' && github.ref_name == 'master' }}
frozen: true
environments: ${{ matrix.environment }}
- name: Run tests
run: pixi run -e ${{ matrix.environment }} test-py
env:
PYTEST_XDIST_AUTO_NUM_WORKERS: 4
- name: Upload coverage to Codecov (partial)
if: matrix.environment == 'py314' && matrix.os == 'ubuntu-latest'
uses: codecov/codecov-action@v7
with:
token: ${{ secrets.CODECOV_TOKEN }}
partial: true
flags: core-tests
files: coverage.xml
test-r:
name: "Tests vs R (${{ matrix.test-task }})"
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
test-task: [test-r-core-other, test-r-extended, test-r-fixest, test-r-hac]
steps:
- uses: actions/checkout@v7
- uses: prefix-dev/setup-pixi@v0.10.2
with:
pixi-version: v0.76.2
cache: true
cache-write: ${{ github.event_name == 'push' && github.ref_name == 'master' }}
frozen: true
environments: py312-r
- name: Run fast R preflight
if: matrix.test-task == 'test-r-fixest'
run: pixi run -e py312-r test-r-fixest-fast
- name: Run ${{ matrix.test-task }}
run: pixi run -e py312-r ${{ matrix.test-task }}
env:
PYTEST_XDIST_AUTO_NUM_WORKERS: 4
- name: Upload coverage to Codecov (partial)
uses: codecov/codecov-action@v7
with:
token: ${{ secrets.CODECOV_TOKEN }}
partial: true
flags: ${{ matrix.test-task }}
files: coverage.xml
merge_coverage:
name: "Merge Coverage"
runs-on: ubuntu-latest
needs: [test-python, test-r]
steps:
- name: Final coverage merge
uses: codecov/codecov-action@v7
with:
token: ${{ secrets.CODECOV_TOKEN }}
partial: false
flags: final
build-docs:
name: "Build Docs"
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v7
- uses: prefix-dev/setup-pixi@v0.10.2
with:
pixi-version: v0.76.2
cache: true
cache-write: ${{ github.event_name == 'push' && github.ref_name == 'master' }}
frozen: true
environments: docs
- name: Build and render docs
run: pixi run -e docs docs-render
- name: Save docs artifact
uses: actions/upload-artifact@v7
with:
name: docs-html
path: docs/_site
publish-docs:
name: "Publish Docs"
runs-on: ubuntu-latest
permissions:
contents: write
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
needs: ["build-docs", "test-python"]
if: github.ref == 'refs/heads/master'
steps:
- name: Download docs artifact
uses: actions/download-artifact@v8
with:
name: docs-html
path: docs/_site
- name: Publish docs to GitHub Pages
uses: peaceiris/actions-gh-pages@v4
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: docs/_site