-
Notifications
You must be signed in to change notification settings - Fork 330
200 lines (173 loc) · 7.26 KB
/
test-ff-matrix.yml
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
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
# Tests all documents in the feature-format matrix
name: Feature-Format Tests
on:
workflow_dispatch:
schedule:
# run daily at 1am UTC
- cron: "0 1 * * *"
# Deactivating run on commits for now
## push:
## branches: [main]
## paths-ignore:
## - "news/**"
## - "src/resources/language/**"
## pull_request:
## branches: [main]
## paths-ignore:
## - "src/resources/language/**"
concurrency:
# Use github.run_id on main branch
# Use github.event.pull_request.number on pull requests, so it's unique per pull request
# Use github.ref on other branches, so it's unique per branch
group: ${{ github.workflow }}-${{ github.ref == 'refs/heads/main' && github.run_id || github.event.pull_request.number || github.ref }}
cancel-in-progress: true
jobs:
run-smokes:
name: Run feature-format matrix on (${{ matrix.os }})
if: github.event_name != 'schedule' || (github.event_name == 'schedule' && github.repository == 'quarto-dev/quarto-cli')
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, windows-latest]
runs-on: ${{ matrix.os }}
steps:
- name: Checkout Repo
uses: actions/checkout@v4
- name: Fix temp dir to use runner one (windows)
if: runner.os == 'Windows'
run: |
echo "TMPDIR=${{ runner.temp }}" >> $GITHUB_ENV
echo "TMP=${{ runner.temp }}" >> $GITHUB_ENV
echo "TEMP=${{ runner.temp }}" >> $GITHUB_ENV
shell: bash
- name: Set up R
uses: r-lib/actions/setup-r@v2
with:
r-version: "4.3.2"
use-public-rspm: true
# required to avoid rtools bin in path
windows-path-include-rtools: false
- name: Install node (for Playwright, MECA)
uses: actions/setup-node@v4
with:
node-version: 16
- name: Install node dependencies
if: ${{ runner.os != 'Windows' || github.event_name == 'schedule' }}
run: yarn
working-directory: ./tests/integration/playwright
shell: bash
- name: Install Playwright Browsers
if: ${{ runner.os != 'Windows' || github.event_name == 'schedule' }}
run: npx playwright install --with-deps
working-directory: ./tests/integration/playwright
- name: Install MECA validator
if: ${{ runner.os != 'Windows' }}
run: npm install -g meca
- name: Set RENV_PATHS_ROOT
shell: bash
run: |
echo "RENV_PATHS_ROOT=${{ runner.temp }}/renv" >> $GITHUB_ENV
- name: Get R and OS version
id: get-version
run: |
cat("os-version=", sessionInfo()$running, "\n", file = Sys.getenv("GITHUB_OUTPUT"), sep = "", append = TRUE)
cat("r-version=", R.Version()$version.string, "\n", file = Sys.getenv("GITHUB_OUTPUT"), sep = "", append = TRUE)
shell: Rscript {0}
- name: Cache R packages
uses: actions/cache@v4
with:
path: ${{ env.RENV_PATHS_ROOT }}
key: ${{ steps.get-version.outputs.os-version }}-${{ steps.get-version.outputs.r-version }}-renv-2-${{ hashFiles('tests/renv.lock') }}
restore-keys: |
${{ steps.get-version.outputs.os-version }}-${{ steps.get-version.outputs.r-version }}-renv-2-
save-always: true
- name: Install missing system deps
if: runner.os == 'Linux'
run: |
sudo apt-get update -y
sudo apt-get install -y libcurl4-openssl-dev
sudo apt-get install -y libxml2-utils
sudo apt-get install -y libharfbuzz-dev libfribidi-dev
- name: Restore R packages
working-directory: tests
run: |
if (!requireNamespace('renv', quietly = TRUE)) install.packages('renv')
renv::restore()
# Install dev versions for our testing
# Use r-universe to avoid github api calls
try(install.packages('knitr', repos = 'https://yihui.r-universe.dev'))
try(install.packages('rmarkdown', repos = 'https://rstudio.r-universe.dev'))
shell: Rscript {0}
env:
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }}
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: "3.12"
cache: "pipenv"
cache-dependency-path: "./tests/Pipfile.lock"
- name: Restore Python Dependencies
working-directory: tests
run: |
python -m pip install pipenv
pipenv install
- uses: ./.github/workflows/actions/quarto-dev
- name: Install Tinytex
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
quarto install tinytex
- name: Cache Typst packages
uses: ./.github/actions/cache-typst
# - name: Install Chrome
# uses: browser-actions/setup-chrome@v1
# with:
# chrome-version: 127
- name: Setup Julia
uses: julia-actions/setup-julia@v2
with:
version: "1.10"
- name: Cache Julia Packages
uses: julia-actions/cache@v2
- name: Restore Julia Packages
working-directory: tests
shell: bash
run: |
# Setup IJulia with the jupyter from the Python environment
# https://julialang.github.io/IJulia.jl/stable/manual/installation/
export JUPYTER=$(find $(dirname $(pipenv run which jupyter))/ -type f -name "jupyter.exe" -o -name "jupyter")
pipenv run julia --color=yes --project=. -e "import Pkg; Pkg.instantiate(); Pkg.build(\"IJulia\"); Pkg.precompile()"
echo "Julia Jupyter:"
julia --project=. -e "import IJulia;println(IJulia.JUPYTER);println(IJulia.find_jupyter_subcommand(\"notebook\"))"
- name: Setup timing file for timed test
if: ${{ matrix.time-test == true }}
run: |
echo "QUARTO_TEST_TIMING=timing-for-ci.txt" >> "$GITHUB_ENV"
# - name: Setup tmate session
# uses: mxschmitt/action-tmate@v3
# The Check Chromium step appears necessary to avoid a crash/hang when rendering PDFs
# https://github.com/quarto-dev/quarto-actions/issues/45#issuecomment-1562599451
# Same fix as in quarto-actions/quarto-render
# chromium is installed in the ubuntu runners in GHA, so no need to install it
# - name: "Check Chromium"
# if: ${{ runner.os == 'Linux' }}
# run: |
# echo $(which google-chrome)
# $(which google-chrome) --headless --no-sandbox --disable-gpu --renderer-process-limit=1 https://www.chromestatus.com
# shell: bash
- name: Run all Smoke Tests Windows
if: ${{ runner.os == 'Windows' && format('{0}', inputs.buckets) == '' && matrix.time-test == false }}
env:
# Useful as TinyTeX latest release is checked in run-test.sh
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: ./run-tests.ps1 ../dev-docs/feature-format-matrix/qmd-files/**/*.qmd
working-directory: tests
shell: pwsh
- name: Run all Smoke Tests Linux
if: ${{ runner.os != 'Windows' && format('{0}', inputs.buckets) == '' }}
env:
# Useful as TinyTeX latest release is checked in run-test.sh
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: shopt -s globstar && ./run-tests.sh ../dev-docs/feature-format-matrix/**/*.qmd
working-directory: tests
shell: bash