-
Notifications
You must be signed in to change notification settings - Fork 1
60 lines (47 loc) · 1.57 KB
/
Copy pathrust.yml
File metadata and controls
60 lines (47 loc) · 1.57 KB
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
name: Rust
on:
push:
branches:
- main
pull_request:
branches:
- main
env:
CARGO_TERM_COLOR: always
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: ${{ github.event_name == 'pull_request' }}
jobs:
build:
runs-on: ubuntu-latest
timeout-minutes: 30
defaults:
run:
shell: devenv shell bash -- -e {0}
steps:
- name: Checkout
uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3
- name: Install Nix
uses: cachix/install-nix-action@8aa03977d8d733052d78f4e008a241fd1dbf36b3 # v31.10.6
- name: Set up devenv cache
uses: cachix/cachix-action@3ba601ff5bbb07c7220846facfa2cd81eeee15a1 # v16
with:
name: devenv
- name: Install devenv
shell: bash
run: nix profile add nixpkgs#devenv
# The Rust toolchain comes from the Nix rust-overlay, so cargo/rustc are
# only on PATH inside `devenv shell`. Expose their bin dir to subsequent
# action steps so rust-cache can probe the toolchain for its cache key.
- name: Expose Rust toolchain to GitHub PATH
run: dirname "$(command -v cargo)" >> "$GITHUB_PATH"
- name: Cache Rust build
uses: Swatinem/rust-cache@42dc69e1aa15d09112580998cf2ef0119e2e91ae # v2.9.1
with:
workspaces: lambda
cache-on-failure: true
save-if: ${{ github.ref == 'refs/heads/main' }}
- name: Build
run: cd lambda && cargo lambda build --arm64
- name: Run tests
run: cd lambda && cargo test