-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.gitlab-ci.yml
104 lines (89 loc) · 2.02 KB
/
.gitlab-ci.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
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
stages:
- build
- test
- style
workflow:
rules:
- if: $CI_PIPELINE_SOURCE == "push" || $CI_PIPELINE_SOURCE == "schedule"
variables:
GIT_DEPTH: 0
CACHIX_NAME: nixturris
.nix:
image: registry.gitlab.com/cynerd/gitlab-ci-nix
tags:
- docker
rules:
- if: $CI_PIPELINE_SOURCE == "push"
cache:
key: "nix"
paths:
- ".nix-cache"
before_script:
- gitlab-ci-nix-cache-before
after_script:
- gitlab-ci-nix-cache-after
## Build stage #################################################################
.build:
stage: build
extends: .nix
rules:
- if: $CI_PIPELINE_SOURCE == "push"
- if: $CI_PIPELINE_SOURCE == "schedule"
allow_failure: true
script:
- echo 'auto-allocate-uids = false' >> /etc/nix/nix.conf
- "[ \"$CI_PIPELINE_SOURCE\" != 'schedule' ] || nix flake update"
- nix build --log-lines 1000 .#$ARG
- cp result/tarball/* .
build:tarballMox:
extends: .build
variables:
ARG: tarballMox
artifacts:
expose_as: 'Installation Tarball Mox'
paths:
- nixos-system-aarch64-linux.tar.xz
build:tarballOmnia:
extends: .build
variables:
ARG: tarballOmnia
artifacts:
expose_as: 'Installation Tarball Omnia'
paths:
- nixos-system-armv7l-linux.tar.xz
# TODO build in libvirtd or something to test also native build
## Test stage ##################################################################
.test:
stage: test
extends: .nix
needs: []
nix-check:
stage: test
extends: .test
script:
- nix flake check
statix:
stage: test
extends: .test
script:
- nix run .#statix -- check .
## Style stage #################################################################
.style:
stage: style
extends: .nix
needs: []
allow_failure: true
nixfmt:
extends: .style
script:
- nix fmt
- git diff --exit-code
deadnix:
extends: .style
script:
- nix run .#deadnix -- -f .
gitlint:
extends: .style
script:
- git fetch
- nix run --quiet .#gitlint -- --commits origin/master..$CI_COMMIT_SHA