name: Tests on: pull_request: push: branches: [main] workflow_dispatch: workflow_call: jobs: tests: name: Linux tests runs-on: ubuntu-24.04 timeout-minutes: 120 steps: - uses: actions/checkout@v7 - name: Test release packaging checks run: | python3 .github/scripts/test_package_macos.py python3 .github/scripts/test_verify_release_artifacts.py - name: Init submodules run: | git -c submodule."externals/ownfoil".update=none -c submodule."externals/nxdumptool".update=none -c submodule."externals/nxapi".update=none -c submodule."externals/nx-optimizer".update=none submodule update --init --recursive --depth=1 - name: Fix submodule headers run: | f="externals/dynarmic/externals/mcl/include/boost/variant.hpp" if [ -f "$f" ] && grep -q 'C:/Users' "$f"; then printf '// Forwarding header\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n' > "$f" fi - name: Install deps run: | sudo apt-get update sudo apt-get install -y ninja-build glslang-tools \ libssl-dev libusb-1.0-0-dev libpulse-dev \ libvulkan-dev gamemode-dev \ libx11-dev libxext-dev libxrandr-dev libxcursor-dev libxi-dev \ libxfixes-dev libxss-dev libxkbcommon-dev libxtst-dev \ libwayland-dev libwayland-egl1 wayland-protocols libdecor-0-dev \ libegl-dev libdrm-dev libgbm-dev \ libavcodec-dev libavfilter-dev libavutil-dev libswscale-dev \ libboost-all-dev - name: Configure run: | cmake --version set -o pipefail cmake -B build -DCMAKE_BUILD_TYPE=Release -DENABLE_QT=OFF -DYUZU_TESTS=ON -DYUZU_CMD=OFF -GNinja -DOPENSSL_ROOT_DIR=/usr 2>&1 | tee cmake_configure.log - name: Upload cmake log if: failure() uses: actions/upload-artifact@v7 with: name: cmake-log-tests path: cmake_configure.log - name: Build tests run: cmake --build build --target tests recomp_stack_harness -j4 - name: Run tests working-directory: build env: SUYU_RECOMP_BENCHMARK_JSON: ${{ github.workspace }}/recomp_benchmark.json run: | set -euo pipefail # Do not use Catch2 -s: it dumps millions of PASSED lines (RingBuffer) # and still does not name hangs (case headers are lazy; InterExchange # join()s before REQUIRE). A testCaseStarting listener prints+flushes # the name at start. --order decl matches --list-tests order. echo '=== Catch2 --list-tests ===' stdbuf -oL -eL ./bin/tests --list-tests --order decl echo '=== Catch2 [export] (this PR helpers; must finish quickly) ===' timeout --foreground --kill-after=10s 30s \ stdbuf -oL -eL ./bin/tests --durations yes --order decl "[export]" echo '=== Catch2 ~[export] ===' timeout --foreground --kill-after=10s 90s \ stdbuf -oL -eL ./bin/tests --durations yes --order decl "~[export]" echo '=== recomp_stack_harness ===' stdbuf -oL -eL python3 "$GITHUB_WORKSPACE/scripts/recompiler_compat_baseline.py" \ --harness ./bin/recomp_stack_harness \ --output "$GITHUB_WORKSPACE/recomp-compat-baseline.json" \ --iterations 32 \ --timeout-seconds 60 - name: Validate and upload recompiler benchmark baseline run: | python3 scripts/compare_recomp_benchmark.py recomp_benchmark.json \ --baseline src/tests/recompiler/benchmarks/recomp_benchmark_baseline.json - uses: actions/upload-artifact@v7 with: name: recomp-benchmark-baseline path: recomp_benchmark.json - name: Validate compatibility baseline run: | python3 - <<'PY' import json from pathlib import Path record = json.loads(Path('recomp-compat-baseline.json').read_text()) assert record['schema_version'] == 1 assert record['kind'] == 'recompiler_compatibility_baseline' assert record['repository']['git_sha'] assert record['fixture']['redistributable'] is True assert len(record['workloads']) == 4 assert all(workload['status'] == 'pass' for workload in record['workloads']) assert record['failures'] == [] PY - name: Upload compatibility baseline if: always() uses: actions/upload-artifact@v7 with: name: recompiler-compatibility-baseline path: recomp-compat-baseline.json if-no-files-found: error tests-sanitizer: name: Linux x86-64 sanitizers runs-on: ubuntu-24.04 timeout-minutes: 30 steps: - uses: actions/checkout@v7 - name: Host arch run: uname -m - name: Configure recompiler tests (ASan+UBSan) run: | cmake -S src/tests/recompiler -B build-recomp-san \ -DCMAKE_BUILD_TYPE=RelWithDebInfo \ -DSUYU_ENABLE_SANITIZERS=ON \ -DCMAKE_C_COMPILER=gcc \ -DCMAKE_CXX_COMPILER=g++ - name: Build run: cmake --build build-recomp-san -j4 - name: Run exporter_smoke + homebrew_harness (insn correctness) env: ASAN_OPTIONS: detect_leaks=1:abort_on_error=1:halt_on_error=1 UBSAN_OPTIONS: halt_on_error=1:print_stacktrace=1 run: ctest --test-dir build-recomp-san --output-on-failure tests-sanitizer-arm64: name: Linux ARM64 sanitizers runs-on: ubuntu-24.04-arm timeout-minutes: 30 steps: - uses: actions/checkout@v7 - name: Host arch run: test "$(uname -m)" = aarch64 - name: Configure recompiler tests (ASan+UBSan) run: | cmake -S src/tests/recompiler -B build-recomp-san \ -DCMAKE_BUILD_TYPE=RelWithDebInfo \ -DSUYU_ENABLE_SANITIZERS=ON \ -DCMAKE_C_COMPILER=gcc \ -DCMAKE_CXX_COMPILER=g++ - name: Build run: cmake --build build-recomp-san -j2 - name: Run exporter_smoke + homebrew_harness (insn correctness) env: ASAN_OPTIONS: detect_leaks=1:abort_on_error=1:halt_on_error=1 UBSAN_OPTIONS: halt_on_error=1:print_stacktrace=1 run: ctest --test-dir build-recomp-san --output-on-failure