diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 7bfa5bfaac3..54b683fd6a5 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -365,6 +365,33 @@ jobs: os: macos run-id: ${{ github.run_id }} + # The check a branch rule can require. It reports on every run; a skipped + # e2e-linux reports nothing under the name of its tests, and a rule that + # requires that name then waits forever. Windows and macOS are not counted: + # they do not fail the workflow yet. + e2e: + name: e2e + needs: [linux, e2e-linux] + if: ${{ !cancelled() }} + runs-on: ubuntu-24.04 + timeout-minutes: 5 + steps: + - name: Result + env: + BUILD: ${{ needs.linux.result }} + TESTS: ${{ needs.e2e-linux.result }} + run: | + echo "linux build: $BUILD, e2e-linux: $TESTS, event: $GITHUB_EVENT_NAME" + case "$BUILD/$TESTS" in + success/success) exit 0 ;; + # Nothing was built: a change in documentation only. + skipped/skipped) exit 0 ;; + # A push to master builds and does not run the suite. + success/skipped) [ "$GITHUB_EVENT_NAME" = push ] && exit 0 ;; + esac + echo "::error::The Linux e2e suite did not pass (build: $BUILD, tests: $TESTS)." + exit 1 + android: name: android needs: [changes, image] diff --git a/.github/workflows/e2e-nightly.yml b/.github/workflows/e2e-nightly.yml index 84df6a5ab52..729615ecf47 100644 --- a/.github/workflows/e2e-nightly.yml +++ b/.github/workflows/e2e-nightly.yml @@ -4,6 +4,10 @@ on: schedule: - cron: '0 1 * * *' workflow_dispatch: + # A schedule runs only what is on master: a change to this workflow is tried in its pull request. + pull_request: + paths: + - .github/workflows/e2e-nightly.yml permissions: contents: read @@ -60,6 +64,7 @@ jobs: env: | APPIMAGE_EXTRACT_AND_RUN=1 USE_SIMULATED_KEYCARD=${{ matrix.simulated }} + # The caches the linux job of ci.yml saves on master. None is saved here. - name: Cache keys id: keys run: | @@ -71,14 +76,14 @@ jobs: id: go with: path: .ci-cache/go-build - key: go-linux-${{ matrix.id }}-${{ steps.keys.outputs.status-go }} - restore-keys: go-linux-${{ matrix.id }}- + key: go-linux-${{ steps.keys.outputs.status-go }} + restore-keys: go-linux- - uses: actions/cache/restore@0057852bfaa89a56745cba8c7296529d2fc39830 # v4 id: ccache with: path: .ci-cache/ccache - key: ccache-linux-${{ matrix.id }}-${{ steps.keys.outputs.day }} - restore-keys: ccache-linux-${{ matrix.id }}- + key: ccache-linux-${{ steps.keys.outputs.day }} + restore-keys: ccache-linux- - uses: actions/cache/restore@0057852bfaa89a56745cba8c7296529d2fc39830 # v4 id: nimble with: @@ -103,16 +108,6 @@ jobs: STATUS_BUILD_KLIPY_API_KEY: ${{ secrets.STATUS_BUILD_KLIPY_API_KEY }} USE_SIMULATED_KEYCARD: ${{ matrix.simulated }} run: $IN_IMAGE make tgz-linux - - uses: actions/cache/save@0057852bfaa89a56745cba8c7296529d2fc39830 # v4 - if: ${{ !cancelled() && steps.go.outputs.cache-hit != 'true' }} - with: - path: .ci-cache/go-build - key: go-linux-${{ matrix.id }}-${{ steps.keys.outputs.status-go }} - - uses: actions/cache/save@0057852bfaa89a56745cba8c7296529d2fc39830 # v4 - if: ${{ !cancelled() && steps.ccache.outputs.cache-hit != 'true' }} - with: - path: .ci-cache/ccache - key: ccache-linux-${{ matrix.id }}-${{ steps.keys.outputs.day }} - uses: ./.github/actions/build-artifact with: platform: linux-x86_64-${{ matrix.id }} @@ -121,7 +116,8 @@ jobs: suite: needs: package - if: ${{ !cancelled() && needs.package.result == 'success' }} + # Whatever the other build did: a suite whose own build is missing fails when it unpacks it. + if: ${{ !cancelled() }} permissions: contents: read actions: read @@ -140,7 +136,8 @@ jobs: keycard: needs: package - if: ${{ !cancelled() && needs.package.result == 'success' }} + # Whatever the other build did: a suite whose own build is missing fails when it unpacks it. + if: ${{ !cancelled() }} permissions: contents: read actions: read diff --git a/.github/workflows/e2e.yml b/.github/workflows/e2e.yml index 78ece519575..9da5200aa2f 100644 --- a/.github/workflows/e2e.yml +++ b/.github/workflows/e2e.yml @@ -95,12 +95,14 @@ jobs: env: GITHUB_TOKEN: ${{ github.token }} WALLET_TEST_USER_SEED: ${{ secrets.WALLET_TEST_USER_SEED }} + # Through the environment: pasted into the script, it would run as shell. + MARKERS: ${{ inputs.pytest-args }} run: | if [ "$RUNNER_OS" = Linux ]; then echo "$GITHUB_TOKEN" | docker login ghcr.io --username "$GITHUB_ACTOR" --password-stdin || echo "No GHCR login." fi test/e2e/scripts/ci/run.sh "$RUNNER_TEMP/pkg" "$RUNNER_TEMP/qmlinspector/plugins" \ - -m "${{ inputs.pytest-args }}" -v --reruns=1 --timeout=300 -o timeout_func_only=true --disable-warnings \ + -m "$MARKERS" -v --reruns=1 --timeout=300 -o timeout_func_only=true --disable-warnings \ --junitxml=junit.xml --alluredir=./allure-results # Logs, reports and failure screenshots only: the app data of a run is hundreds of megabytes. - name: Upload results diff --git a/test/e2e/scripts/inspector/in-image.sh b/test/e2e/scripts/inspector/in-image.sh index 6ef6d790127..6756095641a 100755 --- a/test/e2e/scripts/inspector/in-image.sh +++ b/test/e2e/scripts/inspector/in-image.sh @@ -22,6 +22,15 @@ fluxbox > /tmp/fluxbox.log 2>&1 & cd /work/test/e2e [ -e configs/_local.py ] || cp configs/_local.ci.py configs/_local.py +# The WalletConnect tests start a dApp that needs these packages. A failed install fails those tests only. +dapp=scripts/wallet_connect_dapp +if [ ! -f "$dapp/node_modules/@walletconnect/sign-client/package.json" ]; then + (cd "$dapp" && npm ci --no-audit --no-fund) > /tmp/npm-ci.log 2>&1 || { + echo "in-image: npm ci failed in $dapp" >&2 + tail -n 20 /tmp/npm-ci.log >&2 + } +fi + export STATUS_RUNTIME_HTTP_API=False STATUS_RUNTIME_WS_API=False export QML_DISABLE_CACHE=1 QT_QPA_PLATFORM=linuxfb QT_LOGGING_RULES='*.warning=true' export STATUS_RUNTIME_TEST_MODE=1 STATUS_NO_DESKTOP_INTEGRATION=1 LIBGL_ALWAYS_SOFTWARE=1