-
Notifications
You must be signed in to change notification settings - Fork 0
41 lines (41 loc) · 1.39 KB
/
build.yaml
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
# Workflow to build the repo, run tests, and push the binaries to Cachix
name: Build repo and run tests
on:
push:
# no point rebuilding if the code doesn't change
paths:
- "software/**"
- "flake.nix"
- "flake.lock"
# ignore script updates
- "!software/scripts/**"
- "!software/ros_ws/colcon/**"
# we don't care about package.xml updates since they don't affect the nix build,
# we only care about it when the nix files get updated
- "!software/ros_ws/**/package.xml"
# launch files don't affect the tests
- "!software/ros_ws/**/launch/**"
# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:
jobs:
run-build:
concurrency:
group: "build"
cancel-in-progress: true
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: nixbuild/nix-quick-install-action@v29
- uses: DeterminateSystems/magic-nix-cache-action@main
- name: Build repository
run: nix build -L
- name: Run flake checks
run: nix flake check -L
- name: Upload build to Cachix
run: nix run -L .#scripts.cachix.build
- name: Test dev shell
run: nix develop -L -c echo 'Shell test success'
- name: Upload dev shell to Cachix
run: nix run -L .#scripts.cachix.shell
env:
CACHIX_AUTH_TOKEN: ${{ secrets.CACHIX_AUTH_TOKEN }}