name: CI on: push: branches: - master pull_request: branches: - master workflow_dispatch: env: # https://blog.rust-lang.org/2022/06/22/sparse-registry-testing.html CARGO_UNSTABLE_SPARSE_REGISTRY: "true" # actions-rust-lang/setup-rust-toolchain sets some default RUSTFLAGS RUSTFLAGS: "" jobs: lint: strategy: matrix: toolchain: # Run against a "known good" nightly. Rustc version is 1 day behind the toolchain date - nightly-2023-06-01 # Check for breakage on latest nightly - nightly # But if latest nightly fails, allow the workflow to continue continue-on-error: ${{ matrix.toolchain == 'nightly' }} runs-on: ubuntu-latest container: devkitpro/devkitarm steps: - name: Checkout branch uses: actions/checkout@v2 # 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 nightly if: ${{ matrix.toolchain == 'nightly' }} run: | echo "::remove-matcher owner=clippy::" echo "::remove-matcher owner=rustfmt::" - name: Check formatting run: cargo fmt --all --verbose -- --check - name: Cargo check ctru-sys (without tests) run: cargo 3ds clippy --package ctru-sys --color=always --verbose - name: Cargo check ctru-rs (including tests) run: cargo 3ds clippy --package ctru-rs --color=always --verbose --all-targets test: strategy: matrix: toolchain: - nightly-2023-06-01 - nightly continue-on-error: ${{ matrix.toolchain == 'nightly' }} runs-on: ubuntu-latest container: devkitpro/devkitarm steps: - name: Checkout branch uses: actions/checkout@v2 - 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 --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 - 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