Skip to content

Debug ff-matrix gha workflow #552

Debug ff-matrix gha workflow

Debug ff-matrix gha workflow #552

Workflow file for this run

# Tests all documents in the feature-format matrix
name: Feature-Format Tests
on:
workflow_dispatch:
inputs:
extra-r-packages:
description: "extra R package to install for the runs (like a dev version of one of the deps) - comma separated, passed to renv::install"
required: false
type: string
default: ""
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/**"
# don't run on PR working on other workflows
- ".github/workflows/create-release.yml"
- ".github/workflows/performance-check.yml"
- ".github/workflows/stale-needs-repro.yml"
- ".github/workflows/test-bundle.yml"
- ".github/workflows/test-smokes-parallel.yml"
- ".github/workflows/test-quarto-latexmk.yml"
- ".github/workflows/update-test-timing.yml"
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.5.0"
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: 20
- 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: Restore Renv package cache
id: cache-renv-packages-restore
uses: actions/cache/restore@v4
with:
path: |
${{ env.RENV_PATHS_ROOT }}
renv/library
key: ${{ steps.get-version.outputs.os-version }}-${{ steps.get-version.outputs.r-version }}-renv-3-${{ hashFiles('tests/renv.lock') }}
restore-keys: |
${{ steps.get-version.outputs.os-version }}-${{ steps.get-version.outputs.r-version }}-renv-3-
- 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
sudo apt-get install -y poppler-utils
- 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('rmarkdown', repos = c('https://rstudio.r-universe.dev', getOption('repos'))))
try(install.packages('knitr', repos = c('https://yihui.r-universe.dev', getOption('repos'))))
if ('${{ inputs.extra-r-packages }}' != '') {
cat(sprintf("::notice::Running with the following extra R packages for pak: %s\n", "${{ inputs.extra-r-packages }}"))
renv::install(strsplit("${{ inputs.extra-r-packages }}", split = ",")[[1]])
}
shell: Rscript {0}
env:
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }}
- name: Show R session information
working-directory: tests
run: |
# Session info
cat("::group::Session info\n")
renv::install("sessioninfo")
sessioninfo::session_info(pkgs = "installed", include_base = TRUE)
cat("::endgroup::\n")
shell: Rscript {0}
- name: Install uv for Python
uses: astral-sh/setup-uv@v3
with:
version: "0.7.4"
enable-cache: true
cache-dependency-glob: "tests/uv.lock"
- name: Install Python and Dependencies
working-directory: tests
run: |
uv sync --frozen
- uses: ./.github/workflows/actions/quarto-dev
- name: Install Tinytex
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
quarto install tinytex
- name: Cache Typst packages
id: cache-typst
uses: ./.github/actions/cache-typst
- name: Install Chrome
uses: browser-actions/setup-chrome@latest
- name: Setup Julia
uses: julia-actions/setup-julia@v2
with:
version: "1.11.3"
- 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 $(uv run --frozen which jupyter))/ -type f -name "jupyter.exe" -o -name "jupyter")
uv run --frozen julia --color=yes --project=. -e "import Pkg; Pkg.instantiate(); Pkg.build(\"IJulia\"); Pkg.precompile()"
echo "Julia Jupyter:"
uv run julia --project=. -e "import IJulia;println(IJulia.JUPYTER);println(IJulia.find_jupyter_subcommand(\"notebook\"))"
# - name: Setup tmate session
# uses: mxschmitt/action-tmate@v3
# we run from tests directory as our environment for R, Python and Julia is set up there
- name: Run all feature-format-matrix Tests Windows
if: ${{ runner.os == 'Windows' }}
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 feature-format-matrix Tests Linux
if: ${{ runner.os != 'Windows' }}
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
- name: Save Typst cache
if: always() && steps.cache-typst.outputs.cache-hit != 'true'
uses: actions/cache/save@v4
with:
key: ${{ steps.cache-typst.outputs.cache-primary-key }}
path: ${{ steps.cache-typst.outputs.cache-path }}
- name: Save Renv package cache
# don't save cache if we have extra R packages
if: ${{ always() && steps.cache-renv-packages-restore.outputs.cache-hit != 'true' && inputs.extra-r-packages == '' }}
uses: actions/cache/save@v4
with:
path: |
${{ env.RENV_PATHS_ROOT }}
renv/library
key: ${{ steps.cache-renv-packages-restore.outputs.cache-primary-key }}