Andrea Ciliberti
1 year ago
2 changed files with 123 additions and 0 deletions
@ -0,0 +1,36 @@ |
|||||||
|
name: Setup |
||||||
|
description: Set up CI environment for Rust + 3DS development |
||||||
|
|
||||||
|
inputs: |
||||||
|
toolchain: |
||||||
|
description: The Rust toolchain to use for the steps |
||||||
|
required: true |
||||||
|
default: nightly |
||||||
|
|
||||||
|
runs: |
||||||
|
using: composite |
||||||
|
steps: |
||||||
|
# https://github.com/nektos/act/issues/917#issuecomment-1074421318 |
||||||
|
- if: ${{ env.ACT }} |
||||||
|
shell: bash |
||||||
|
name: Hack container for local development |
||||||
|
run: | |
||||||
|
curl -fsSL https://deb.nodesource.com/setup_lts.x | sudo -E bash - |
||||||
|
sudo apt-get install -y nodejs |
||||||
|
|
||||||
|
- name: Setup default Rust toolchain |
||||||
|
# Use this helper action so we get matcher support |
||||||
|
# https://github.com/actions-rust-lang/setup-rust-toolchain/pull/15 |
||||||
|
uses: actions-rust-lang/setup-rust-toolchain@v1 |
||||||
|
with: |
||||||
|
components: clippy, rustfmt, rust-src |
||||||
|
toolchain: ${{ inputs.toolchain }} |
||||||
|
|
||||||
|
- name: Install build tools for host |
||||||
|
shell: bash |
||||||
|
run: sudo apt-get update && sudo apt-get install -y build-essential |
||||||
|
|
||||||
|
- name: Set PATH to include devkitARM |
||||||
|
shell: bash |
||||||
|
# For some reason devkitARM/bin is not part of the default PATH in the container |
||||||
|
run: echo "${DEVKITARM}/bin" >> $GITHUB_PATH |
@ -0,0 +1,87 @@ |
|||||||
|
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 |
||||||
|
- nightly-2023-01-13 |
||||||
|
# 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: ./.github/actions/setup |
||||||
|
with: |
||||||
|
toolchain: ${{ matrix.toolchain }} |
||||||
|
|
||||||
|
- name: Hide duplicate warnings from lint job |
||||||
|
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 |
||||||
|
run: cargo 3ds clippy --color=always --verbose --all-targets |
||||||
|
# --deny=warnings would be nice, but can easily break CI for new clippy |
||||||
|
# lints getting added. I'd also like to use Github's "inline warnings" |
||||||
|
# feature, but https://github.com/actions/runner/issues/2341 means we |
||||||
|
# can't have both that *and* colored output. |
||||||
|
|
||||||
|
project-build: |
||||||
|
strategy: |
||||||
|
matrix: |
||||||
|
toolchain: |
||||||
|
- nightly-2023-01-13 |
||||||
|
- nightly |
||||||
|
continue-on-error: ${{ matrix.toolchain == 'nightly' }} |
||||||
|
runs-on: ubuntu-latest |
||||||
|
container: devkitpro/devkitarm |
||||||
|
steps: |
||||||
|
- name: Checkout branch |
||||||
|
uses: actions/checkout@v2 |
||||||
|
|
||||||
|
- uses: ./.github/actions/setup |
||||||
|
with: |
||||||
|
toolchain: ${{ matrix.toolchain }} |
||||||
|
|
||||||
|
- name: Hide duplicated warnings from lint job |
||||||
|
run: echo "::remove-matcher owner=clippy::" |
||||||
|
|
||||||
|
- name: Install cargo-3ds |
||||||
|
uses: actions-rs/cargo@v1 |
||||||
|
with: |
||||||
|
command: install |
||||||
|
args: --path . |
||||||
|
|
||||||
|
- name: Create new project |
||||||
|
run: cargo 3ds new app --bin |
||||||
|
|
||||||
|
- name: Build project |
||||||
|
working-directory: ./app |
||||||
|
run: cargo 3ds build --release |
Loading…
Reference in new issue