Init of Discord Rich Presence for Slippi #102
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Format and Test | |
on: | |
push: | |
branches: | |
- "**" | |
paths-ignore: | |
- "**.md" | |
pull_request: | |
branches: | |
- "**" | |
paths-ignore: | |
- "**.md" | |
jobs: | |
slprs_cargo_fmt: | |
name: Cargo Format | |
runs-on: ubuntu-latest | |
outputs: | |
rust_ver: ${{ steps.rust_ver.outputs.rust_ver }} | |
steps: | |
- uses: actions/checkout@v3 | |
- id: rust_ver | |
name: Grab Rust Version | |
run: echo "rust_ver=$(sed -rn 's/^channel = "(.*)"/\1/p' rust-toolchain.toml)" >> "$GITHUB_OUTPUT" | |
- uses: actions-rust-lang/setup-rust-toolchain@v1 | |
with: | |
toolchain: ${{ steps.rust_ver.outputs.rust_ver }} | |
components: rustfmt | |
- name: Rustfmt Check | |
uses: actions-rust-lang/rustfmt@v1 | |
slprs_cargo_test: | |
needs: slprs_cargo_fmt | |
name: Cargo Test on rust ${{ needs.slprs_cargo_fmt.outputs.rust_ver }} and ${{ matrix.os }} | |
runs-on: ${{ matrix.os }} | |
strategy: | |
fail-fast: false | |
matrix: | |
os: [ubuntu-latest, windows-latest, macOS-latest] | |
steps: | |
- name: Check out Git repository | |
uses: actions/checkout@v3 | |
- uses: actions-rust-lang/setup-rust-toolchain@v1 | |
with: | |
toolchain: ${{ needs.slprs_cargo_fmt.outputs.rust_ver }} | |
components: rustfmt | |
- name: "Install prerequisites" | |
if: matrix.os == 'ubuntu-latest' | |
shell: bash | |
run: | | |
sudo dpkg --add-architecture amd64 | |
sudo apt update | |
sudo apt install \ | |
libasound2-dev | |
- name: "Run cargo test" | |
run: cargo test --all --all-features --release |