name: Test Build Artifacts (Reusable) on: workflow_call: inputs: arch: description: Architecture of the artifacts under test (amd64/arm64) type: string default: amd64 permissions: contents: read jobs: test-artifact: strategy: fail-fast: false matrix: include: - format: deb container: "" - format: rpm container: "fedora:42" - format: appimage container: "" name: Validate ${{ inputs.arch }} ${{ matrix.format }} package # arm64 artifacts run on a native arm64 runner (matching build-arm64) # so the launch smoke test actually executes the packaged binary # rather than failing on a foreign architecture. runs-on: ${{ inputs.arch == 'arm64' && 'ubuntu-22.04-arm' || 'ubuntu-latest' }} container: ${{ matrix.container || '' }} steps: - name: Checkout repository uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4 - name: Download artifact uses: actions/download-artifact@d3f86a106a0bac45b974a628896c90dbdf5c8093 # v4 with: name: package-${{ inputs.arch }}-${{ matrix.format }} path: artifacts/ - name: Install test dependencies (Fedora) if: matrix.format == 'rpm' # Electron's shared libraries (nss/nspr/gtk3/X11/etc.) must be # installed explicitly: the rpm is installed with `rpm -ivh --nodeps` # and its spec sets `AutoReqProv: no`, so the package declares no # runtime Requires and nothing pulls these in. Without them the # launch smoke test dies with `libnspr4.so: cannot open shared # object file` (exit 127). The Ubuntu runner already carries them. run: | dnf install -y findutils file nodejs npm \ xorg-x11-server-Xvfb dbus-daemon util-linux procps-ng \ nss nspr atk at-spi2-atk at-spi2-core cups-libs gtk3 \ libdrm mesa-libgbm alsa-lib libX11 libXcomposite libXdamage \ libXext libXfixes libXrandr libxcb libxkbcommon pango cairo \ libXScrnSaver libXtst libxshmfence - name: Install test dependencies (Ubuntu) if: matrix.format != 'rpm' run: | sudo apt-get update sudo apt-get install -y file libfuse2 nodejs npm \ xvfb dbus-x11 procps # Fail loud if a smoke-test tool is missing. Without this guard a # missing/renamed tool turns run_launch_smoke_test into a silent # green skip (it does `pass "$skip"; return`), masking the test. - name: Verify smoke-test tools are present (Ubuntu) if: matrix.format != 'rpm' run: | for t in xvfb-run dbus-run-session setsid; do command -v "$t" >/dev/null || { echo "::error::missing $t"; exit 1; } done - name: Verify smoke-test tools are present (Fedora) if: matrix.format == 'rpm' run: | for t in xvfb-run dbus-run-session setsid runuser; do command -v "$t" >/dev/null || { echo "::error::missing $t"; exit 1; } done - name: Run artifact tests env: TARGET_ARCH: ${{ inputs.arch }} run: | chmod +x tests/test-artifact-${{ matrix.format }}.sh tests/test-artifact-${{ matrix.format }}.sh artifacts/