name: Build Test and deploy
run-name: ${{ github.actor }} is building and testing the emulator!
on: [push]
env:
CARGO_TERM_COLOR: always jobs:
lint:
runs-on: ubuntu-latest
container:
image: rust:latest
steps:
- name: Checkout Code
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Cache Rust build
uses: Swatinem/rust-cache@v2
- name: Install Rust components
run: rustup component add clippy rustfmt
- name: Pass linter
run: |
cargo clippy -- -Dwarnings
- name: Check formatting
run: |
cargo fmt --check
build:
needs: [lint]
runs-on: ubuntu-latest
container:
image: rust:latest
steps:
- name: Checkout Code
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Cache Rust build
uses: Swatinem/rust-cache@v2
- name: Install Rust components
run: rustup component add clippy rustfmt
- name: Build source
run: cargo build --all-targets
- name: Test source
run: cargo test