-
Notifications
You must be signed in to change notification settings - Fork 19
103 lines (88 loc) · 3.52 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
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
name: CI
on:
push:
branches:
- master
pull_request:
branches:
- master
workflow_dispatch:
jobs:
lint:
strategy:
matrix:
toolchain:
# Run against a "known good" nightly. Rustc version is 1 day behind the toolchain date
- nightly-2024-03-10
# 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
- uses: rust3ds/test-runner/setup@v1
with:
toolchain: ${{ matrix.toolchain }}
# https://github.com/actions/runner/issues/504
# Removing the matchers won't keep the job from failing if there are errors,
# but will at least declutter pull request annotations (especially for warnings).
- name: Hide duplicate annotations 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
# We always run the next step, so that even if formatting fails we
# still get compilation errors for the same run (mainly for matchers).
- name: Cargo check workspace (including tests / examples)
run: cargo 3ds clippy --workspace --color=always --verbose --all-targets
if: success() || failure()
test:
strategy:
matrix:
toolchain:
- nightly-2024-03-10
- nightly
continue-on-error: ${{ matrix.toolchain == 'nightly' }}
runs-on: ubuntu-latest
container: devkitpro/devkitarm
steps:
- name: Checkout branch
uses: actions/checkout@v2
- uses: rust3ds/test-runner/setup@v1
with:
toolchain: ${{ matrix.toolchain }}
- name: Hide duplicated warnings from lint job
run: echo "::remove-matcher owner=clippy::"
# This needs to be done separately from running the tests to ensure the
# lib tests' .3dsx is built before the test is run (for romfs). We don't
# really have a good way to build the 3dsx in between the build + test,
# unless cargo-3ds actually runs them as separate commands. See
# https://github.com/rust3ds/cargo-3ds/issues/44 for more details
- name: Build lib and integration tests
# Hmm, I guess we really do need to build each target separately due to the above issue:
run: |
cargo 3ds test --no-run --lib --all-features --package ctru-sys
cargo 3ds test --no-run --test layout_test --all-features --package ctru-sys
cargo 3ds test --no-run --lib --all-features --package ctru-rs
- name: Run lib and integration tests
uses: rust3ds/test-runner/run-tests@v1
with:
args: --tests --all-features --workspace
- name: Build and run doc tests
uses: rust3ds/test-runner/run-tests@v1
with:
args: --doc --workspace
- 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
target/armv6k-nintendo-3ds/debug/build/ctru-*/out/*