Smoke Tests #61
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Smoke Tests | |
| on: | |
| schedule: | |
| - cron: '0 14 * * 5' # Friday 14:00 UTC = Saturday 00:00 AEST (UTC+10); 01:00 AEDT during summer | |
| workflow_dispatch: | |
| jobs: | |
| release: | |
| name: Release (${{ matrix.artifact }}) | |
| runs-on: ubuntu-latest | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| include: | |
| - target: x86_64-unknown-linux-musl | |
| artifact: linux-x86_64 | |
| binary: cursus | |
| - target: aarch64-unknown-linux-musl | |
| artifact: linux-aarch64 | |
| binary: cursus | |
| - target: riscv64gc-unknown-linux-musl | |
| artifact: linux-riscv64 | |
| binary: cursus | |
| # No GitHub-hosted RISC-V runner exists; artifact is built but not smoke-tested | |
| steps: | |
| - uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3 | |
| - uses: DeterminateSystems/nix-installer-action@ef8a148080ab6020fd15196c2084a2eea5ff2d25 # v22 | |
| - uses: DeterminateSystems/magic-nix-cache-action@908b263ff629f4cc17666315b7fd3ec127c6244d # v14 | |
| with: | |
| use-flakehub: false | |
| - name: Build ${{ matrix.artifact }} | |
| shell: nix develop -c bash -e {0} | |
| run: cargo zigbuild --release --target ${{ matrix.target }} | |
| - name: Upload ${{ matrix.artifact }} | |
| uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1 | |
| with: | |
| name: ${{ matrix.artifact }} | |
| path: target/${{ matrix.target }}/release/${{ matrix.binary }} | |
| release-macos: | |
| name: Release (${{ matrix.artifact }}) | |
| runs-on: macos-latest | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| include: | |
| - target: x86_64-apple-darwin | |
| artifact: macos-x86_64 | |
| binary: cursus | |
| - target: aarch64-apple-darwin | |
| artifact: macos-aarch64 | |
| binary: cursus | |
| steps: | |
| - uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3 | |
| - uses: DeterminateSystems/nix-installer-action@ef8a148080ab6020fd15196c2084a2eea5ff2d25 # v22 | |
| - uses: DeterminateSystems/magic-nix-cache-action@908b263ff629f4cc17666315b7fd3ec127c6244d # v14 | |
| with: | |
| use-flakehub: false | |
| - name: Build ${{ matrix.artifact }} | |
| shell: nix develop -c bash -e {0} | |
| run: cargo zigbuild --release --target ${{ matrix.target }} | |
| - name: Upload ${{ matrix.artifact }} | |
| uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1 | |
| with: | |
| name: ${{ matrix.artifact }} | |
| path: target/${{ matrix.target }}/release/${{ matrix.binary }} | |
| release-windows: | |
| name: Release (${{ matrix.artifact }}) | |
| runs-on: windows-latest | |
| env: | |
| RUSTFLAGS: "-C target-feature=+crt-static" | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| include: | |
| - target: x86_64-pc-windows-msvc | |
| artifact: windows-x86_64 | |
| binary: cursus.exe | |
| - target: aarch64-pc-windows-msvc | |
| artifact: windows-aarch64 | |
| binary: cursus.exe | |
| steps: | |
| - uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3 | |
| - name: Install Rust nightly | |
| uses: dtolnay/rust-toolchain@3c5f7ea28cd621ae0bf5283f0e981fb97b8a7af9 # master | |
| with: | |
| toolchain: nightly | |
| targets: ${{ matrix.target }} | |
| - name: Build ${{ matrix.artifact }} | |
| run: cargo build --release -p cursus-bin --target ${{ matrix.target }} | |
| - name: Upload ${{ matrix.artifact }} | |
| uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1 | |
| with: | |
| name: ${{ matrix.artifact }} | |
| path: target/${{ matrix.target }}/release/${{ matrix.binary }} | |
| smoke-test: | |
| name: Smoke test (${{ matrix.artifact }}) | |
| needs: [release, release-macos, release-windows] | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| include: | |
| - runner: ubuntu-latest | |
| artifact: linux-x86_64 | |
| binary: cursus | |
| - runner: ubuntu-24.04-arm | |
| artifact: linux-aarch64 | |
| binary: cursus | |
| - runner: macos-26-intel | |
| artifact: macos-x86_64 | |
| binary: cursus | |
| - runner: macos-latest | |
| artifact: macos-aarch64 | |
| binary: cursus | |
| - runner: windows-latest | |
| artifact: windows-x86_64 | |
| binary: cursus.exe | |
| - runner: windows-11-arm | |
| artifact: windows-aarch64 | |
| binary: cursus.exe | |
| runs-on: ${{ matrix.runner }} | |
| steps: | |
| - name: Download artifact | |
| uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1 | |
| with: | |
| name: ${{ matrix.artifact }} | |
| path: ./bin | |
| - name: Make executable | |
| if: runner.os != 'Windows' | |
| run: chmod +x ./bin/${{ matrix.binary }} | |
| - name: Set up MSVC dev environment | |
| if: runner.os == 'Windows' | |
| uses: ilammy/msvc-dev-cmd@0b201ec74fa43914dc39ae48a89fd1d8cb592756 # v1.13.0 | |
| - name: Assert static linkage | |
| shell: bash | |
| run: | | |
| set -euo pipefail | |
| BIN="./bin/${{ matrix.binary }}" | |
| case "${{ runner.os }}" in | |
| Linux) | |
| file "$BIN" | |
| if ! file "$BIN" | grep -q "statically linked"; then | |
| echo "FAIL: binary is not statically linked" | |
| exit 1 | |
| fi | |
| echo "OK: musl binary is statically linked" | |
| ;; | |
| macOS) | |
| file "$BIN" | |
| otool -L "$BIN" | |
| bad=$(set +o pipefail; otool -L "$BIN" | tail -n +2 | awk '{print $1}' \ | |
| | grep -vE '^(/usr/lib/|/System/Library/)' || true) | |
| if [ -n "$bad" ]; then | |
| echo "FAIL: non-system dynamic dependencies found:" | |
| echo "$bad" | |
| exit 1 | |
| fi | |
| echo "OK: only system dylibs linked" | |
| ;; | |
| Windows) | |
| dumpbin //DEPENDENTS "$BIN" | |
| bad=$(set +o pipefail; dumpbin //DEPENDENTS "$BIN" 2>&1 \ | |
| | grep -iE '(msvcp|vcruntime|msvcr|api-ms-win-crt)' || true) | |
| if [ -n "$bad" ]; then | |
| echo "FAIL: CRT DLL dependencies found — +crt-static did not apply:" | |
| echo "$bad" | |
| exit 1 | |
| fi | |
| echo "OK: no CRT DLL dependencies" | |
| ;; | |
| esac | |
| - name: Run smoke test | |
| run: ./bin/${{ matrix.binary }} --version | |
| npm-smoke-test: | |
| name: npm install smoke test (${{ matrix.runner }}) | |
| runs-on: ${{ matrix.runner }} | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| include: | |
| - runner: ubuntu-latest | |
| - runner: windows-latest | |
| steps: | |
| - uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6.4.0 | |
| with: | |
| node-version: '24.16.0' | |
| - name: Install @zantarix/cursus | |
| shell: bash | |
| run: | | |
| mkdir cursus-test | |
| cd cursus-test | |
| npm init -y | |
| npm install @zantarix/cursus | |
| npm audit signatures | |
| - name: Run npx cursus --version | |
| shell: bash | |
| working-directory: cursus-test | |
| run: | | |
| ./node_modules/.bin/cursus --version | |
| npx cursus --version |