Skip to content

chore(ci): add GitHub CI #3

chore(ci): add GitHub CI

chore(ci): add GitHub CI #3

Workflow file for this run

on: [push, pull_request]
name: Build
env:
CARGO_TERM_COLOR: always
jobs:
fmt:
name: Check Code Format
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@master
- name: Install Rust nightly
uses: dtolnay/rust-toolchain@stable
with:
toolchain: nightly
components: rustfmt
- name: Run Rustfmt
run: cargo fmt -- --check
build:
name: Build and Test Project
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@master
- name: Install Rust nightly
uses: dtolnay/rust-toolchain@stable
with:
toolchain: nightly
components: clippy
- name: Cache Rust dependcies
uses: actions/cache@v2
with:
path: |
~/.cargo/registry
~/.cargo/git
target
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.toml') }}-${{ hashFiles('**/Cargo.lock') }}
restore-keys: |
${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.toml') }}-
${{ runner.os }}-cargo-
- name: Build
run: cargo build
- name: Build Release
run: cargo build --release
- name: Run Clippy
run: cargo clippy
- name: Run Unit Tests
run: cargo test