map v3 #180
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: Rust | |
on: | |
push: | |
pull_request: | |
release: | |
types: [released] | |
jobs: | |
test_pc: | |
strategy: | |
matrix: | |
os: [ubuntu, windows] | |
name: "test ${{ matrix.os }}" | |
continue-on-error: true | |
runs-on: ${{ matrix.os }}-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Install SDL2 Linux | |
if: ${{ matrix.os == 'ubuntu' }} | |
run: sudo apt-get update && sudo apt-get install -y libsdl2-dev | |
- uses: dtolnay/rust-toolchain@stable | |
id: "rust-toolchain" | |
- uses: actions/cache@v3 | |
with: | |
path: | | |
~/.cargo/git | |
~/.cargo/registry | |
target | |
key: "PC ${{runner.os}} Rust ${{steps.rust-toolchain.outputs.cachekey}} Lock ${{hashFiles('Cargo.lock')}}" | |
- run: cargo test --all-features -p m3-models | |
env: | |
RUST_BACKTRACE: 1 | |
- run: cargo test --features sdl2_bundled -p m3-pc -p m3-map -p m3-macro | |
if: ${{ matrix.os == 'windows' }} | |
env: | |
RUST_BACKTRACE: 1 | |
- run: cargo test -p m3-pc | |
if: ${{ matrix.os != 'windows' }} | |
env: | |
RUST_BACKTRACE: 1 | |
check_pybadge: | |
runs-on: ubuntu-latest | |
name: "check pybadge" | |
steps: | |
- uses: actions/checkout@v3 | |
- uses: dtolnay/rust-toolchain@stable | |
id: "rust-toolchain" | |
with: | |
targets: thumbv7em-none-eabihf | |
- uses: actions/cache@v3 | |
with: | |
path: | | |
~/.cargo/git | |
~/.cargo/registry | |
target | |
key: "Pybadge ${{runner.os}} Rust ${{steps.rust-toolchain.outputs.cachekey}} Lock ${{hashFiles('Cargo.lock')}}" | |
- name: cargo check models | |
run: cargo check --all-features --target thumbv7em-none-eabihf -p m3-models | |
env: | |
RUST_BACKTRACE: 1 | |
- name: cargo check pybadge | |
run: cargo check --all-features -p m3-pybadge | |
working-directory: pybadge | |
env: | |
RUST_BACKTRACE: 1 | |
rustfmt: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- uses: dtolnay/rust-toolchain@nightly | |
with: | |
components: rustfmt | |
- run: cargo fmt --all -- --check | |
cargo_publish: | |
if: ${{ github.event_name == 'release' }} | |
needs: [test_pc, check_pybadge] | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Install SDL2 | |
run: sudo apt-get update && sudo apt-get install -y libsdl2-dev | |
- uses: dtolnay/rust-toolchain@stable | |
- uses: msrd0/cargo-publish-action@v1 | |
with: | |
packages: TODO | |
env: | |
CARGO_REGISTRY_TOKEN: ${{ secrets.CARGO_REGISTRY_TOKEN }} |