-
Notifications
You must be signed in to change notification settings - Fork 409
179 lines (142 loc) · 5.15 KB
/
dryrun.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
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
name: Package Build Dry Run
on:
workflow_dispatch:
inputs: {}
jobs:
prep:
runs-on: ubuntu-latest
outputs:
branch: ${{ steps.whichver.outputs.branch }}
if_ubuntu_noble_x86_64: ${{ steps.scm.outputs.if_ubuntu_noble_x86_64 }}
if_ubuntu_noble_aarch64: ${{ steps.scm.outputs.if_ubuntu_noble_aarch64 }}
steps:
- uses: actions/checkout@v4
- name: Determine package version
shell: bash
run: |
branch=${GITHUB_REF#refs/heads/}
echo branch="${branch}" >> $GITHUB_OUTPUT
id: whichver
- name: Determine SCM revision
id: scm
shell: bash
run: |
rev=$(git rev-parse HEAD)
jq_filter='.packages[] | select(.basename == "edgedb-server") | select(.architecture == $ARCH) | .version_details.metadata.scm_revision | . as $rev | select(($rev != null) and ($REV | startswith($rev)))'
val=true
idx_file=noble.nightly.json
if [ ! -e "/tmp/$idx_file" ]; then
curl --fail -s https://packages.edgedb.com/apt/.jsonindexes/$idx_file > /tmp/$idx_file
fi
out=$(cat /tmp/$idx_file | jq -r --arg REV "$rev" --arg ARCH "x86_64" "$jq_filter")
if [ -n "$out" ]; then
echo 'Skip rebuilding existing ubuntu-noble-x86_64'
val=false
fi
echo if_ubuntu_noble_x86_64="$val" >> $GITHUB_OUTPUT
val=true
idx_file=noble.nightly.json
if [ ! -e "/tmp/$idx_file" ]; then
curl --fail -s https://packages.edgedb.com/apt/.jsonindexes/$idx_file > /tmp/$idx_file
fi
out=$(cat /tmp/$idx_file | jq -r --arg REV "$rev" --arg ARCH "aarch64" "$jq_filter")
if [ -n "$out" ]; then
echo 'Skip rebuilding existing ubuntu-noble-aarch64'
val=false
fi
echo if_ubuntu_noble_aarch64="$val" >> $GITHUB_OUTPUT
build-ubuntu-noble-x86_64:
runs-on: ['package-builder', 'self-hosted', 'linux', 'x64']
needs: prep
if: needs.prep.outputs.if_ubuntu_noble_x86_64 == 'true'
steps:
- name: Build
uses: edgedb/edgedb-pkg/integration/linux/build/ubuntu-noble@master
env:
SRC_REF: "${{ needs.prep.outputs.branch }}"
PKG_REVISION: "<current-date>"
PKG_SUBDIST: "nightly"
PKG_PLATFORM: "ubuntu"
PKG_PLATFORM_VERSION: "noble"
EXTRA_OPTIMIZATIONS: "true"
METAPKG_GIT_CACHE: disabled
- uses: actions/upload-artifact@v4
with:
name: builds-ubuntu-noble-x86_64
path: artifacts/ubuntu-noble
build-ubuntu-noble-aarch64:
runs-on: ['package-builder', 'self-hosted', 'linux', 'arm64']
needs: prep
if: needs.prep.outputs.if_ubuntu_noble_aarch64 == 'true'
steps:
- name: Build
uses: edgedb/edgedb-pkg/integration/linux/build/ubuntu-noble@master
env:
SRC_REF: "${{ needs.prep.outputs.branch }}"
PKG_REVISION: "<current-date>"
PKG_SUBDIST: "nightly"
PKG_PLATFORM: "ubuntu"
PKG_PLATFORM_VERSION: "noble"
EXTRA_OPTIMIZATIONS: "true"
METAPKG_GIT_CACHE: disabled
- uses: actions/upload-artifact@v4
with:
name: builds-ubuntu-noble-aarch64
path: artifacts/ubuntu-noble
test-ubuntu-noble-x86_64:
needs: [build-ubuntu-noble-x86_64]
runs-on: ['package-builder', 'self-hosted', 'linux', 'x64']
steps:
- uses: actions/download-artifact@v4
with:
name: builds-ubuntu-noble-x86_64
path: artifacts/ubuntu-noble
- name: Test
uses: edgedb/edgedb-pkg/integration/linux/test/ubuntu-noble@master
env:
PKG_SUBDIST: "nightly"
PKG_PLATFORM: "ubuntu"
PKG_PLATFORM_VERSION: "noble"
PKG_PLATFORM_LIBC: ""
# edb test with -j higher than 1 seems to result in workflow
# jobs getting killed arbitrarily by Github.
PKG_TEST_JOBS: 0
test-ubuntu-noble-aarch64:
needs: [build-ubuntu-noble-aarch64]
runs-on: ['package-builder', 'self-hosted', 'linux', 'arm64']
steps:
- uses: actions/download-artifact@v4
with:
name: builds-ubuntu-noble-aarch64
path: artifacts/ubuntu-noble
- name: Test
uses: edgedb/edgedb-pkg/integration/linux/test/ubuntu-noble@master
env:
PKG_SUBDIST: "nightly"
PKG_PLATFORM: "ubuntu"
PKG_PLATFORM_VERSION: "noble"
PKG_PLATFORM_LIBC: ""
# edb test with -j higher than 1 seems to result in workflow
# jobs getting killed arbitrarily by Github.
PKG_TEST_JOBS: 0
workflow-notifications:
if: failure() && github.event_name != 'pull_request'
name: Notify in Slack on failures
needs:
- prep
- build-ubuntu-noble-x86_64
- test-ubuntu-noble-x86_64
- build-ubuntu-noble-aarch64
- test-ubuntu-noble-aarch64
runs-on: ubuntu-latest
permissions:
actions: 'read'
steps:
- name: Slack Workflow Notification
uses: Gamesight/slack-workflow-status@26a36836c887f260477432e4314ec3490a84f309
with:
repo_token: ${{secrets.GITHUB_TOKEN}}
slack_webhook_url: ${{secrets.ACTIONS_SLACK_WEBHOOK_URL}}
name: 'Workflow notifications'
icon_emoji: ':hammer:'
include_jobs: 'on-failure'