Skip to content

Commit bb974c8

Browse files
committed
Simplify chromium deprecation test with GITHUB_OUTPUT and bash wrapper
Use GITHUB_OUTPUT to pass install results between steps instead of temp files. Add a bash wrapper for quarto.cmd on Windows so all steps use unified bash syntax. No more pwsh/bash duplication.
1 parent 8d50267 commit bb974c8

1 file changed

Lines changed: 31 additions & 47 deletions

File tree

.github/workflows/test-install.yml

Lines changed: 31 additions & 47 deletions
Original file line numberDiff line numberDiff line change
@@ -63,58 +63,42 @@ jobs:
6363

6464
- uses: ./.github/workflows/actions/quarto-dev
6565

66-
- name: Verify chromium install shows deprecation warning (Unix)
67-
if: runner.os != 'Windows'
68-
run: |
69-
quarto install chromium --no-prompt 2>&1 | tee /tmp/chromium-output.txt || true
70-
if grep -q "deprecated" /tmp/chromium-output.txt; then
71-
echo "Deprecation warning found"
72-
else
73-
echo "Deprecation warning missing"
74-
cat /tmp/chromium-output.txt
75-
exit 1
76-
fi
77-
78-
- name: Verify chromium install shows deprecation warning (Windows)
66+
- name: Make quarto available in bash (Windows)
7967
if: runner.os == 'Windows'
80-
shell: pwsh
68+
shell: bash
8169
run: |
82-
$output = quarto install chromium --no-prompt 2>&1 | Out-String
83-
Write-Host $output
84-
if ($output -match "deprecated") {
85-
Write-Host "Deprecation warning found"
86-
} else {
87-
Write-Host "Deprecation warning missing"
88-
exit 1
89-
}
70+
quarto_cmd=$(command -v quarto.cmd)
71+
dir=$(dirname "$quarto_cmd")
72+
printf '#!/bin/bash\nexec "%s" "$@"\n' "$quarto_cmd" > "$dir/quarto"
73+
chmod +x "$dir/quarto"
9074
91-
- name: Verify quarto check warns about outdated Chromium (Unix)
92-
if: runner.os != 'Windows'
75+
- name: Install chromium and capture result
76+
id: install-chromium
77+
shell: bash
9378
run: |
94-
# Only assert if chromium was actually installed (fails on arm64)
95-
if grep -q "Installation successful" /tmp/chromium-output.txt; then
96-
quarto check install 2>&1 | tee /tmp/check-output.txt || true
97-
if grep -q "outdated" /tmp/check-output.txt; then
98-
echo "Outdated Chromium warning found in quarto check"
99-
else
100-
echo "Outdated Chromium warning missing from quarto check"
101-
cat /tmp/check-output.txt
102-
exit 1
103-
fi
104-
else
105-
echo "Chromium install did not succeed on this platform, skipping check"
79+
output=$(quarto install chromium --no-prompt 2>&1) || true
80+
echo "$output"
81+
if echo "$output" | grep -q "deprecated"; then
82+
echo "deprecation-warning=true" >> "$GITHUB_OUTPUT"
83+
fi
84+
if echo "$output" | grep -q "Installation successful"; then
85+
echo "chromium-installed=true" >> "$GITHUB_OUTPUT"
10686
fi
10787
108-
- name: Verify quarto check warns about outdated Chromium (Windows)
109-
if: runner.os == 'Windows'
110-
shell: pwsh
88+
- name: Assert deprecation warning was shown
89+
if: steps.install-chromium.outputs.deprecation-warning != 'true'
90+
shell: bash
11191
run: |
112-
# Chromium installs via Puppeteer on Windows, so should always be present
113-
$output = quarto check install 2>&1 | Out-String
114-
Write-Host $output
115-
if ($output -match "outdated") {
116-
Write-Host "Outdated Chromium warning found in quarto check"
117-
} else {
118-
Write-Host "Outdated Chromium warning missing from quarto check"
92+
echo "::error::Deprecation warning missing from quarto install chromium output"
93+
exit 1
94+
95+
- name: Verify quarto check warns about outdated Chromium
96+
if: steps.install-chromium.outputs.chromium-installed == 'true'
97+
shell: bash
98+
run: |
99+
output=$(quarto check install 2>&1) || true
100+
echo "$output"
101+
if ! echo "$output" | grep -q "outdated"; then
102+
echo "::error::Outdated Chromium warning missing from quarto check"
119103
exit 1
120-
}
104+
fi

0 commit comments

Comments
 (0)