From 8ba0ce243d2360571dc93e7f8d69bdd323945f25 Mon Sep 17 00:00:00 2001 From: Douglas Gray Date: Thu, 5 Mar 2026 17:44:07 -0800 Subject: [PATCH] fix: improve CI workflows and smoke test - Bump actions/checkout v3 to v4 - Remove chromium apt install, use pre-installed google-chrome - Validate all HTML files, not just index.html - Fix smoke test stderr filtering to ignore Chrome internal messages - Add PR preview cleanup job on close - Remove continue-on-error from smoke test - Bump last-updated date --- .github/workflows/deploy.yml | 23 ++++++++++------------- .github/workflows/preview.yml | 35 ++++++++++++++++++++++------------- site/index.html | 2 +- smoke.js | 16 +++++++++++----- 4 files changed, 44 insertions(+), 32 deletions(-) diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index 95f8ab1..25f24e9 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -7,13 +7,7 @@ jobs: build: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 - - name: Install chromium-browser if needed - run: | - if ! command -v chromium-browser >/dev/null; then - sudo apt-get update - sudo apt-get install -y chromium-browser - fi + - uses: actions/checkout@v4 - name: Install tidy if needed run: | if ! command -v tidy >/dev/null; then @@ -22,14 +16,17 @@ jobs: fi - name: Validate HTML run: | - set +e - tidy -qe site/index.html - rc=$? - set -e - if [ "$rc" -gt 1 ]; then exit $rc; fi + fail=0 + for f in $(find site -name '*.html'); do + set +e + tidy -qe "$f" + rc=$? + set -e + if [ "$rc" -gt 1 ]; then fail=1; fi + done + exit $fail - name: JS smoke test run: node smoke.js - continue-on-error: true - name: Copy site to dist run: | mkdir -p dist diff --git a/.github/workflows/preview.yml b/.github/workflows/preview.yml index 8ec42e3..9fdd744 100644 --- a/.github/workflows/preview.yml +++ b/.github/workflows/preview.yml @@ -8,13 +8,7 @@ jobs: if: github.event.action != 'closed' runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 - - name: Install chromium-browser if needed - run: | - if ! command -v chromium-browser >/dev/null; then - sudo apt-get update - sudo apt-get install -y chromium-browser - fi + - uses: actions/checkout@v4 - name: Install tidy if needed run: | if ! command -v tidy >/dev/null; then @@ -23,14 +17,17 @@ jobs: fi - name: Validate HTML run: | - set +e - tidy -qe site/index.html - rc=$? - set -e - if [ "$rc" -gt 1 ]; then exit $rc; fi + fail=0 + for f in $(find site -name '*.html'); do + set +e + tidy -qe "$f" + rc=$? + set -e + if [ "$rc" -gt 1 ]; then fail=1; fi + done + exit $fail - name: JS smoke test run: node smoke.js - continue-on-error: true - name: Copy site to dist run: | mkdir -p dist @@ -40,3 +37,15 @@ jobs: with: preview-branch: gh-pages token: ${{ secrets.GITHUB_TOKEN }} + + cleanup: + if: github.event.action == 'closed' + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - name: Remove PR preview + uses: rossjrw/pr-preview-action@v1 + with: + preview-branch: gh-pages + token: ${{ secrets.GITHUB_TOKEN }} + action: remove diff --git a/site/index.html b/site/index.html index c0317d3..7b506ce 100644 --- a/site/index.html +++ b/site/index.html @@ -207,7 +207,7 @@

Contact

  • Twitter
  • Threads
  • -

    Last updated: 03/02/2026 — Privacy notice

    +

    Last updated: 03/05/2026 — Privacy notice

    diff --git a/smoke.js b/smoke.js index aa4dce6..f95ec47 100644 --- a/smoke.js +++ b/smoke.js @@ -7,7 +7,7 @@ const root = path.join(__dirname, 'site'); const port = 8123; function findBrowser() { - const candidates = ['chromium-browser', 'chromium', 'google-chrome']; + const candidates = ['google-chrome', 'chromium-browser', 'chromium']; for (const c of candidates) { try { execSync(`command -v ${c}`, { stdio: 'ignore' }); @@ -61,12 +61,18 @@ server.listen(port, () => { chrome.on('close', () => { clearTimeout(timeout); server.close(() => { - if (/Uncaught|Error/i.test(stderr)) { - console.error(stderr); + // Filter out Chrome's own internal messages, only fail on actual JS errors + const jsErrors = stderr + .split('\n') + .filter(line => /Uncaught|Exception/.test(line)) + .filter(line => !/\[ERROR:/.test(line)) + .join('\n') + .trim(); + if (jsErrors) { + console.error('JS errors detected:\n' + jsErrors); process.exit(1); - } else { - console.log('Smoke test passed'); } + console.log('Smoke test passed'); }); }); });