Skip to content

Commit cdedaca

Browse files
Convert to Azahar from Citra (RIP)
1 parent 2446dea commit cdedaca

File tree

7 files changed

+35
-35
lines changed

7 files changed

+35
-35
lines changed

.github/workflows/ci.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -68,20 +68,20 @@ jobs:
6868
# Still run doc tests even if lib/integration tests fail:
6969
if: ${{ !cancelled() }}
7070
env:
71-
# This ensures the citra logs and video output get persisted to a
71+
# This ensures the emulator logs and video output get persisted to a
7272
# directory where the artifact upload can find them.
7373
RUSTDOCFLAGS: " --persist-doctests target/armv6k-nintendo-3ds/debug/doctests"
7474
uses: ./run-tests
7575
with:
7676
working-directory: ctru-rs
7777
args: --doc --package test-runner -v
7878

79-
- name: Upload citra logs and capture videos
79+
- name: Upload emulator logs and capture videos
8080
uses: actions/upload-artifact@v3
8181
# We always want to upload artifacts regardless of previous success/failure
8282
if: ${{ !cancelled() }}
8383
with:
84-
name: citra-logs-${{ matrix.toolchain }}-${{ matrix.ctru-rs-ref }}
84+
name: emu-logs-${{ matrix.toolchain }}-${{ matrix.ctru-rs-ref }}
8585
path: |
8686
ctru-rs/target/armv6k-nintendo-3ds/debug/**/*.txt
8787
ctru-rs/target/armv6k-nintendo-3ds/debug/**/*.webm

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ when working with these actions, in order to get useful test output on failures.
88
## Components
99

1010
* `setup`: action for setting up the Rust 3DS toolchain in workflows
11-
* `run-tests`: action for running test executables with Citra in workflows
11+
* `run-tests`: action for running test executables with [Azahar](https://github.com/azahar-emu/azahar) in workflows
1212

1313
## Usage
1414

run-tests/Dockerfile

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,15 @@
11
FROM buildpack-deps:latest as builder
22

33
WORKDIR /tmp
4-
COPY ./docker/download_citra.sh /usr/local/bin/download_citra
4+
COPY ./docker/download_emulator.sh /usr/local/bin/download_emulator
55
RUN apt-get update -y && apt-get install -y jq
66

7-
ARG TAG=r0c2f076
8-
RUN download_citra ${TAG}
7+
ARG EMU_TAG=2120.2
8+
RUN download_emulator ${EMU_TAG}
99

1010
FROM devkitpro/devkitarm:latest as devkitarm
1111

12-
# For some reason, citra isn't always happy when you try to run it for the first time,
12+
# For some reason, the emulator isn't always happy when you try to run it for the first time,
1313
# so we build a simple dummy program to force it to create its directory structure
1414
RUN cd /opt/devkitpro/examples/3ds/graphics/printing/hello-world && \
1515
echo 'int main(int, char**) {}' > source/main.c && \
@@ -38,16 +38,16 @@ ENV DEVKITPRO=/opt/devkitpro
3838
ENV DEVKITARM=${DEVKITPRO}/devkitARM
3939
ENV PATH=${DEVKITARM}/bin:${PATH}
4040

41-
COPY --from=builder /tmp/citra.AppImage /usr/local/bin/citra
41+
COPY --from=builder /tmp/azahar.AppImage /usr/local/bin/azahar
4242
COPY --from=devkitarm /tmp/hello-world.3dsx /tmp/
43-
# We run citra once before copying our config file, so it should create its
43+
# We run azahar once before copying our config file, so it should create its
4444
# necessary directory structure and run once with defaults
45-
RUN xvfb-run citra --appimage-extract-and-run /tmp/hello-world.3dsx; \
45+
RUN xvfb-run azahar --appimage-extract-and-run /tmp/hello-world.3dsx; \
4646
rm -f /tmp/hello-world.3dsx
4747
# Initial run seems to miss this one directory so just make it manually
48-
RUN mkdir -p /root/.local/share/citra-emu/log
48+
RUN mkdir -p /root/.local/share/azahar-emu/log
4949

50-
COPY ./docker/sdl2-config.ini /root/.config/citra-emu/
50+
COPY ./docker/sdl2-config.ini /root/.config/azahar-emu/
5151
COPY ./docker/test-runner.gdb /app/
5252
COPY ./docker/entrypoint.sh /app/
5353

run-tests/action.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
name: Cargo 3DS Test
22
description: >
3-
Run `cargo 3ds test` executables using Citra. Note that to use this action,
3+
Run `cargo 3ds test` executables using an emulator. Note that to use this action,
44
you must use a container image of `devkitpro/devkitarm` and mount
55
`/var/run/docker.sock:/var/run/docker.sock` into the container so that the
66
runner image can be built by the action.

run-tests/docker/download_citra.sh

Lines changed: 0 additions & 12 deletions
This file was deleted.
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
#!/bin/bash
2+
3+
set -euxo pipefail
4+
5+
TAG=$1
6+
7+
curl "https://api.github.com/repos/azahar-emu/azahar/releases/tags/${TAG}" |
8+
jq --raw-output '.assets[].browser_download_url' |
9+
grep -E 'azahar-.*-linux-appimage[.]tar.gz' |
10+
xargs wget -O azahar-linux-appimage.tar.gz
11+
12+
tar --strip-components 1 -xvf azahar-linux-appimage.tar.gz

run-tests/docker/entrypoint.sh

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -34,29 +34,29 @@ fi
3434

3535
VIDEO_OUT="${EXE_NOEXT}_capture.webm"
3636

37-
CITRA_LOG_DIR=~/.local/share/citra-emu/log
38-
CITRA_OUT="$CITRA_LOG_DIR/citra_output.txt"
37+
EMULATOR_LOG_DIR=~/.local/share/azahar-emu/log
38+
EMULATOR_OUT="$EMULATOR_LOG_DIR/emulator_output.txt"
3939

4040
xvfb-run --auto-servernum \
41-
citra \
41+
azahar \
4242
--appimage-extract-and-run \
4343
--dump-video="$VIDEO_OUT" \
4444
"$EXE_TO_RUN" \
45-
&>"$CITRA_OUT" &
46-
CITRA_PID=$!
45+
&>"$EMULATOR_OUT" &
46+
EMULATOR_PID=$!
4747

48-
# Citra takes a little while to start up, so wait a little before we try to connect
48+
# Azahar takes a little while to start up, so wait a little before we try to connect
4949
sleep 5
5050

5151
arm-none-eabi-gdb --silent --batch-silent --command /app/test-runner.gdb "$EXE_ELF"
5252
STATUS=$?
5353

54-
kill $CITRA_PID
54+
kill $EMULATOR_PID
5555
cleanup_jobs
5656

57-
CITRA_LOG="$CITRA_LOG_DIR/citra_log.txt"
57+
EMULATOR_LOG="$EMULATOR_LOG_DIR/azahar_log.txt"
5858

59-
for f in "$CITRA_LOG" "$CITRA_OUT"; do
59+
for f in "$EMULATOR_LOG" "$EMULATOR_OUT"; do
6060
OUT="${EXE_NOEXT}_$(basename "$f")"
6161
if test -f "$f"; then
6262
cp "$f" "$OUT"

0 commit comments

Comments
 (0)