diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 92a318d..c58c991 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -15,7 +15,7 @@ jobs: matrix: toolchain: # Oldest supported nightly - - nightly-2024-02-18 + - nightly-2025-07-25 - nightly ctru-rs-ref: # "known good" version of `test-runner` crate @@ -28,7 +28,7 @@ jobs: image: devkitpro/devkitarm volumes: # So the test action can `docker run` the runner: - - '/var/run/docker.sock:/var/run/docker.sock' + - "/var/run/docker.sock:/var/run/docker.sock" steps: - name: Checkout branch uses: actions/checkout@v4 @@ -54,8 +54,8 @@ jobs: - uses: actions/checkout@v4 with: - repository: 'rust3ds/ctru-rs' - path: 'ctru-rs' + repository: "rust3ds/ctru-rs" + path: "ctru-rs" ref: ${{ steps.resolve-ref.outputs.sha }} - name: Build and run tests (unit + integration) @@ -77,7 +77,7 @@ jobs: args: --doc --package test-runner -v - name: Upload citra logs and capture videos - uses: actions/upload-artifact@v3 + uses: actions/upload-artifact@v4 # We always want to upload artifacts regardless of previous success/failure if: ${{ !cancelled() }} with: diff --git a/run-tests/Dockerfile b/run-tests/Dockerfile index 8b60653..c6aacac 100644 --- a/run-tests/Dockerfile +++ b/run-tests/Dockerfile @@ -1,34 +1,36 @@ -FROM buildpack-deps:latest as builder +FROM buildpack-deps:latest AS builder WORKDIR /tmp -COPY ./docker/download_citra.sh /usr/local/bin/download_citra +COPY ./docker/download_emu.sh /usr/local/bin/download_emu RUN apt-get update -y && apt-get install -y jq -ARG TAG=r0c2f076 -RUN download_citra ${TAG} +ARG TAG=2120 +RUN download_emu ${TAG} -FROM devkitpro/devkitarm:latest as devkitarm +FROM devkitpro/devkitarm:latest AS devkitarm -# For some reason, citra isn't always happy when you try to run it for the first time, +# For some reason, azahar/citra isn't always happy when you try to run it for the first time, # so we build a simple dummy program to force it to create its directory structure RUN cd /opt/devkitpro/examples/3ds/graphics/printing/hello-world && \ echo 'int main(int, char**) {}' > source/main.c && \ make && \ mv hello-world.3dsx /tmp/ -FROM ubuntu:mantic +FROM ubuntu:noble RUN --mount=type=cache,sharing=locked,target=/var/cache/apt \ apt-get update -y && \ apt-get install -y \ - libavfilter9 \ - libavformat60 \ - libavutil58 \ - libsdl2-2.0-0 \ - libswscale7 \ - mesa-vulkan-drivers \ - vulkan-tools \ - xvfb + libavfilter9 \ + libavformat60 \ + libavutil58 \ + libsdl2-2.0-0 \ + libswscale7 \ + libopengl0 \ + libegl1 \ + mesa-vulkan-drivers \ + vulkan-tools \ + xvfb COPY --from=devkitarm /opt/devkitpro /opt/devkitpro # There's no way to copy ENV values from other stages properly: @@ -38,16 +40,16 @@ ENV DEVKITPRO=/opt/devkitpro ENV DEVKITARM=${DEVKITPRO}/devkitARM ENV PATH=${DEVKITARM}/bin:${PATH} -COPY --from=builder /tmp/citra.AppImage /usr/local/bin/citra +COPY --from=builder /tmp/azahar.AppImage /usr/local/bin/azahar COPY --from=devkitarm /tmp/hello-world.3dsx /tmp/ -# We run citra once before copying our config file, so it should create its +# We run azahar/citra once before copying our config file, so it should create its # necessary directory structure and run once with defaults -RUN xvfb-run citra --appimage-extract-and-run /tmp/hello-world.3dsx; \ +RUN xvfb-run azahar --appimage-extract-and-run /tmp/hello-world.3dsx; \ rm -f /tmp/hello-world.3dsx # Initial run seems to miss this one directory so just make it manually -RUN mkdir -p /root/.local/share/citra-emu/log +RUN mkdir -p /root/.local/share/azahar-emu/log -COPY ./docker/sdl2-config.ini /root/.config/citra-emu/ +COPY ./docker/sdl2-config.ini /root/.config/azahar-emu/ COPY ./docker/test-runner.gdb /app/ COPY ./docker/entrypoint.sh /app/ diff --git a/run-tests/action.yml b/run-tests/action.yml index d61b6e7..0b7d930 100644 --- a/run-tests/action.yml +++ b/run-tests/action.yml @@ -1,6 +1,6 @@ name: Cargo 3DS Test description: > - Run `cargo 3ds test` executables using Citra. Note that to use this action, + Run `cargo 3ds test` executables using Azahar/Citra. Note that to use this action, you must use a container image of `devkitpro/devkitarm` and mount `/var/run/docker.sock:/var/run/docker.sock` into the container so that the runner image can be built by the action. @@ -9,7 +9,7 @@ inputs: args: description: Extra arguments to pass to `cargo 3ds test` required: false - default: '' + default: "" runner-image: description: The name of the container image to build for running tests in diff --git a/run-tests/docker/download_citra.sh b/run-tests/docker/download_citra.sh deleted file mode 100755 index f16ec11..0000000 --- a/run-tests/docker/download_citra.sh +++ /dev/null @@ -1,12 +0,0 @@ -#!/bin/bash - -set -euxo pipefail - -TAG=$1 - -curl "https://api.github.com/repos/PabloMK7/citra/releases/tags/${TAG}" | - jq --raw-output '.assets[].browser_download_url' | - grep -E 'citra-linux-.*[.]tar.gz' | - xargs wget -O citra-linux.tar.gz - -tar --strip-components 1 -xvf citra-linux.tar.gz diff --git a/run-tests/docker/download_emu.sh b/run-tests/docker/download_emu.sh new file mode 100755 index 0000000..4a682b0 --- /dev/null +++ b/run-tests/docker/download_emu.sh @@ -0,0 +1,14 @@ +#!/bin/bash + +set -euxo pipefail + +TAG=$1 + +curl "https://api.github.com/repos/azahar-emu/azahar/releases/tags/${TAG}" | + jq --raw-output '.assets[].browser_download_url' | + grep -E 'azahar.*.appimage.tar.gz' | + xargs wget -O azahar-linux.tar.gz + +tar --strip-components 1 -xvf azahar-linux.tar.gz + +chmod a+x azahar.AppImage diff --git a/run-tests/docker/entrypoint.sh b/run-tests/docker/entrypoint.sh index 72e1860..4435094 100755 --- a/run-tests/docker/entrypoint.sh +++ b/run-tests/docker/entrypoint.sh @@ -34,29 +34,29 @@ fi VIDEO_OUT="${EXE_NOEXT}_capture.webm" -CITRA_LOG_DIR=~/.local/share/citra-emu/log -CITRA_OUT="$CITRA_LOG_DIR/citra_output.txt" +EMU_LOG_DIR=~/.local/share/azahar-emu/log +EMU_OUT="$EMU_LOG_DIR/azahar_output.txt" xvfb-run --auto-servernum \ - citra \ + azahar \ --appimage-extract-and-run \ --dump-video="$VIDEO_OUT" \ "$EXE_TO_RUN" \ - &>"$CITRA_OUT" & -CITRA_PID=$! + &>"$EMU_OUT" & +EMU_PID=$! -# Citra takes a little while to start up, so wait a little before we try to connect +# Azahar/Citra takes a little while to start up, so wait a little before we try to connect sleep 5 arm-none-eabi-gdb --silent --batch-silent --command /app/test-runner.gdb "$EXE_ELF" STATUS=$? -kill $CITRA_PID +kill $EMU_PID cleanup_jobs -CITRA_LOG="$CITRA_LOG_DIR/citra_log.txt" +EMU_LOG="$EMU_LOG_DIR/azahar_log.txt" -for f in "$CITRA_LOG" "$CITRA_OUT"; do +for f in "$EMU_LOG" "$EMU_OUT"; do OUT="${EXE_NOEXT}_$(basename "$f")" if test -f "$f"; then cp "$f" "$OUT" diff --git a/setup/action.yml b/setup/action.yml index 60167b7..3fe4442 100644 --- a/setup/action.yml +++ b/setup/action.yml @@ -31,8 +31,7 @@ runs: - name: Install cargo-3ds shell: bash - # TODO: replace with crates.io version once published - run: cargo install --locked --git https://github.com/rust3ds/cargo-3ds + run: cargo install --locked cargo-3ds - name: Set PATH to include devkitARM shell: bash