-
Notifications
You must be signed in to change notification settings - Fork 37
183 lines (153 loc) · 5.21 KB
/
ci-tests.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
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
name: CI
on:
push:
branches:
- master
pull_request:
branches:
- master
jobs:
test:
name: "Tests Core"
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: ["ubuntu-latest"]
python-version: ["3.9", "3.12"]
pytest_opts: ["--workers 4 --tests-per-worker 1"]
steps:
- name: Checkout source
uses: actions/checkout@v4
- name: Setup python
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
architecture: x64
- uses: prefix-dev/setup-pixi@v0.8.1
with:
pixi-version: v0.29.0
cache: true
- name: set numba parallel flags
run: |
echo "NUMBA_NUM_THREADS=1" >> $GITHUB_ENV
- name: Setup r2u
uses: eddelbuettel/github-actions/r2u-setup@master
- name: Print R version
run: |
Rscript -e 'R.version'
- name: Install R packages
run: |
R_LIB_PATH="${{ github.workspace }}/.pixi/envs/dev/lib/R/library"
mkdir -p $R_LIB_PATH
Rscript -e ".libPaths('$R_LIB_PATH'); install.packages(c('fixest', 'broom', 'did2s', 'wildrwolf', 'ivDiag', 'car'), lib='/home/runner/work/pyfixest/pyfixest/.pixi/envs/dev/lib/R/library')"
Rscript -e ".libPaths('$R_LIB_PATH'); install.packages('ritest', lib='/home/runner/work/pyfixest/pyfixest/.pixi/envs/dev/lib/R/library', repos = c('https://grantmcdermott.r-universe.dev'))"
- name: Run 'regular 'tests
run: |
pixi run tests-regular
# Run tests for PRs with the label "tests-extended"
- name: Run tests for plots (only on PRs with the 'tests-extended' label)
if: github.event_name == 'pull_request' && contains(github.event.label.name, 'tests-extended')
run: pixi run tests-extended
# Run tests for push to master
- name: Run tests for push to master
if: github.event_name == 'push' && github.ref == 'refs/heads/master'
run: pixi run tests-extended
- name: Upload to Codecov
uses: codecov/codecov-action@v4
with:
token: ${{ secrets.CODECOV_TOKEN }}
partial: true
flags: core-tests
test_slow:
name: "Tests vs fixest"
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: ["ubuntu-latest"]
python-version: ["3.9", "3.12"]
pytest_opts: ["--workers 4 --tests-per-worker 1"]
steps:
- name: Checkout source
uses: actions/checkout@v4
- name: Setup python
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
architecture: x64
- uses: prefix-dev/setup-pixi@v0.8.1
with:
pixi-version: v0.29.0
cache: true
- name: set numba parallel flags
run: |
echo "NUMBA_NUM_THREADS=1" >> $GITHUB_ENV
- name: Setup r2u
uses: eddelbuettel/github-actions/r2u-setup@master
- name: Install R packages
run: |
R_LIB_PATH="${{ github.workspace }}/.pixi/envs/dev/lib/R/library"
mkdir -p $R_LIB_PATH
Rscript -e ".libPaths('$R_LIB_PATH'); install.packages(c('fixest', 'broom','did2s', 'wildrwolf', 'ivDiag', 'car'), lib='/home/runner/work/pyfixest/pyfixest/.pixi/envs/dev/lib/R/library')"
Rscript -e ".libPaths('$R_LIB_PATH'); install.packages('ritest', lib='/home/runner/work/pyfixest/pyfixest/.pixi/envs/dev/lib/R/library', repos = c('https://grantmcdermott.r-universe.dev'))"
- name: Run 'slow 'tests
run: |
pixi run tests-slow
#- name: Upload to Codecov
# uses: codecov/codecov-action@v4
# with:
# token: ${{ secrets.CODECOV_TOKEN }}
# partial: true
# flags: tests-vs-fixest
build-docs:
name: "Build Docs"
runs-on: ubuntu-latest
needs: ["test"]
steps:
- name: Checkout source
uses: actions/checkout@v4
- name: Setup python
uses: actions/setup-python@v5
with:
python-version: "3.11"
- uses: prefix-dev/setup-pixi@v0.8.1
with:
pixi-version: v0.29.0
cache: true
- name: Set up Quarto
uses: quarto-dev/quarto-actions/setup@v2
- name: install tinytex
run: |
quarto install tinytex
- name: Compile docstrings with quartodoc
run: |
pixi run docs-build
- name: Render docs
run: |
pixi run docs-render
- name: Save docs artifact
uses: actions/upload-artifact@v4
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"]
if: github.ref == 'refs/heads/master'
steps:
- name: Download docs artifact
uses: actions/download-artifact@v4
with:
name: docs-html
path: docs/_site
- name: Publish docs to GitHub Pages
uses: peaceiris/actions-gh-pages@v3
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: docs/_site