|
1 | | -# Tests all documents in the feature-format matrix |
2 | 1 | name: Feature-Format Tests |
3 | 2 | on: |
4 | 3 | workflow_dispatch: |
| 4 | + inputs: |
| 5 | + extra-r-packages: |
| 6 | + description: "extra R package to install for the runs (like a dev version of one of the deps) - comma separated, passed to renv::install" |
| 7 | + required: false |
| 8 | + type: string |
| 9 | + default: "" |
5 | 10 | schedule: |
6 | 11 | # run daily at 1am UTC |
7 | 12 | - cron: "0 1 * * *" |
8 | | - # Deactivating run on commits for now |
9 | | - ## push: |
10 | | - ## branches: [main] |
11 | | - ## paths-ignore: |
12 | | - ## - "news/**" |
13 | | - ## - "src/resources/language/**" |
14 | | - ## pull_request: |
15 | | - ## branches: [main] |
16 | | - ## paths-ignore: |
17 | | - ## - "src/resources/language/**" |
| 13 | + push: |
| 14 | + branches: [main] |
| 15 | + paths-ignore: |
| 16 | + - "news/**" |
| 17 | + - "src/resources/language/**" |
| 18 | + - ".github/workflows/create-release.yml" |
| 19 | + - ".github/workflows/performance-check.yml" |
| 20 | + - ".github/workflows/stale-needs-repro.yml" |
| 21 | + - ".github/workflows/test-bundle.yml" |
| 22 | + - ".github/workflows/test-smokes-parallel.yml" |
| 23 | + - ".github/workflows/test-quarto-latexmk.yml" |
| 24 | + - ".github/workflows/update-test-timing.yml" |
| 25 | + pull_request: |
| 26 | + branches: [main] |
| 27 | + paths-ignore: |
| 28 | + - "news/**" |
| 29 | + - "src/resources/language/**" |
| 30 | + - ".github/workflows/create-release.yml" |
| 31 | + - ".github/workflows/performance-check.yml" |
| 32 | + - ".github/workflows/stale-needs-repro.yml" |
| 33 | + - ".github/workflows/test-bundle.yml" |
| 34 | + - ".github/workflows/test-smokes-parallel.yml" |
| 35 | + - ".github/workflows/test-quarto-latexmk.yml" |
| 36 | + - ".github/workflows/update-test-timing.yml" |
18 | 37 |
|
19 | 38 | concurrency: |
20 | | - # Use github.run_id on main branch |
21 | | - # Use github.event.pull_request.number on pull requests, so it's unique per pull request |
22 | | - # Use github.ref on other branches, so it's unique per branch |
23 | 39 | group: ${{ github.workflow }}-${{ github.ref == 'refs/heads/main' && github.run_id || github.event.pull_request.number || github.ref }} |
24 | 40 | cancel-in-progress: true |
25 | 41 |
|
26 | 42 | jobs: |
27 | | - run-smokes: |
| 43 | + run-feature-format-tests: |
28 | 44 | name: Run feature-format matrix on (${{ matrix.os }}) |
29 | | - if: github.event_name != 'schedule' || (github.event_name == 'schedule' && github.repository == 'quarto-dev/quarto-cli') |
30 | 45 | strategy: |
31 | 46 | fail-fast: false |
32 | 47 | matrix: |
33 | | - os: [ubuntu-latest, windows-latest] |
34 | | - runs-on: ${{ matrix.os }} |
35 | | - steps: |
36 | | - - name: Checkout Repo |
37 | | - uses: actions/checkout@v4 |
38 | | - |
39 | | - - name: Fix temp dir to use runner one (windows) |
40 | | - if: runner.os == 'Windows' |
41 | | - run: | |
42 | | - echo "TMPDIR=${{ runner.temp }}" >> $GITHUB_ENV |
43 | | - echo "TMP=${{ runner.temp }}" >> $GITHUB_ENV |
44 | | - echo "TEMP=${{ runner.temp }}" >> $GITHUB_ENV |
45 | | - shell: bash |
46 | | - |
47 | | - - name: Set up R |
48 | | - uses: r-lib/actions/setup-r@v2 |
49 | | - with: |
50 | | - r-version: "4.5.0" |
51 | | - use-public-rspm: true |
52 | | - # required to avoid rtools bin in path |
53 | | - windows-path-include-rtools: false |
54 | | - |
55 | | - - name: Install node (for Playwright, MECA) |
56 | | - uses: actions/setup-node@v4 |
57 | | - with: |
58 | | - node-version: 16 |
59 | | - |
60 | | - - name: Install node dependencies |
61 | | - if: ${{ runner.os != 'Windows' || github.event_name == 'schedule' }} |
62 | | - run: yarn |
63 | | - working-directory: ./tests/integration/playwright |
64 | | - shell: bash |
65 | | - |
66 | | - - name: Install Playwright Browsers |
67 | | - if: ${{ runner.os != 'Windows' || github.event_name == 'schedule' }} |
68 | | - run: npx playwright install --with-deps |
69 | | - working-directory: ./tests/integration/playwright |
70 | | - |
71 | | - - name: Install MECA validator |
72 | | - if: ${{ runner.os != 'Windows' }} |
73 | | - run: npm install -g meca |
74 | | - |
75 | | - - name: Set RENV_PATHS_ROOT |
76 | | - shell: bash |
77 | | - run: | |
78 | | - echo "RENV_PATHS_ROOT=${{ runner.temp }}/renv" >> $GITHUB_ENV |
79 | | -
|
80 | | - - name: Get R and OS version |
81 | | - id: get-version |
82 | | - run: | |
83 | | - cat("os-version=", sessionInfo()$running, "\n", file = Sys.getenv("GITHUB_OUTPUT"), sep = "", append = TRUE) |
84 | | - cat("r-version=", R.Version()$version.string, "\n", file = Sys.getenv("GITHUB_OUTPUT"), sep = "", append = TRUE) |
85 | | - shell: Rscript {0} |
86 | | - |
87 | | - - name: Cache R packages |
88 | | - uses: actions/cache@v4 |
89 | | - with: |
90 | | - path: ${{ env.RENV_PATHS_ROOT }} |
91 | | - key: ${{ steps.get-version.outputs.os-version }}-${{ steps.get-version.outputs.r-version }}-renv-2-${{ hashFiles('tests/renv.lock') }} |
92 | | - restore-keys: | |
93 | | - ${{ steps.get-version.outputs.os-version }}-${{ steps.get-version.outputs.r-version }}-renv-2- |
94 | | - save-always: true |
95 | | - |
96 | | - - name: Install missing system deps |
97 | | - if: runner.os == 'Linux' |
98 | | - run: | |
99 | | - sudo apt-get update -y |
100 | | - sudo apt-get install -y libcurl4-openssl-dev |
101 | | - sudo apt-get install -y libxml2-utils |
102 | | - sudo apt-get install -y libharfbuzz-dev libfribidi-dev |
103 | | -
|
104 | | - - name: Restore R packages |
105 | | - working-directory: tests |
106 | | - run: | |
107 | | - if (!requireNamespace('renv', quietly = TRUE)) install.packages('renv') |
108 | | - renv::restore() |
109 | | - # Install dev versions for our testing |
110 | | - # Use r-universe to avoid github api calls |
111 | | - try(install.packages('knitr', repos = 'https://yihui.r-universe.dev')) |
112 | | - try(install.packages('rmarkdown', repos = 'https://rstudio.r-universe.dev')) |
113 | | - shell: Rscript {0} |
114 | | - env: |
115 | | - GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }} |
116 | | - |
117 | | - - name: Install uv for Python |
118 | | - uses: astral-sh/setup-uv@v3 |
119 | | - with: |
120 | | - version: "0.7.4" |
121 | | - enable-cache: true |
122 | | - cache-dependency-glob: "tests/uv.lock" |
123 | | - |
124 | | - - name: Install Python and Dependencies |
125 | | - working-directory: tests |
126 | | - run: | |
127 | | - uv sync --frozen |
128 | | -
|
129 | | - - uses: ./.github/workflows/actions/quarto-dev |
130 | | - |
131 | | - - name: Install Tinytex |
132 | | - env: |
133 | | - GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
134 | | - run: | |
135 | | - quarto install tinytex |
136 | | -
|
137 | | - - name: Cache Typst packages |
138 | | - uses: ./.github/actions/cache-typst |
139 | | - |
140 | | - # - name: Install Chrome |
141 | | - # uses: browser-actions/setup-chrome@v1 |
142 | | - # with: |
143 | | - # chrome-version: 127 |
144 | | - |
145 | | - - name: Setup Julia |
146 | | - uses: julia-actions/setup-julia@v2 |
147 | | - with: |
148 | | - version: "1.10" |
149 | | - |
150 | | - - name: Cache Julia Packages |
151 | | - uses: julia-actions/cache@v2 |
152 | | - |
153 | | - - name: Restore Julia Packages |
154 | | - working-directory: tests |
155 | | - shell: bash |
156 | | - run: | |
157 | | - # Setup IJulia with the jupyter from the Python environment |
158 | | - # https://julialang.github.io/IJulia.jl/stable/manual/installation/ |
159 | | - export JUPYTER=$(find $(dirname $(uv run --frozen which jupyter))/ -type f -name "jupyter.exe" -o -name "jupyter") |
160 | | - uv run --frozen julia --color=yes --project=. -e "import Pkg; Pkg.instantiate(); Pkg.build(\"IJulia\"); Pkg.precompile()" |
161 | | - echo "Julia Jupyter:" |
162 | | - julia --project=. -e "import IJulia;println(IJulia.JUPYTER);println(IJulia.find_jupyter_subcommand(\"notebook\"))" |
163 | | -
|
164 | | - - name: Setup timing file for timed test |
165 | | - if: ${{ matrix.time-test == true }} |
166 | | - run: | |
167 | | - echo "QUARTO_TEST_TIMING=timing-for-ci.txt" >> "$GITHUB_ENV" |
168 | | -
|
169 | | - # - name: Setup tmate session |
170 | | - # uses: mxschmitt/action-tmate@v3 |
171 | | - |
172 | | - # The Check Chromium step appears necessary to avoid a crash/hang when rendering PDFs |
173 | | - # https://github.com/quarto-dev/quarto-actions/issues/45#issuecomment-1562599451 |
174 | | - # Same fix as in quarto-actions/quarto-render |
175 | | - # chromium is installed in the ubuntu runners in GHA, so no need to install it |
176 | | - # - name: "Check Chromium" |
177 | | - # if: ${{ runner.os == 'Linux' }} |
178 | | - # run: | |
179 | | - # echo $(which google-chrome) |
180 | | - # $(which google-chrome) --headless --no-sandbox --disable-gpu --renderer-process-limit=1 https://www.chromestatus.com |
181 | | - # shell: bash |
182 | | - |
183 | | - - name: Run all Smoke Tests Windows |
184 | | - if: ${{ runner.os == 'Windows' && format('{0}', inputs.buckets) == '' && matrix.time-test == false }} |
185 | | - env: |
186 | | - # Useful as TinyTeX latest release is checked in run-test.sh |
187 | | - GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
188 | | - run: ./run-tests.ps1 ../dev-docs/feature-format-matrix/qmd-files/**/*.qmd |
189 | | - working-directory: tests |
190 | | - shell: pwsh |
191 | | - |
192 | | - - name: Run all Smoke Tests Linux |
193 | | - if: ${{ runner.os != 'Windows' && format('{0}', inputs.buckets) == '' }} |
194 | | - env: |
195 | | - # Useful as TinyTeX latest release is checked in run-test.sh |
196 | | - GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
197 | | - run: shopt -s globstar && ./run-tests.sh ../dev-docs/feature-format-matrix/**/*.qmd |
198 | | - working-directory: tests |
199 | | - shell: bash |
| 48 | + os: |
| 49 | + - ubuntu-latest |
| 50 | + - windows-latest |
| 51 | + uses: ./.github/workflows/test-smokes.yml |
| 52 | + with: |
| 53 | + buckets: '[ "../dev-docs/feature-format-matrix/qmd-files/**/*.qmd" ]' |
| 54 | + extra-r-packages: ${{ inputs.extra-r-packages }} |
0 commit comments