-
Notifications
You must be signed in to change notification settings - Fork 433
151 lines (136 loc) · 4.91 KB
/
test-install.yml
File metadata and controls
151 lines (136 loc) · 4.91 KB
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
# Integration test for `quarto install` on platforms not covered by smoke tests.
# Smoke tests (test-smokes.yml) cover x86_64 Linux and Windows.
# This workflow fills the gap for arm64 Linux and macOS.
name: Test Tool Install
on:
workflow_dispatch:
push:
branches:
- main
- "v1.*"
paths:
- "src/tools/**"
- ".github/workflows/test-install.yml"
pull_request:
paths:
- "src/tools/**"
- ".github/workflows/test-install.yml"
schedule:
# Weekly Monday 9am UTC — detect upstream CDN/API breakage
- cron: "0 9 * * 1"
permissions:
contents: read
jobs:
test-install:
name: Install tools (${{ matrix.os }})
strategy:
fail-fast: false
matrix:
os: [ubuntu-24.04-arm, macos-latest]
runs-on: ${{ matrix.os }}
steps:
- name: Checkout Repo
uses: actions/checkout@v6
- uses: ./.github/workflows/actions/quarto-dev
- name: Install TinyTeX
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
quarto install tinytex
- name: Install Chrome Headless Shell
run: |
quarto install chrome-headless-shell --no-prompt
- name: Verify tools with quarto check
run: |
quarto check install
test-chromium-deprecation:
name: Chromium deprecation redirect (${{ matrix.os }})
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, ubuntu-24.04-arm, macos-latest, windows-latest]
runs-on: ${{ matrix.os }}
steps:
- name: Checkout Repo
uses: actions/checkout@v6
- uses: ./.github/workflows/actions/quarto-dev
- name: Make quarto available in bash (Windows)
if: runner.os == 'Windows'
shell: bash
run: |
quarto_cmd=$(command -v quarto.cmd)
dir=$(dirname "$quarto_cmd")
printf '#!/bin/bash\nexec "%s" "$@"\n' "$quarto_cmd" > "$dir/quarto"
chmod +x "$dir/quarto"
- name: Install chromium (should redirect to chrome-headless-shell)
id: install-chromium
shell: bash
run: |
set +e
output=$(quarto install chromium --no-prompt 2>&1)
exit_code=$?
set -e
echo "$output"
if echo "$output" | grep -Fq "is deprecated"; then
echo "deprecation-warning=true" >> "$GITHUB_OUTPUT"
fi
if [ "$exit_code" -eq 0 ]; then
echo "install-successful=true" >> "$GITHUB_OUTPUT"
fi
- name: Assert deprecation warning was shown
shell: bash
run: |
if [ "${{ steps.install-chromium.outputs.deprecation-warning }}" != "true" ]; then
echo "::error::Deprecation warning missing from 'quarto install chromium' output"
exit 1
fi
echo "Install deprecation warning found"
- name: Assert installation succeeded (via redirect)
shell: bash
run: |
if [ "${{ steps.install-chromium.outputs.install-successful }}" != "true" ]; then
echo "::error::Installation did not succeed — redirect to chrome-headless-shell may have failed"
exit 1
fi
echo "Installation succeeded via redirect"
- name: Verify quarto check shows Chrome Headless Shell
shell: bash
run: |
output=$(quarto check install 2>&1)
echo "$output"
if ! echo "$output" | grep -Fq "Chrome Headless Shell"; then
echo "::error::Chrome Headless Shell not detected by quarto check after redirect install"
exit 1
fi
if echo "$output" | grep -Fq 'chrome-headless-shell" to replace'; then
echo "::error::Legacy Chromium still installed — afterInstall should have removed it"
exit 1
fi
- name: Update chromium (should redirect) and capture result
id: update-chromium
shell: bash
run: |
set +e
output=$(quarto update tool chromium --no-prompt 2>&1)
exit_code=$?
set -e
echo "$output"
if echo "$output" | grep -Fq "is deprecated"; then
echo "deprecation-warning=true" >> "$GITHUB_OUTPUT"
fi
if [ "$exit_code" -eq 0 ]; then
echo "update-successful=true" >> "$GITHUB_OUTPUT"
fi
- name: Assert update deprecation warning was shown and succeeded
shell: bash
run: |
if [ "${{ steps.update-chromium.outputs.deprecation-warning }}" != "true" ]; then
echo "::error::Deprecation warning missing from 'quarto update tool chromium' output"
exit 1
fi
echo "Update deprecation warning found"
if [ "${{ steps.update-chromium.outputs.update-successful }}" != "true" ]; then
echo "::error::Update command failed — redirect to chrome-headless-shell may have failed"
exit 1
fi
echo "Update succeeded via redirect"