Browse Source

Use actions from test-runner-3ds repo

Actually run tests now!!!
pull/135/head
Ian Chamberlain 1 year ago
parent
commit
3a74c5bcaf
No known key found for this signature in database
GPG Key ID: AE5484D09405AA60
  1. 46
      .github/actions/setup/action.yml
  2. 45
      .github/workflows/ci.yml

46
.github/actions/setup/action.yml

@ -1,46 +0,0 @@ @@ -1,46 +0,0 @@
name: Setup
description: Set up CI environment for Rust + 3DS development
inputs:
toolchain:
description: The Rust toolchain to use for the steps
required: true
default: nightly
runs:
using: composite
steps:
# https://github.com/nektos/act/issues/917#issuecomment-1074421318
- if: ${{ env.ACT }}
shell: bash
name: Hack container for local development
run: |
curl -fsSL https://deb.nodesource.com/setup_lts.x | sudo -E bash -
sudo apt-get install -y nodejs
- name: Setup default Rust toolchain
# Use this helper action so we get matcher support
# https://github.com/actions-rust-lang/setup-rust-toolchain/pull/15
uses: actions-rust-lang/setup-rust-toolchain@v1
with:
components: clippy, rustfmt, rust-src
toolchain: ${{ inputs.toolchain }}
- name: Install build tools for host
shell: bash
run: sudo apt-get update && sudo apt-get install -y build-essential
- name: Install cargo-3ds
uses: actions-rs/cargo@v1
with:
command: install
# TODO: this should probably just be a released version from crates.io
# once cargo-3ds gets published somewhere...
args: >-
--git https://github.com/rust3ds/cargo-3ds
--rev 78a652fdfb01e2614a792d1a56b10c980ee1dae9
- name: Set PATH to include devkitARM
shell: bash
# For some reason devkitARM/bin is not part of the default PATH in the container
run: echo "${DEVKITARM}/bin" >> $GITHUB_PATH

45
.github/workflows/ci.yml

@ -33,11 +33,13 @@ jobs: @@ -33,11 +33,13 @@ jobs:
- name: Checkout branch
uses: actions/checkout@v2
- uses: ./.github/actions/setup
# TODO update to to rust3ds/$something once migrated. Also, this is a bit
# wordy, it might be nicer to put the actions at the top level of the repo
- uses: ian-h-chamberlain/test-runner-3ds/.github/actions/setup@v1
with:
toolchain: ${{ matrix.toolchain }}
- name: Hide duplicate warnings from lint job
- name: Hide duplicate warnings from nightly
if: ${{ matrix.toolchain == 'nightly' }}
run: |
echo "::remove-matcher owner=clippy::"
@ -46,14 +48,13 @@ jobs: @@ -46,14 +48,13 @@ jobs:
- name: Check formatting
run: cargo fmt --all --verbose -- --check
- name: Cargo check
run: cargo 3ds clippy --color=always --verbose --all-targets
# --deny=warnings would be nice, but can easily break CI for new clippy
# lints getting added. I'd also like to use Github's "inline warnings"
# feature, but https://github.com/actions/runner/issues/2341 means we
# can't have both that *and* colored output.
- name: Cargo check ctru-sys (without tests)
run: cargo 3ds clippy --package ctru-sys --color=always --verbose
doctests:
- name: Cargo check ctru-rs (including tests)
run: cargo 3ds clippy --package ctru-rs --color=always --verbose --all-targets
test:
strategy:
matrix:
toolchain:
@ -66,15 +67,33 @@ jobs: @@ -66,15 +67,33 @@ jobs:
- name: Checkout branch
uses: actions/checkout@v2
- uses: ./.github/actions/setup
- uses: ian-h-chamberlain/test-runner-3ds/.github/actions/setup@v1
with:
toolchain: ${{ matrix.toolchain }}
- name: Hide duplicated warnings from lint job
run: echo "::remove-matcher owner=clippy::"
- name: Build lib + integration tests
# Technically this will only build one 3dsx even if there's more than one executable,
# but we only run the `.elf` outputs so it doesn't really matter.
run: cargo 3ds test --no-run --tests --package ctru-rs
- name: Build doc tests
run: cargo 3ds test --doc --verbose
run: cargo 3ds test --no-run --doc
- name: Run lib + integration tests
uses: ian-h-chamberlain/test-runner-3ds/.github/actions/citra@v1
with:
executable: ./target/armv6k-nintendo-3ds/debug/deps/*.elf
# TODO: run doc tests https://github.com/ian-h-chamberlain/test-runner-3ds/issues/4
# TODO: it would be nice to actually build 3dsx for examples/tests, etc.
# and run it somehow, but exactly how remains to be seen.
- name: Upload citra logs and capture videos
uses: actions/upload-artifact@v3
if: success() || failure() # always run unless the workflow was cancelled
with:
name: citra-logs-${{ matrix.toolchain }}
path: |
target/armv6k-nintendo-3ds/debug/deps/*.txt
target/armv6k-nintendo-3ds/debug/deps/*.webm

Loading…
Cancel
Save