Repository navigation
212 lines (203 loc) · 7.49 KB
/
Copy pathbuild-oqs.yml
File metadata and controls
212 lines (203 loc) · 7.49 KB
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
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
name: build-oqs
on:
workflow_dispatch:
pull_request:
paths:
- '.github/workflows/build-oqs.yml'
- 'apothecary/formulas/liboqs/**'
- 'apothecary/formulas/oqsprovider/**'
- 'apothecary/formulas/openssh/**'
- 'scripts/tests/oqs/**'
- 'scripts/tests/test-package-platforms.sh'
- 'scripts/build-modular-optional.sh'
- 'scripts/package-individual.sh'
- 'scripts/package-platform.sh'
- 'scripts/calculate_formulas.sh'
- 'scripts/modular-cache-key.sh'
- 'scripts/cache-toolchain.sh'
- 'scripts/secure.sh'
- 'scripts/osx/install.sh'
- 'scripts/apple-install-tools.sh'
- 'scripts/check-apple-sdk.sh'
- 'scripts/test-openframeworks-libraries.sh'
push:
branches: [bleeding, master]
paths:
- '.github/workflows/build-oqs.yml'
- 'apothecary/formulas/liboqs/**'
- 'apothecary/formulas/oqsprovider/**'
- 'apothecary/formulas/openssh/**'
- 'scripts/tests/oqs/**'
- 'scripts/tests/test-package-platforms.sh'
- 'scripts/build-modular-optional.sh'
- 'scripts/package-individual.sh'
- 'scripts/package-platform.sh'
- 'scripts/calculate_formulas.sh'
- 'scripts/modular-cache-key.sh'
- 'scripts/cache-toolchain.sh'
- 'scripts/secure.sh'
- 'scripts/osx/install.sh'
- 'scripts/apple-install-tools.sh'
- 'scripts/check-apple-sdk.sh'
- 'scripts/test-openframeworks-libraries.sh'
concurrency:
group: ${{ github.workflow }}-${{ startsWith(github.ref, 'refs/tags/') && github.run_id || github.event.pull_request.number || github.ref }}
cancel-in-progress: ${{ !startsWith(github.ref, 'refs/tags/') }}
permissions:
contents: write
env:
BUILD_PROFILE_ID: "2"
jobs:
test:
permissions:
contents: read
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v7.0.1
- run: bash -n apothecary/formulas/liboqs/liboqs.sh
- run: bash -n apothecary/formulas/oqsprovider/oqsprovider.sh
- run: bash -n apothecary/formulas/openssh/openssh.sh
- run: bash -n scripts/package-individual.sh
- run: bash -n scripts/build-modular-optional.sh
- run: bash scripts/tests/test-package-platforms.sh
- run: ruby scripts/tests/test-workflow-scheduling.rb
- run: bash -n scripts/tests/oqs/generate-ofx-addon.sh
- run: bash -n scripts/tests/oqs/test-ofx-addon.sh
- run: bash -n scripts/tests/oqs/install-ofx-addon.sh
osx:
needs: test
name: optional oqs-osx
runs-on: macos-15
env:
TARGET: osx
TYPE: osx
OPTIONAL_ARCHS: x86_64 arm64
PACKAGE_LIBS: liboqs oqsprovider openssh
ALWAYS_BUILD: 1
NO_FORCE: 1
steps:
- uses: actions/checkout@v7.0.1
- name: Install
run: |
./scripts/osx/install.sh
echo "$(brew --prefix)/bin" >> "$GITHUB_PATH"
- name: Ensure Ninja is available for the cache fingerprint
run: command -v ninja >/dev/null || brew install ninja
- name: Compute exact modular cache key
id: key
run: |
digest=$(
{
bash scripts/modular-cache-key.sh liboqs
bash scripts/modular-cache-key.sh oqsprovider
bash scripts/modular-cache-key.sh openssh
} | shasum -a 256 | awk '{print $1}'
)
printf 'key=modular-v1-osx-oqs-%s\n' "$digest" >> "$GITHUB_OUTPUT"
- name: Restore compiled modular outputs
id: cache
uses: actions/cache/restore@v6.1.0
with:
key: ${{ steps.key.outputs.key }}
path: |
out/liboqs
out/oqsprovider
out/openssh
- name: Report modular cache result
env:
CACHE_KEY: ${{ steps.key.outputs.key }}
CACHE_HIT: ${{ steps.cache.outputs.cache-hit }}
run: |
printf '### Modular cache: %s / %s\n\nKey: `%s`\n\nExact hit: `%s`\n' "$TARGET" "$PACKAGE_LIBS" "$CACHE_KEY" "${CACHE_HIT:-false}" >> "$GITHUB_STEP_SUMMARY"
- name: Build or reuse and package modular libraries
env:
MODULAR_CACHE_HIT: ${{ steps.cache.outputs.cache-hit }}
run: bash scripts/build-modular-optional.sh
- name: Verify packaged archives
run: |
shopt -s nullglob
for library in liboqs oqsprovider openssh; do
packages=(out/oF_${library}_osx_*.tar.bz2)
test "${#packages[@]}" -gt 0
ls -lah "${packages[@]}"
done
- name: Save compiled modular outputs
if: steps.cache.outputs.cache-hit != 'true'
uses: actions/cache/save@v6.1.0
with:
key: ${{ steps.key.outputs.key }}
path: |
out/liboqs
out/oqsprovider
out/openssh
- name: Run OpenSSH OQS smoke tests
run: |
host=$(uname -m)
case "$host" in
arm64|aarch64) native=MAC_ARM64; foreign=MAC; foreign_macho='x86_64' ;;
x86_64) native=MAC; foreign=MAC_ARM64; foreign_macho='arm64' ;;
*) echo "Unsupported host architecture: $host" >&2; exit 1 ;;
esac
bash scripts/tests/oqs/test-openssh.sh out osx "$native"
native_bin=out/openssh/bin/osx/$native/ssh
foreign_bin=out/openssh/bin/osx/$foreign/ssh
test -x "$native_bin"
test -x "$foreign_bin"
file "$native_bin"
file "$foreign_bin"
file "$foreign_bin" | grep -F "$foreign_macho"
- name: Generate private ofxOQS addon from packages
run: bash scripts/tests/oqs/generate-ofx-addon.sh out out/ofxOQS osx
- name: Test ofxOQS addon layout and native smoke tests
run: bash scripts/tests/oqs/test-ofx-addon.sh out/ofxOQS
- name: Upload validation package
uses: actions/upload-artifact@v7.0.2
with:
name: oqs-osx
path: |
out/oF_liboqs_osx_*.tar.bz2
out/oF_oqsprovider_osx_*.tar.bz2
out/oF_openssh_osx_*.tar.bz2
if-no-files-found: error
- name: Upload private ofxOQS addon
uses: actions/upload-artifact@v7.0.2
with:
name: ofxOQS-osx
path: out/ofxOQS
if-no-files-found: error
- name: Upload Open Quantum Safe package to latest-modular
if: github.event_name == 'push' && github.repository == 'openframeworks/apothecary'
uses: danoli3/action-gh-release@ec40b04e78c39008f73c4ca3fdf9b51df604c4ed # temporary patch: softprops/action-gh-release#852
with:
token: ${{ secrets.PAT_TOKEN || secrets.GITHUB_TOKEN }}
tag_name: latest-modular
fail_on_unmatched_files: true
files: |
out/oF_liboqs_osx_*.tar.bz2
out/oF_oqsprovider_osx_*.tar.bz2
out/oF_openssh_osx_*.tar.bz2
of-addon:
needs: osx
name: ofxOQS openFrameworks example
runs-on: macos-15
steps:
- uses: actions/checkout@v7.0.1
with:
path: apothecary
- uses: actions/checkout@v7.0.1
with:
repository: openframeworks/openFrameworks
ref: master
submodules: recursive
path: openFrameworks
- name: Download private ofxOQS addon
uses: actions/download-artifact@v8
with:
name: ofxOQS-osx
path: openFrameworks/addons/ofxOQS
- name: Install openFrameworks osx libraries
working-directory: openFrameworks
run: scripts/osx/download_libs.sh -b
- name: Build ofxOQS example
working-directory: openFrameworks/addons/ofxOQS/example
run: make -j4