From 057496e4a2df1be4a3c4bc11118faccf3f3d3dd0 Mon Sep 17 00:00:00 2001 From: Ian Chamberlain Date: Sun, 24 Sep 2023 13:27:37 -0400 Subject: [PATCH] Big restructure for crate and actions Move the runner-specific docker stuff into that action directory, and move the runner crate into a subdirectory for simpler top-level structure. --- .github/workflows/ci.yml | 2 ++ .dockerignore => run-tests/.dockerignore | 0 Dockerfile => run-tests/Dockerfile | 0 run-tests/action.yml | 7 +++++++ {docker => run-tests/docker}/download_citra.sh | 0 {docker => run-tests/docker}/entrypoint.sh | 0 {docker => run-tests/docker}/sdl2-config.ini | 0 {docker => run-tests/docker}/test-runner.gdb | 0 Cargo.toml => test-runner/Cargo.toml | 7 +++++++ {src => test-runner/src}/console.rs | 0 {src => test-runner/src}/gdb.rs | 0 {src => test-runner/src}/lib.rs | 0 {src => test-runner/src}/socket.rs | 0 {tests => test-runner/tests}/integration.rs | 0 14 files changed, 16 insertions(+) rename .dockerignore => run-tests/.dockerignore (100%) rename Dockerfile => run-tests/Dockerfile (100%) rename {docker => run-tests/docker}/download_citra.sh (100%) rename {docker => run-tests/docker}/entrypoint.sh (100%) rename {docker => run-tests/docker}/sdl2-config.ini (100%) rename {docker => run-tests/docker}/test-runner.gdb (100%) rename Cargo.toml => test-runner/Cargo.toml (54%) rename {src => test-runner/src}/console.rs (100%) rename {src => test-runner/src}/gdb.rs (100%) rename {src => test-runner/src}/lib.rs (100%) rename {src => test-runner/src}/socket.rs (100%) rename {tests => test-runner/tests}/integration.rs (100%) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 7f9cf4a..adcb03c 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -60,6 +60,7 @@ jobs: - name: Build and run tests (unit + integration) uses: ./run-tests with: + working-directory: test-runner args: -- -v - name: Build and run doc tests @@ -71,6 +72,7 @@ jobs: RUSTDOCFLAGS: " --persist-doctests target/armv6k-nintendo-3ds/debug/doctests" uses: ./run-tests with: + working-directory: test-runner # TODO(#4): run them suckers args: --doc --no-run -- -v diff --git a/.dockerignore b/run-tests/.dockerignore similarity index 100% rename from .dockerignore rename to run-tests/.dockerignore diff --git a/Dockerfile b/run-tests/Dockerfile similarity index 100% rename from Dockerfile rename to run-tests/Dockerfile diff --git a/run-tests/action.yml b/run-tests/action.yml index b957bb4..08c46e4 100644 --- a/run-tests/action.yml +++ b/run-tests/action.yml @@ -16,6 +16,11 @@ inputs: required: false default: test-runner-3ds + working-directory: + description: Change to this directory before running tests. Defaults to $GITHUB_WORKSPACE + required: false + default: ${GITHUB_WORKSPACE} + runs: using: composite steps: @@ -25,6 +30,7 @@ runs: - name: Build test-runner image uses: docker/build-push-action@v4 with: + contest: ${{ github.action_path }} tags: ${{ inputs.runner-image }}:latest push: false load: true @@ -40,6 +46,7 @@ runs: # https://github.com/actions/runner/issues/2058, which also means # we have to export this instead of using the env: key run: | + cd ${{ inputs.working-directory }} export CARGO_TARGET_ARMV6K_NINTENDO_3DS_RUNNER=" docker run --rm -v /tmp:/tmp diff --git a/docker/download_citra.sh b/run-tests/docker/download_citra.sh similarity index 100% rename from docker/download_citra.sh rename to run-tests/docker/download_citra.sh diff --git a/docker/entrypoint.sh b/run-tests/docker/entrypoint.sh similarity index 100% rename from docker/entrypoint.sh rename to run-tests/docker/entrypoint.sh diff --git a/docker/sdl2-config.ini b/run-tests/docker/sdl2-config.ini similarity index 100% rename from docker/sdl2-config.ini rename to run-tests/docker/sdl2-config.ini diff --git a/docker/test-runner.gdb b/run-tests/docker/test-runner.gdb similarity index 100% rename from docker/test-runner.gdb rename to run-tests/docker/test-runner.gdb diff --git a/Cargo.toml b/test-runner/Cargo.toml similarity index 54% rename from Cargo.toml rename to test-runner/Cargo.toml index 6d49699..eddd1c3 100644 --- a/Cargo.toml +++ b/test-runner/Cargo.toml @@ -12,3 +12,10 @@ socket = [] ctru-rs = { git = "https://github.com/rust3ds/ctru-rs" } ctru-sys = { git = "https://github.com/rust3ds/ctru-rs" } libc = "0.2.147" + +[patch."https://github.com/ian-h-chamberlain/test-runner-3ds"] +test-runner = { path = "." } + +# Future-proofing for a rename + org move: +[patch."https://github.com/rust3ds/test-runner"] +test-runner = { path = "." } diff --git a/src/console.rs b/test-runner/src/console.rs similarity index 100% rename from src/console.rs rename to test-runner/src/console.rs diff --git a/src/gdb.rs b/test-runner/src/gdb.rs similarity index 100% rename from src/gdb.rs rename to test-runner/src/gdb.rs diff --git a/src/lib.rs b/test-runner/src/lib.rs similarity index 100% rename from src/lib.rs rename to test-runner/src/lib.rs diff --git a/src/socket.rs b/test-runner/src/socket.rs similarity index 100% rename from src/socket.rs rename to test-runner/src/socket.rs diff --git a/tests/integration.rs b/test-runner/tests/integration.rs similarity index 100% rename from tests/integration.rs rename to test-runner/tests/integration.rs