forked from kamadorueda/alejandra
-
Notifications
You must be signed in to change notification settings - Fork 1
/
buildkite.yaml
100 lines (87 loc) · 2.94 KB
/
buildkite.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
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
steps:
- label: build
if: build.branch == "main"
agents:
queue: private
artifacts:
- alejandra-*
command:
- echo +++
- nix build .#alejandra-binaries
- nix-store
--query
--include-outputs $(nix-store --query --deriver result)
--requisites |
grep -v '\.drv$$' |
cachix push alejandra
- cp -L result/* .
- label: coverage
if: build.branch == "main"
agents:
queue: private
command:
- echo +++ Fetch
- git branch -D main
- git branch main
- git checkout main
- echo --- Load environment
- direnv allow
- eval "$(direnv export bash)"
- echo +++ Run tests
- cd src/alejandra
- cargo tarpaulin --coveralls "${COVERALLS_REPO_TOKEN}"
- label: formatting diff
if: build.branch != "main"
artifacts:
- formatting-before-vs-after.patch.txt
- formatting-after.patch.txt
command:
- echo +++ Formatting - demo
- nix run . -- flake.nix
- echo --- Cloning nixpkgs
- git config --global user.email CI/CD
- git config --global user.name CI/CD
- git clone --branch=master --depth 1 --origin=upstream file:///data/nixpkgs
- echo --- Formatting - before
- nix --tarball-ttl 1 run github:kamadorueda/alejandra -- nixpkgs 2>/dev/null
- git -C nixpkgs add .
- git -C nixpkgs commit -m formatting-before -q
- git -C nixpkgs branch formatting-before
- git -C nixpkgs reset --hard master~1
- echo --- Formatting - after
- nix run . -- nixpkgs 2>/dev/null
- git -C nixpkgs diff formatting-before > formatting-before-vs-after.patch.txt
- label: closure diff
if: build.branch != "main"
artifacts:
- closure-before.txt
- closure-after.txt
- closure-before-vs-after.patch.txt
command:
- git config --global user.email CI/CD
- git config --global user.name CI/CD
- git clone --branch=master --depth 1 --origin=upstream file:///data/nixpkgs
- echo --- Closure @ before
- nix-env --query --available --attr-path --drv-path --file nixpkgs --xml > closure-before.txt
- echo --- Formatting
- nix run . -- nixpkgs 2>/dev/null
- echo --- Closure @ after
- nix-env --query --available --attr-path --drv-path --file nixpkgs --xml > closure-after.txt
- echo +++ Closure diff
- git diff --no-index closure-before.txt closure-after.txt > closure-before-vs-after.patch.txt || true
- git diff --no-index closure-before.txt closure-after.txt --shortstat || true
- echo +++ Derivations count
- grep -c drvPath= closure-after.txt
- label: lint
if: build.branch != "main"
command:
- echo --- Load environment
- direnv allow
- eval "$(direnv export bash)"
- echo +++ Run Linter
- cargo clippy
- label: flake check
if: build.branch != "main"
command:
- echo +++
- nix flake check