Repository navigation
70 lines (69 loc) · 2.41 KB
/
Copy pathnox.yml
File metadata and controls
70 lines (69 loc) · 2.41 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
61
62
63
64
65
66
67
68
69
70
name: nox
# The nixos branch manages the Python environment with uv2nix (pyproject.toml +
# uv.lock) instead of nox + requirements*.txt. This runs the ruff, mypy and
# pytest checks in the flake dev shell, the same Nix environment that
# developers and the PiFinder use. The workflow keeps upstream's "nox" name so
# PR check wiring stays identical across branches.
#
# Run on pushes to the long-lived branches and on pull requests. Restricting
# `push` to those branches means a push to a feature branch with an open PR only
# triggers the `pull_request` run (not also a `push` run), so a PR gets a single
# run per push instead of two.
#
# On a push, a job that passes puts its dev shell in the PiFinder cache, so
# developers and later jobs download the shell and do not build it.
on:
push:
branches:
- main
- nixos
- release
pull_request:
permissions:
contents: read
jobs:
nox:
# aarch64, like the PiFinder.
runs-on: ubuntu-24.04-arm
timeout-minutes: 30
defaults:
run:
working-directory: ./python
steps:
- uses: actions/checkout@v4
- uses: ./.github/actions/setup-nix
with:
attic-token: ${{ github.event_name == 'push' && secrets.ATTIC_TOKEN || '' }}
- name: Build dev shell
run: nix develop ..#default -c true
- name: Lint and format check
run: scripts/check.sh lint
- name: Type check
run: scripts/check.sh types
- name: Smoke tests
run: scripts/check.sh smoke
- name: Unit tests
run: scripts/check.sh unit
- name: Integration tests
run: scripts/check.sh integration
- name: Push dev shell to the cache
if: github.event_name == 'push'
working-directory: .
run: .github/scripts/push_dev_shell.sh aarch64-linux
# Developer desktops are x86. This job puts the x86 dev shells in the cache
# after the checks pass, so a desktop downloads libcamera and the Python
# environment and does not build them.
dev-shell-x86:
needs: nox
if: github.event_name == 'push'
runs-on: ubuntu-latest
timeout-minutes: 90
steps:
- uses: actions/checkout@v4
- uses: ./.github/actions/setup-nix
with:
attic-token: ${{ secrets.ATTIC_TOKEN }}
- name: Push dev shells to the cache
run: |
.github/scripts/push_dev_shell.sh x86_64-linux
.github/scripts/push_dev_shell.sh x86_64-linux web