From 337017b4478a653db4118b23929128e2b969dce5 Mon Sep 17 00:00:00 2001 From: Bob Date: Wed, 2 Sep 2026 23:37:57 +0000 Subject: [PATCH] fix(ci): find server logs under the testing cache root, never fail on absence The 'aw-server-rust master' matrix leg has failed on every PR since the aw-server-rust nightly picked up ActivityWatch/aw-server-rust#652 (named instance profiles, merged 2026-08-31). That change resolves the cache root via appname(): a --testing server on a machine with no legacy testing data now logs under ~/.cache/activitywatch-testing/, not ~/.cache/activitywatch/. GitHub runners are fresh, so the nightly leg writes to the new root while the pinned v0.12.3b18 legs (pre-#652 binaries) still use the old one - exactly the observed pass/fail split. Glob both roots so the diagnostics come back, and guard with nullglob so these always()-gated log steps can no longer fail the job when no logs exist. A diagnostic step should never gate a merge. Git-Session-Id: f31d --- .github/workflows/nodejs.yml | 26 ++++++++++++++++++++++---- 1 file changed, 22 insertions(+), 4 deletions(-) diff --git a/.github/workflows/nodejs.yml b/.github/workflows/nodejs.yml index c8294e4a1..d5f0588ae 100644 --- a/.github/workflows/nodejs.yml +++ b/.github/workflows/nodejs.yml @@ -177,20 +177,38 @@ jobs: with: name: screenshots-${{ matrix.aw-server }}-${{ matrix.aw-version }} path: screenshots/dist/* + # NOTE: the glob covers both cache roots. Since ActivityWatch/aw-server-rust#652 + # a --testing server on a machine with no legacy testing data logs under + # ~/.cache/activitywatch-testing/, while released builds still use + # ~/.cache/activitywatch/. These are diagnostic steps, so a missing log + # directory must never fail the job. - name: Print server logs to console if: ${{ always() }} shell: bash - run: - for file in ~/.cache/activitywatch/log/*/*.log; do echo $file; cat $file; echo; done + run: | + shopt -s nullglob + logs=(~/.cache/activitywatch*/log/*/*.log) + if [ ${#logs[@]} -eq 0 ]; then + echo "No server logs found under ~/.cache/activitywatch*/log/" + exit 0 + fi + for file in "${logs[@]}"; do echo "$file"; cat "$file"; echo; done - name: Move logs to subdir # Run this step even if e2e tests flag failure if: ${{ always() }} + shell: bash env: aw_server: ${{ matrix.aw-server }} aw_version: ${{ matrix.aw-version }} run: | - mkdir -p logs/dist/$aw_server/$aw_version - mv ~/.cache/activitywatch/log/*/*.log logs/dist/$aw_server/$aw_version + shopt -s nullglob + logs=(~/.cache/activitywatch*/log/*/*.log) + if [ ${#logs[@]} -eq 0 ]; then + echo "No server logs to move" + exit 0 + fi + mkdir -p "logs/dist/$aw_server/$aw_version" + mv "${logs[@]}" "logs/dist/$aw_server/$aw_version" - name: Upload logs if: ${{ always() }} uses: actions/upload-artifact@v7