Skip to content

Commit 8b63f61

Browse files
committed
Update ff-matrix workflow based on smoke test one
For now still a copy of the smoke test workflow, but we will refactor this to use the smoke test workflow as a base and then add the additional steps needed for the feature format matrix tests.
1 parent 7654c46 commit 8b63f61

File tree

1 file changed

+59
-33
lines changed

1 file changed

+59
-33
lines changed

.github/workflows/test-ff-matrix.yml

Lines changed: 59 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,12 @@
22
name: Feature-Format Tests
33
on:
44
workflow_dispatch:
5+
inputs:
6+
extra-r-packages:
7+
description: "extra R package to install for the runs (like a dev version of one of the deps) - comma separated, passed to renv::install"
8+
required: false
9+
type: string
10+
default: ""
511
schedule:
612
# run daily at 1am UTC
713
- cron: "0 1 * * *"
@@ -73,14 +79,16 @@ jobs:
7379
cat("r-version=", R.Version()$version.string, "\n", file = Sys.getenv("GITHUB_OUTPUT"), sep = "", append = TRUE)
7480
shell: Rscript {0}
7581

76-
- name: Cache R packages
77-
uses: actions/cache@v4
82+
- name: Restore Renv package cache
83+
id: cache-renv-packages-restore
84+
uses: actions/cache/restore@v4
7885
with:
79-
path: ${{ env.RENV_PATHS_ROOT }}
80-
key: ${{ steps.get-version.outputs.os-version }}-${{ steps.get-version.outputs.r-version }}-renv-2-${{ hashFiles('tests/renv.lock') }}
86+
path: |
87+
${{ env.RENV_PATHS_ROOT }}
88+
renv/library
89+
key: ${{ steps.get-version.outputs.os-version }}-${{ steps.get-version.outputs.r-version }}-renv-3-${{ hashFiles('tests/renv.lock') }}
8190
restore-keys: |
82-
${{ steps.get-version.outputs.os-version }}-${{ steps.get-version.outputs.r-version }}-renv-2-
83-
save-always: true
91+
${{ steps.get-version.outputs.os-version }}-${{ steps.get-version.outputs.r-version }}-renv-3-
8492
8593
- name: Install missing system deps
8694
if: runner.os == 'Linux'
@@ -89,6 +97,7 @@ jobs:
8997
sudo apt-get install -y libcurl4-openssl-dev
9098
sudo apt-get install -y libxml2-utils
9199
sudo apt-get install -y libharfbuzz-dev libfribidi-dev
100+
sudo apt-get install -y poppler-utils
92101
93102
- name: Restore R packages
94103
working-directory: tests
@@ -97,12 +106,26 @@ jobs:
97106
renv::restore()
98107
# Install dev versions for our testing
99108
# Use r-universe to avoid github api calls
100-
try(install.packages('knitr', repos = 'https://yihui.r-universe.dev'))
101-
try(install.packages('rmarkdown', repos = 'https://rstudio.r-universe.dev'))
109+
try(install.packages('rmarkdown', repos = c('https://rstudio.r-universe.dev', getOption('repos'))))
110+
try(install.packages('knitr', repos = c('https://yihui.r-universe.dev', getOption('repos'))))
111+
if ('${{ inputs.extra-r-packages }}' != '') {
112+
cat(sprintf("::notice::Running with the following extra R packages for pak: %s\n", "${{ inputs.extra-r-packages }}"))
113+
renv::install(strsplit("${{ inputs.extra-r-packages }}", split = ",")[[1]])
114+
}
102115
shell: Rscript {0}
103116
env:
104117
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }}
105118

119+
- name: Show R session information
120+
working-directory: tests
121+
run: |
122+
# Session info
123+
cat("::group::Session info\n")
124+
renv::install("sessioninfo")
125+
sessioninfo::session_info(pkgs = "installed", include_base = TRUE)
126+
cat("::endgroup::\n")
127+
shell: Rscript {0}
128+
106129
- name: Install uv for Python
107130
uses: astral-sh/setup-uv@v3
108131
with:
@@ -124,17 +147,16 @@ jobs:
124147
quarto install tinytex
125148
126149
- name: Cache Typst packages
150+
id: cache-typst
127151
uses: ./.github/actions/cache-typst
128152

