-
Notifications
You must be signed in to change notification settings - Fork 1
65 lines (62 loc) · 1.68 KB
/
main.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
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
# yaml-language-server: $schema=https://raw.githubusercontent.com/SchemaStore/schemastore/master/src/schemas/json/github-workflow.json
# Our desired pipeline using only a Nix shell environment
name: Check and build
on:
push:
branches:
- main
tags:
- "v*.*.*"
pull_request:
branches:
- main
jobs:
check_nix:
name: Check Ray tracing
runs-on: ubuntu-22.04
steps:
- name: git checkout
uses: actions/checkout@v3
- name: Install Nix
uses: DeterminateSystems/nix-installer-action@main
# Nix-specific logic begins here
- name: Check Rust formatting
run: |
nix develop --command \
cargo fmt --check
- name: Audit Rust code
run: |
nix develop --command \
cargo-deny check
- name: Check spelling
run: |
nix develop --command \
codespell \
--skip target,.git \
--ignore-words-list crate
build_and_test_nix:
name: Test and build Ray Tracer
needs: check_nix
strategy:
matrix:
os: [ubuntu-22.04, macos-12]
runs-on: ubuntu-22.04
steps:
- name: git checkout
uses: actions/checkout@v3
- name: Install Nix
uses: DeterminateSystems/nix-installer-action@main
- name: Set up Rust cache
uses: actions/cache@v3
with:
path: |
~/.cargo/bin/
~/.cargo/registry/index/
~/.cargo/registry/cache/
~/.cargo/git/db/
target/
key: ray-tracer-${{ hashFiles('**/Cargo.lock') }}
- name: Test
run: |
nix develop --command \
cargo test