-
Notifications
You must be signed in to change notification settings - Fork 0
87 lines (76 loc) · 2.62 KB
/
ci.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
name: CI
on:
push:
branches:
- main
pull_request:
branches:
- main
workflow_dispatch:
jobs:
test:
strategy:
matrix:
toolchain:
# Oldest supported nightly
- nightly-2024-02-18
- nightly
ctru-rs-ref:
# "known good" version of `test-runner` crate
- 3247af67d
- master
continue-on-error: ${{ matrix.toolchain == 'nightly' || matrix.ctru-rs-ref == 'master' }}
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'
steps:
- name: Checkout branch
uses: actions/checkout@v4
- uses: ./setup
with:
toolchain: ${{ matrix.toolchain }}
- name: Resolve inputs.ref to full SHA
# https://github.com/actions/checkout/issues/265#issuecomment-1936792528
id: resolve-ref
run: |
apt-get update -y && apt-get install -y jq
ref=${{ matrix.ctru-rs-ref }}
sha=$(curl -L "https://api.github.com/repos/rust3ds/ctru-rs/commits/$ref" | jq -r .sha)
if [ -z "$sha" ]; then
echo "Failed to resolve ref $ref (possibly missing GH_TOKEN env var?)" >&2
exit 1
fi
echo "sha=$sha" >> $GITHUB_OUTPUT
- uses: actions/checkout@v4
with:
repository: 'rust3ds/ctru-rs'
path: 'ctru-rs'
ref: ${{ steps.resolve-ref.outputs.sha }}
- name: Build and run tests (unit + integration)
uses: ./run-tests
with:
working-directory: ctru-rs
args: --package test-runner -- -v
- name: Build and run doc tests
# Still run doc tests even if lib/integration tests fail:
if: ${{ !cancelled() }}
env:
# This ensures the citra logs and video output get persisted to a
# directory where the artifact upload can find them.
RUSTDOCFLAGS: " --persist-doctests target/armv6k-nintendo-3ds/debug/doctests"
uses: ./run-tests
with:
working-directory: ctru-rs
args: --doc --package test-runner -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 }}-${{ matrix.ctru-rs-ref }}
path: |
ctru-rs/target/armv6k-nintendo-3ds/debug/**/*.txt
ctru-rs/target/armv6k-nintendo-3ds/debug/**/*.webm