pandoc 3.1.6 #6579
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Tests a broad set of Quarto functionality that users are likely to encounter. | |
# A failure indicates some signficant portion of functionality is likely to be broken. | |
name: Smoke Tests | |
on: | |
workflow_call: | |
inputs: | |
buckets: | |
description: "JSON string for buckets of tests to run in loop. Array of grouped tests." | |
required: true | |
type: string | |
workflow_dispatch: | |
inputs: | |
buckets: | |
description: "JSON string for buckets of tests to run in loop. Array of grouped tests." | |
required: false | |
type: string | |
default: "" | |
schedule: | |
- cron: "0 6 * * *" | |
pull_request: | |
branches: [main] | |
push: | |
# only trigger on branches, not on tags | |
branches: [main] | |
jobs: | |
run-smokes: | |
strategy: | |
fail-fast: false | |
matrix: | |
os: [ubuntu-latest, windows-latest] | |
runs-on: ${{ matrix.os }} | |
env: | |
QUARTO_TESTS_FORCE_NO_PIPENV: true | |
steps: | |
- name: Checkout Repo | |
uses: actions/checkout@v3 | |
- 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.2.2" | |
- name: Install node (for Playwright, MECA) | |
uses: actions/setup-node@v3 | |
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@v3 | |
with: | |
path: ${{ env.RENV_PATHS_ROOT }} | |
key: ${{ steps.get-version.outputs.os-version }}-${{ steps.get-version.outputs.r-version }}-renv-1-${{ hashFiles('tests/renv.lock') }} | |
restore-keys: | | |
${{ steps.get-version.outputs.os-version }}-${{ steps.get-version.outputs.r-version }}-renv-1- | |
- 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 | |
- name: Restore R packages | |
working-directory: tests | |
run: | | |
if (!requireNamespace('renv', quietly = TRUE)) install.packages('renv') | |
renv::restore() | |
# Install dev versions for our testing | |
renv::install("yihui/knitr") | |
renv::install("rstudio/rmarkdown") | |
shell: Rscript {0} | |
env: | |
RENV_CONFIG_REPOS_OVERRIDE: https://packagemanager.rstudio.com/cran/latest | |
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }} | |
- name: Set up Python | |
uses: actions/setup-python@v4 | |
with: | |
cache: "pipenv" | |
cache-dependency-path: "./tests/Pipfile.lock" | |
python-version-file: "./tests/.python-version" | |
- name: Restore Python Dependencies | |
working-directory: tests | |
run: | | |
python -m pip install pipenv | |
pipenv install --system | |
- uses: ./.github/workflows/actions/quarto-dev | |
- name: Install Tinytex | |
env: | |
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
run: | | |
quarto install tinytex | |
- name: Install Chrome | |
uses: browser-actions/setup-chrome@latest | |
- name: Setup Julia | |
uses: julia-actions/setup-julia@v1 | |
with: | |
version: 1.8.5 | |
- name: Cache Julia Packages | |
uses: julia-actions/cache@v1 | |
- name: Restore Julia Packages | |
working-directory: tests | |
shell: bash | |
run: | | |
julia --color=yes --project=. -e "import Pkg; Pkg.instantiate(); Pkg.build(\"IJulia\"); Pkg.precompile()" | |
- name: Run all Smoke Tests | |
if: ${{ format('{0}', inputs.buckets) == '' }} | |
env: | |
# Useful as TinyTeX latest release is checked in run-test.sh | |
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
run: | | |
case $RUNNER_OS in | |
"Windows") | |
pwsh -F ./run-tests.ps1 | |
;; | |
*) | |
./run-tests.sh | |
;; | |
esac | |
working-directory: tests | |
shell: bash | |
- name: Run Smoke Tests as a bucket on 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: | | |
haserror=0 | |
readarray -t my_array < <(echo '${{ inputs.buckets }}' | jq -rc '.[]') | |
for file in "${my_array[@]}"; do | |
echo ">>> ./run-tests.sh ${file}" | |
./run-tests.sh $file | |
status=$? | |
[ $status -eq 0 ] && echo ">>> No error in this test file" || haserror=1 | |
done | |
[ $haserror -eq 0 ] && echo ">>> All tests passed" || exit 1 | |
working-directory: tests | |
shell: bash | |
- name: Run Smoke Tests as a bucket on Windows | |
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: | | |
$haserror=$false | |
foreach ($file in ('${{ inputs.buckets }}' | ConvertFrom-Json)) { | |
Write-Host ">>> ./run-tests.ps1 ${file}" | |
./run-tests.ps1 $file | |
$status=$LASTEXITCODE | |
if ($status -eq 1) { | |
Write-Host ">>> Error found in test file" | |
$haserror=$true | |
} else { | |
Write-Host ">>> No error in this test file" | |
} | |
} | |
if ($haserror) { | |
Exit 1 | |
} else { | |
Write-Host ">>> All tests have passed" | |
} | |
working-directory: tests | |
shell: pwsh |