-
Notifications
You must be signed in to change notification settings - Fork 11
37 lines (35 loc) · 1 KB
/
rust.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
name: Rust
on: [ push, workflow_dispatch ]
env:
CARGO_TERM_COLOR: always
jobs:
build_and_test:
name: Build and Test Maelstrom
runs-on: ubuntu-latest
steps:
- name: Get Repository from Git
uses: actions/checkout@v3
- name: Install Nix
uses: DeterminateSystems/nix-installer-action@main
- name: Set up Nix Cache
uses: DeterminateSystems/magic-nix-cache-action@main
- name: Check Nixpkgs Inputs
uses: DeterminateSystems/flake-checker-action@main
with:
fail-mode: true
- name: Set up Rust Cache
uses: actions/cache@v3
with:
path: |
~/.cargo/bin/
~/.cargo/registry/index/
~/.cargo/registry/cache/
~/.cargo/git/db/
target/
key: maelstrom-${{ hashFiles('**/Cargo.lock') }}
- name: Check Rust Formatting
run: nix develop --command cargo fmt --check
- name: Test Rust Code
run: nix develop --command cargo test
- name: Build Rust Code
run: nix build