Skip to content

unjank ci and nightly rust in general #268

unjank ci and nightly rust in general

unjank ci and nightly rust in general #268

Workflow file for this run

name: CI # Continuous Integration
on:
push:
branches:
- main
pull_request:
jobs:
test:
name: Run [${{ matrix.action }} | ${{ matrix.config.name }}]
runs-on: ${{ matrix.config.os }}
strategy:
fail-fast: false
matrix:
action:
- build
# - test
config:
- { name: Linux (x86), os: ubuntu-latest, target: "x86_64-unknown-linux-gnu" }
- { name: Linux (ARM), os: ubuntu-latest, target: "aarch64-unknown-linux-gnu" }
- { name: MacOS (x86), os: macos-latest, target: "x86_64-apple-darwin" }
- { name: MacOS (ARM), os: macos-latest, target: "aarch64-apple-darwin" }
- { name: Windows (x86), os: windows-latest, target: "x86_64-pc-windows-msvc" }
steps:
- name: get cmake
uses: lukka/get-cmake@latest
- name: Install LLVM and Clang on mac
if: ${{ (matrix.config.target == 'x86_64-apple-darwin') || (matrix.config.target == 'aarch64-apple-darwin') }}
uses: KyleMayes/install-llvm-action@v1
with:
version: "13"
- name: Install LLVM and Clang
if: ${{ (matrix.config.target != 'x86_64-apple-darwin') && (matrix.config.target != 'aarch64-apple-darwin') }}
uses: KyleMayes/install-llvm-action@v1
with:
version: "16"
- name: Checkout repository
uses: actions/checkout@v4
with:
submodules: true
targets: ${{ matrix.config.target }}
- name: Setup aarch64
if: matrix.config.target == 'aarch64-unknown-linux-gnu'
run: |
sudo apt update
sudo apt install gcc-aarch64-linux-gnu
echo "[target.aarch64-unknown-linux-gnu]" >> ~/.cargo/config
echo "linker = \"aarch64-linux-gnu-gcc\"" >> ~/.cargo/config
- name: Install Rust toolchain
uses: dtolnay/rust-toolchain@nightly
- uses: Swatinem/rust-cache@v2
- name: Build ymfm rust dingdong win # separate step so I can see earlier if CI fails..
if: matrix.config.target == 'x86_64-pc-windows-msvc'
run: |
cd brainworms_farting_noises/libymfm.wasm
git submodule init
git submodule update
cmake -G "Visual Studio 17 2022" -T ClangCL -S . -B build
cmake --build build --parallel $(nproc)
cd ../..
- name: Build ymfm rust dingdong not win # separate step so I can see earlier if CI fails..
if: matrix.config.target != 'x86_64-pc-windows-msvc'
run: |
cd brainworms_farting_noises/libymfm.wasm
git submodule init
git submodule update
cmake -S . -B build
cmake --build build --parallel $(nproc)
cd ../..
- name: Build
if: matrix.action == 'build'
run: cargo build --workspace --release
# run: cargo build --all-features --workspace --release
# - name: Test
# if: matrix.action == 'test'
# run: cargo test --all-features --workspace
rustfmt:
name: Rustfmt
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
submodules: true
- name: Install Rust toolchain
uses: dtolnay/rust-toolchain@nightly
with:
components: rustfmt
- uses: Swatinem/rust-cache@v2
- name: Check formatting
run: |
sudo apt install cmake clang
cd brainworms_farting_noises/libymfm.wasm
git submodule init
git submodule update
cmake -DCMAKE_TOOLCHAIN_FILE=./cmake/x86-64.cmake -S . -B build
cmake --build build --parallel $(nproc)
cd ../..
cargo fmt --all --check
clippy:
name: Clippy
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
submodules: true
- name: Install Rust toolchain
uses: dtolnay/rust-toolchain@nightly
with:
components: clippy
- uses: Swatinem/rust-cache@v2
- name: Clippy check
run: |
sudo apt install cmake clang
cd brainworms_farting_noises/libymfm.wasm
git submodule init
git submodule update
cmake -DCMAKE_TOOLCHAIN_FILE=./cmake/x86-64.cmake -S . -B build
cmake --build build --parallel $(nproc)
cd ../..
cargo clippy --workspace
# cargo clippy --all-features --workspace
# docs:
# name: Docs
# runs-on: ubuntu-latest
# steps:
# - name: Checkout repository
# uses: actions/checkout@v4
# with:
# submodules: true
# - name: Install Rust toolchain
# uses: dtolnay/rust-toolchain@nightly
# - uses: Swatinem/rust-cache@v2
# - name: Check documentation
# env:
# RUSTDOCFLAGS: -D warnings
# run: cargo doc --no-deps --document-private-items --all-features --workspace
hack:
name: Check
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
submodules: true
- name: Install nightly
uses: dtolnay/rust-toolchain@nightly
- name: cargo install cargo-hack
uses: taiki-e/install-action@cargo-hack
- uses: Swatinem/rust-cache@v2
- name: Check for all features
run: |
sudo apt install cmake clang
cd brainworms_farting_noises/libymfm.wasm
git submodule init
git submodule update
cmake -DCMAKE_TOOLCHAIN_FILE=./cmake/x86-64.cmake -S . -B build
cmake --build build --parallel $(nproc)
cd ../..
cargo hack --feature-powerset check
# wasm:
# name: Wasm
# runs-on: ubuntu-latest
# steps:
# - uses: actions/checkout@v4
# with:
# submodules: true
# - name: Install nightly
# uses: dtolnay/rust-toolchain@nightly
# with:
# target: wasm32-unknown-unknown
# - uses: Swatinem/rust-cache@v2
# - name: Check for target wasm webgpu
# env:
# RUSTFLAGS: --cfg=web_sys_unstable_apis
# run: cargo check --target wasm32-unknown-unknown
# - name: Check for target wasm webgl
# run: cargo check --target wasm32-unknown-unknown --features webgl