-
Notifications
You must be signed in to change notification settings - Fork 111
189 lines (181 loc) · 5.55 KB
/
nightly-build.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
180
181
182
183
184
185
186
187
188
189
name: Bundle
on:
push:
branches:
- master
pull_request:
schedule:
- cron: "0 0 * * *"
workflow_dispatch:
jobs:
build:
strategy:
matrix:
os:
- ubuntu-20.04
- ubuntu-22.04
- windows-2022
- macos-12
fail-fast: false
name: Build on ${{ matrix.os }}
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v4
with:
python-version: "3.11"
- run: |
sudo apt-get update;
sudo apt-get install -y \
libfuse2 \
libegl1 \
libxkbcommon-x11-0 \
libxcb-cursor0 \
libxcb-icccm4 \
libxcb-image0 \
libxcb-keysyms1 \
libxcb-randr0 \
libxcb-render-util0 \
libxcb-shape0
if: startsWith(matrix.os, 'ubuntu')
- run: |
call "C:\Program Files\Microsoft Visual Studio\2022\Enterprise\VC\Auxiliary\Build\vcvars64.bat"
bash .github\workflows\nightly-build.sh
shell: cmd
if: startsWith(matrix.os, 'windows')
- run: bash .github/workflows/nightly-build.sh
if: startsWith(matrix.os, 'ubuntu') || startsWith(matrix.os, 'macos')
- uses: actions/upload-artifact@v3
with:
name: angr-management-${{ matrix.os }}
path: |
upload/*.tar.gz
upload/*.zip
upload/*.dmg
test_ubuntu:
strategy:
matrix:
os:
- ubuntu-20.04
- ubuntu-22.04
fail-fast: false
name: Test on ${{ matrix.os }}
needs: build
runs-on: ${{ matrix.os }}
steps:
- run: sudo apt-get update && sudo apt-get install -y xvfb x11-utils libegl1
name: Install X11 app testing utilities
- uses: actions/download-artifact@v3
with:
name: angr-management-${{ matrix.os }}
- run: |
set -x
. /etc/os-release
tar -xzf angr-management-ubuntu-$VERSION_ID.tar.gz
export binary="./angr-management/angr-management"
export QT_DEBUG_PLUGINS=1
chmod +x $binary
xvfb-run bash -x -c '
$binary &
sleep 30 && output=$(xwininfo -tree -root)
[[ "$output" == *"angr management"* ]] || exit 1
'
test_windows:
strategy:
matrix:
os:
- windows-2022
fail-fast: false
name: Test on ${{ matrix.os }}
needs: build
runs-on: ${{ matrix.os }}
steps:
- uses: actions/download-artifact@v3
with:
name: angr-management-${{ matrix.os }}
- run: |
7z x angr-management-win64.zip
.\angr-management\angr-management.exe
sleep 30
[array]$am_windows = Get-Process |
Where-Object {$_.MainWindowTitle -ne ""} |
Select-Object MainWindowTitle |
where {$_ -match 'angr management'}
if ($am_windows.Length -ne 1) {
echo "Number of open angr management windows" $am_windows.Length
exit 1
}
test_macos:
strategy:
matrix:
os:
- macos-12
fail-fast: false
name: Test on ${{ matrix.os }}
needs: build
runs-on: ${{ matrix.os }}
steps:
- uses: actions/download-artifact@v3
with:
name: angr-management-${{ matrix.os }}
- run: |
set -x
hdiutil attach -mountroot /tmp/am-mount ./angr-management-macOS.dmg
open /tmp/am-mount/*/*.app
sleep 30
windows=$(osascript -e '
tell application "System Events" to get (name of every window of processes whose name contains "angr management") as string
')
if [ "$windows" == "" ]; then
exit 1
fi
deploy:
name: Deploy release
needs:
- test_ubuntu
- test_windows
- test_macos
runs-on: ubuntu-22.04
if: ${{ github.event_name == 'schedule' }}
steps:
- name: Download artifacts
uses: actions/download-artifact@v3
- name: Run find
run: find .
- name: Delete old nightly
run: gh release -R angr/angr-management delete nightly --cleanup-tag --yes
env:
GH_TOKEN: ${{ github.token }}
continue-on-error: true
- name: Make new release
run: >
gh release create nightly \
--repo angr/angr-management \
--title "angr management nightly preview" \
--notes "$RELEASE_NOTES" \
--prerelease \
--target $GITHUB_SHA \
$(find . -type f)
env:
RELEASE_NOTES: >
This release is an automatically generated pre-release. We do our
best to make sure everything works, but please be advised that
features may break or change without notice.
GH_TOKEN: ${{ github.token }}
report:
name: Report status
needs: deploy
runs-on: ubuntu-22.04
if: ${{ github.event_name == 'schedule' && failure() }}
steps:
- name: Send result email
env:
MAILGUN_API_TOKEN: ${{ secrets.MAILGUN_API_TOKEN }}
run: |
BUILD_URL="https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}"
curl -s --user "api:$MAILGUN_API_TOKEN" \
https://api.mailgun.net/v3/mail.rev.fish/messages \
-F from="angr management bundle <[email protected]>" \
-F [email protected] \
-F subject="angr management nightly bundle failed" \
-F text="Link to failed build: $BUILD_URL"