-
Notifications
You must be signed in to change notification settings - Fork 0
148 lines (133 loc) · 3.98 KB
/
nightly.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
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
on:
schedule:
- cron: '0 0 * * *'
workflow_dispatch:
push:
# Cancel previous versions of this job that are still running.
concurrency:
group: nightly
cancel-in-progress: true
jobs:
update-flake:
runs-on: [self-hosted, linux, nix]
steps:
- name: checkout
uses: actions/checkout@v4
- name: update
run: ./update.sh
# Commit the update onto a new branch
- name: commit
run: |
[[ $(git diff) != "" ]] || exit 0
git config --local user.name "Prosecco"
git config --local user.email "[email protected]"
git checkout -b nightly
git commit -am "nightly update"
git push origin --force nightly:nightly
# This would be nicer as a matrix, but that hits limits of what github actions can currenctly express. See e.g.:
# - https://github.com/orgs/community/discussions/17245
# - https://github.com/orgs/community/discussions/26640
# - https://github.com/actions/runner/pull/2477
hax:
needs: update-flake
runs-on: [self-hosted, linux, nix]
steps:
- name: checkout
uses: actions/checkout@v4
with:
ref: nightly
# - run: nix build -L --no-link ".#hax"
- run: true
charon:
needs: update-flake
runs-on: [self-hosted, linux, nix]
steps:
- name: checkout
uses: actions/checkout@v4
with:
ref: nightly
# - run: nix build -L --no-link ".#charon"
- run: true
eurydice:
needs: update-flake
runs-on: [self-hosted, linux, nix]
steps:
- name: checkout
uses: actions/checkout@v4
with:
ref: nightly
# - run: nix build -L --no-link ".#eurydice"
- run: false
ml-kem:
needs: update-flake
runs-on: [self-hosted, linux, nix]
steps:
- name: checkout
with:
ref: nightly
uses: actions/checkout@v4
# - run: nix build -L --no-link ".#ml-kem"
- run: false
bertie:
needs: update-flake
runs-on: [self-hosted, linux, nix]
steps:
- name: checkout
with:
ref: nightly
uses: actions/checkout@v4
# - run: nix build -L --no-link ".#bertie"
- run: true
success:
needs: [hax, charon, eurydice, ml-kem, bertie]
runs-on: [self-hosted, linux, nix]
steps:
- name: checkout
uses: actions/checkout@v4
with:
ref: nightly
- name: commit the good flake.lock
run: |
[[ $(git diff) != "" ]] || exit 0
git config --local user.name "Prosecco"
git config --local user.email "[email protected]"
cp flake.lock good.lock
git commit -am "record the last-good flake lock"
git push
complete:
needs: [hax, charon, eurydice, ml-kem, bertie, success]
runs-on: [self-hosted, linux, nix]
if: ${{ success() || failure() }} # Will always run unless canceled
steps:
- name: checkout
uses: actions/checkout@v4
with:
ref: nightly
- name: generate zulip message
env:
RUN: ${{ github.run_id }}
RESULTS: ${{ toJSON(needs) }}
run: |
echo "$RESULTS" > results.json
{
echo 'MSG<<EOF'
nix shell nixpkgs#jq --command ./message.sh
echo EOF
} >> "$GITHUB_ENV"
rm results.json
cat "$GITHUB_ENV"
# - name: send zulip info message
# uses: slackapi/[email protected]
# with:
# payload: |
# { "text": ${{ toJSON(env.MSG) }} }
# env:
# SLACK_WEBHOOK_URL: ${{ secrets.ZULIP_WEBHOOK_URL }}
# - name: send zulip error message
# if: ${{ failure() }}
# uses: slackapi/[email protected]
# with:
# payload: |
# { "text": "Unexpected Error: ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}" }
# env:
# SLACK_WEBHOOK_URL: ${{ secrets.ZULIP_WEBHOOK_URL }}