|
|
|
name: CI
|
|
|
|
|
|
|
|
on:
|
|
|
|
push:
|
|
|
|
branches:
|
|
|
|
- main
|
|
|
|
pull_request:
|
|
|
|
branches:
|
|
|
|
- main
|
|
|
|
workflow_dispatch:
|
|
|
|
|
|
|
|
jobs:
|
|
|
|
lint:
|
|
|
|
strategy:
|
|
|
|
matrix:
|
|
|
|
toolchain:
|
|
|
|
- nightly-2023-06-01
|
|
|
|
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
container: devkitpro/devkitarm
|
|
|
|
steps:
|
|
|
|
- name: Checkout branch
|
|
|
|
uses: actions/checkout@v2
|
|
|
|
|
|
|
|
- uses: ./actions/setup
|
|
|
|
with:
|
|
|
|
toolchain: ${{ matrix.toolchain }}
|
|
|
|
|
|
|
|
- name: Check formatting
|
|
|
|
run: cargo fmt --all --verbose -- --check
|
|
|
|
|
|
|
|
- name: Run clippy
|
|
|
|
run: cargo 3ds clippy --color=always --verbose --all-targets
|
|
|
|
|
|
|
|
test:
|
|
|
|
strategy:
|
|
|
|
matrix:
|
|
|
|
toolchain:
|
|
|
|
# Oldest supported nightly
|
|
|
|
- nightly-2023-06-01
|
|
|
|
- nightly
|
|
|
|
|
|
|
|
continue-on-error: ${{ matrix.toolchain == 'nightly' }}
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
container:
|
|
|
|
image: devkitpro/devkitarm
|
|
|
|
volumes:
|
|
|
|
# So the test action can `docker run` the runner:
|
|
|
|
- '/var/run/docker.sock:/var/run/docker.sock'
|
|
|
|
# So the built test artifacts end up on the host, not just inside the action container
|
|
|
|
- '/tmp:/tmp'
|
|
|
|
steps:
|
|
|
|
- name: Checkout branch
|
|
|
|
uses: actions/checkout@v3
|
|
|
|
|
|
|
|
- uses: ./setup
|
|
|
|
with:
|
|
|
|
toolchain: ${{ matrix.toolchain }}
|
|
|
|
|
|
|
|
- name: Build and run tests (unit + integration)
|
|
|
|
uses: ./run-tests
|
|
|
|
with:
|
|
|
|
working-directory: test-runner
|
|
|
|
args: -- -v
|
|
|
|
|
|
|
|
- name: Build and run doc tests
|
|
|
|
# Let's still run doc tests even if lib/integration tests fail:
|
|
|
|
if: ${{ !cancelled() }}
|
|
|
|
env:
|
|
|
|
# This ensures the citra logs and video output gets put in a directory
|
|
|
|
# where we can upload as artifacts
|
|
|
|
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
|
|
|
|
|
|
|
|
- name: Upload citra logs and capture videos
|
|
|
|
uses: actions/upload-artifact@v3
|
|
|
|
# We always want to upload artifacts regardless of previous success/failure
|
|
|
|
if: ${{ !cancelled() }}
|
|
|
|
with:
|
|
|
|
name: citra-logs-${{ matrix.toolchain }}
|
|
|
|
path: |
|
|
|
|
target/armv6k-nintendo-3ds/debug/**/*.txt
|
|
|
|
target/armv6k-nintendo-3ds/debug/**/*.webm
|