129-
# - name: Install Chrome
130-
# uses: browser-actions/setup-chrome@v1
131-
# with:
132-
# chrome-version: 127
153+
- name: Install Chrome
154+
uses: browser-actions/setup-chrome@latest
133155

134156
- name: Setup Julia
135157
uses: julia-actions/setup-julia@v2
136158
with:
137-
version: "1.10"
159+
version: "1.11.3"
138160

139161
- name: Cache Julia Packages
140162
uses: julia-actions/cache@v2
@@ -148,29 +170,14 @@ jobs:
148170
export JUPYTER=$(find $(dirname $(uv run --frozen which jupyter))/ -type f -name "jupyter.exe" -o -name "jupyter")
149171
uv run --frozen julia --color=yes --project=. -e "import Pkg; Pkg.instantiate(); Pkg.build(\"IJulia\"); Pkg.precompile()"
150172
echo "Julia Jupyter:"
151-
julia --project=. -e "import IJulia;println(IJulia.JUPYTER);println(IJulia.find_jupyter_subcommand(\"notebook\"))"
152-
153-
- name: Setup timing file for timed test
154-
if: ${{ matrix.time-test == true }}
155-
run: |
156-
echo "QUARTO_TEST_TIMING=timing-for-ci.txt" >> "$GITHUB_ENV"
173+
uv run julia --project=. -e "import IJulia;println(IJulia.JUPYTER);println(IJulia.find_jupyter_subcommand(\"notebook\"))"
157174
158175
# - name: Setup tmate session
159176
# uses: mxschmitt/action-tmate@v3
160177

161-
# The Check Chromium step appears necessary to avoid a crash/hang when rendering PDFs
162-
# https://github.com/quarto-dev/quarto-actions/issues/45#issuecomment-1562599451
163-
# Same fix as in quarto-actions/quarto-render
164-
# chromium is installed in the ubuntu runners in GHA, so no need to install it
165-
# - name: "Check Chromium"
166-
# if: ${{ runner.os == 'Linux' }}
167-
# run: |
168-
# echo $(which google-chrome)
169-
# $(which google-chrome) --headless --no-sandbox --disable-gpu --renderer-process-limit=1 https://www.chromestatus.com
170-
# shell: bash
171-
178+
# we run from tests directory as our environment for R, Python and Julia is set up there
172179
- name: Run all Smoke Tests Windows
173-
if: ${{ runner.os == 'Windows' && format('{0}', inputs.buckets) == '' && matrix.time-test == false }}
180+
if: ${{ runner.os == 'Windows' }}
174181
env:
175182
# Useful as TinyTeX latest release is checked in run-test.sh
176183
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
@@ -179,10 +186,29 @@ jobs:
179186
shell: pwsh
180187

181188
- name: Run all Smoke Tests Linux
182-
if: ${{ runner.os != 'Windows' && format('{0}', inputs.buckets) == '' }}
189+
if: ${{ runner.os != 'Windows' }}
183190
env:
184191
# Useful as TinyTeX latest release is checked in run-test.sh
185192
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
186-
run: shopt -s globstar && ./run-tests.sh ../dev-docs/feature-format-matrix/**/*.qmd
193+
run: |
194+
shopt -s globstar &&
195+
./run-tests.sh ../dev-docs/feature-format-matrix/**/*.qmd
187196
working-directory: tests
188197
shell: bash
198+
199+
- name: Save Typst cache
200+
if: always() && steps.cache-typst.outputs.cache-hit != 'true'
201+
uses: actions/cache/save@v4
202+
with:
203+
key: ${{ steps.cache-typst.outputs.cache-primary-key }}
204+
path: ${{ steps.cache-typst.outputs.cache-path }}
205+
206+
- name: Save Renv package cache
207+
# don't save cache if we have extra R packages
208+
if: ${{ always() && steps.cache-renv-packages-restore.outputs.cache-hit != 'true' && inputs.extra-r-packages == '' }}
209+
uses: actions/cache/save@v4
210+
with:
211+
path: |
212+
${{ env.RENV_PATHS_ROOT }}
213+
renv/library
214+
key: ${{ steps.cache-renv-packages-restore.outputs.cache-primary-key }}

0 commit comments

Comments
 (0)