-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathdevenv.nix
More file actions
117 lines (100 loc) · 2.34 KB
/
Copy pathdevenv.nix
File metadata and controls
117 lines (100 loc) · 2.34 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
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
{
pkgs,
lib,
config,
inputs,
...
}: {
packages = [
pkgs.alejandra
pkgs.ruff
pkgs.cocogitto
pkgs.git-cliff
pkgs.cmake
pkgs.gcc-arm-embedded-13
pkgs.ninja
pkgs.picotool
pkgs.ty
pkgs.pyrefly
];
languages.c.enable = true;
languages.cplusplus.enable = true;
languages.python = {
enable = true;
package = pkgs.python312;
uv.enable = true;
uv.sync.enable = true;
uv.sync.allExtras = true;
};
tasks = let
uv_run = "${pkgs.uv}/bin/uv run";
in {
"check:fast-tests" = {
exec = ''
${uv_run} coverage run
${uv_run} coverage xml
'';
};
"check:types" = {
exec = ''
${uv_run} pyrefly check 'src/**/*.py*' 'tests/**/*.py*'
${uv_run} ty check
'';
before = ["check:code-lint"];
};
"check:python-lint" = {
exec = "${uv_run} ruff check";
before = ["check:code-lint"];
};
"check:commit-lint" = {
exec = ''
if $CI; then
${pkgs.cocogitto}/bin/cog check ..$GITHUB_SOURCE_REF
else
${pkgs.cocogitto}/bin/cog check --from-latest-tag --ignore-merge-commits
fi
'';
};
"check:formatting" = {
exec = "${uv_run} ruff format --check";
before = ["check:code-lint"];
};
"check:architecture" = {
exec = "${uv_run} tach check";
before = ["check:code-lint"];
};
"package:build" = {
exec = "${pkgs.uv}/bin/uv build";
};
"check:code-lint" = {
};
"check:unit_tests_python" = {
exec = ''
${uv_run} python -m pytest tests/unit
'';
};
"check:integration_tests" = {
exec = ''
${uv_run} python -m pytest tests/integration
'';
};
"check:unit_tests_c" = {
exec = ''
cd example-firmwares/remote_control
ctest --preset host-unit
'';
};
"check:system_tests" = {
exec = ''
${uv_run} python -m pytest tests/system/test_remote_control.py -m "not hardware" -s -cli-log-level=debug
'';
};
"check:tests" = {
exec = ''
${uv_run} coverage erase
${uv_run} coverage run -m pytest tests/unit tests/integration tests/system/test_remote_control.py -m "not hardware"
${uv_run} coverage xml -o coverage.xml
'';
};
};
}