Skip to content

Commit afc9046

Browse files
authored
Merge pull request #37 from rust3ds/feature/ci
Basic CI with lints and cargo-new
2 parents 6c22e50 + 70d5ec1 commit afc9046

File tree

3 files changed

+108
-1
lines changed

3 files changed

+108
-1
lines changed

.github/actions/setup/action.yml

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
name: Setup
2+
description: Set up CI environment for Rust + 3DS development
3+
4+
inputs:
5+
toolchain:
6+
description: The Rust toolchain to use for the steps
7+
required: true
8+
default: nightly
9+
10+
runs:
11+
using: composite
12+
steps:
13+
# https://github.com/nektos/act/issues/917#issuecomment-1074421318
14+
- if: ${{ env.ACT }}
15+
shell: bash
16+
name: Hack container for local development
17+
run: |
18+
curl -fsSL https://deb.nodesource.com/setup_lts.x | sudo -E bash -
19+
sudo apt-get install -y nodejs
20+
21+
- name: Setup default Rust toolchain
22+
# Use this helper action so we get matcher support
23+
# https://github.com/actions-rust-lang/setup-rust-toolchain/pull/15
24+
uses: actions-rust-lang/setup-rust-toolchain@v1
25+
with:
26+
components: clippy, rustfmt, rust-src
27+
toolchain: ${{ inputs.toolchain }}
28+
29+
- name: Install build tools for host
30+
shell: bash
31+
run: sudo apt-get update && sudo apt-get install -y build-essential
32+
33+
- name: Set PATH to include devkitARM
34+
shell: bash
35+
# For some reason devkitARM/bin is not part of the default PATH in the container
36+
run: echo "${DEVKITARM}/bin" >> $GITHUB_PATH

.github/workflows/ci.yml

Lines changed: 71 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,71 @@
1+
name: CI
2+
3+
on:
4+
push:
5+
branches:
6+
- master
7+
pull_request:
8+
branches:
9+
- master
10+
workflow_dispatch:
11+
12+
env:
13+
# https://blog.rust-lang.org/2022/06/22/sparse-registry-testing.html
14+
CARGO_UNSTABLE_SPARSE_REGISTRY: "true"
15+
# actions-rust-lang/setup-rust-toolchain sets some default RUSTFLAGS
16+
RUSTFLAGS: ""
17+
18+
jobs:
19+
lint:
20+
strategy:
21+
matrix:
22+
toolchain:
23+
- stable
24+
25+
runs-on: ubuntu-latest
26+
container: devkitpro/devkitarm
27+
steps:
28+
- name: Checkout branch
29+
uses: actions/checkout@v2
30+
31+
- uses: ./.github/actions/setup
32+
with:
33+
toolchain: ${{ matrix.toolchain }}
34+
35+
- name: Check formatting
36+
run: cargo fmt --all --verbose -- --check
37+
38+
- name: Cargo check
39+
run: cargo clippy --color=always --verbose --all-targets
40+
41+
project-build:
42+
strategy:
43+
matrix:
44+
toolchain:
45+
# Oldest supported nightly
46+
- nightly-2023-06-01
47+
- nightly
48+
49+
continue-on-error: ${{ matrix.toolchain == 'nightly' }}
50+
runs-on: ubuntu-latest
51+
container: devkitpro/devkitarm
52+
steps:
53+
- name: Checkout branch
54+
uses: actions/checkout@v3
55+
56+
- uses: ./.github/actions/setup
57+
with:
58+
toolchain: ${{ matrix.toolchain }}
59+
60+
- name: Install cargo-3ds
61+
uses: actions-rs/cargo@v1
62+
with:
63+
command: install
64+
args: --path .
65+
66+
- name: Create new project
67+
run: cargo 3ds new app --bin
68+
69+
- name: Build project
70+
working-directory: ./app
71+
run: cargo 3ds build --release

Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
name = "cargo-3ds"
33
version = "0.1.0"
44
authors = [ "Rust3DS Org", "Andrea Ciliberti <[email protected]>" ]
5-
description = "Cargo wrapper for developing Rust-based Nintendo 3DS homebrew apps"
5+
description = "Cargo wrapper for developing Nintendo 3DS homebrew apps"
66
repository = "https://github.com/Meziu/cargo-3ds"
77
license = "MIT OR Apache-2.0"
88
edition = "2021"

0 commit comments

Comments
 (0)