-
Notifications
You must be signed in to change notification settings - Fork 2
175 lines (141 loc) · 4.15 KB
/
build-and-test.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
name: Build & Test
on: [push, pull_request]
permissions:
contents: read
jobs:
windows:
runs-on: windows-latest
steps:
- uses: actions/checkout@v3
- name: Setup MSBuild
uses: microsoft/[email protected]
- name: Download libsodium
shell: bash
run: |
curl -o libsodium-1.0.18-stable-msvc.zip https://download.libsodium.org/libsodium/releases/libsodium-1.0.18-stable-msvc.zip
unzip libsodium-1.0.18-stable-msvc.zip
- name: Run cmake
shell: bash
run: |
export sodium_DIR="$(pwd)/libsodium/"
mkdir build/
cd build/
cmake -T host=x64 -A x64 ..
- name: Run MSBuild
run: |
cd build
msbuild libxeddsa.sln
- name: Run ctest in Debug configuration
run: |
cd build
ctest -C Debug ..
- name: Run ctest in Release configuration
run: |
cd build
ctest -C Release ..
- name: Rename the binaries
run: |
cd bin/
mv xeddsa_static.lib libxeddsa-windows-amd64.lib
mv xeddsa.lib libxeddsa-windows-amd64.dll.lib
mv xeddsa.dll libxeddsa-windows-amd64.dll
- name: Upload the binaries
uses: actions/[email protected]
with:
name: libxeddsa-windows-amd64
path: |
bin/libxeddsa-windows-amd64.lib
bin/libxeddsa-windows-amd64.dll.lib
bin/libxeddsa-windows-amd64.dll
macos-amd64:
runs-on: macos-latest
steps:
- uses: actions/checkout@v3
- name: Run cmake
run: |
mkdir build/
cd build/
FORCE_URANDOM= cmake ..
- name: Run make
run: |
cd build/
make
- name: Run ctest
run: |
cd build/
ctest ..
- name: Rename the binaries
run: |
cd bin/
mv static/libxeddsa.a libxeddsa-macos-amd64.a
mv dynamic/libxeddsa.dylib libxeddsa-macos-amd64.dylib
- name: Upload the binaries
uses: actions/[email protected]
with:
name: libxeddsa-macos-amd64
path: |
bin/libxeddsa-macos-amd64.a
bin/libxeddsa-macos-amd64.dylib
macos-arm64:
runs-on: macos-latest
steps:
- uses: actions/checkout@v3
- name: Install libsodium
run: |
brew uninstall --ignore-dependencies libsodium
brew fetch --force --bottle-tag=arm64_ventura libsodium | tee brew_output
downloaded_to=$(grep "Downloaded to" brew_output)
downloaded_to_split=($downloaded_to)
brew install ${downloaded_to_split[2]}
- name: Run cmake
run: |
mkdir build/
cd build/
FORCE_URANDOM= cmake -DCMAKE_OSX_ARCHITECTURES=arm64 ..
- name: Run make
run: |
cd build/
make
- name: Rename the binaries
run: |
cd bin/
mv static/libxeddsa.a libxeddsa-macos-arm64.a
mv dynamic/libxeddsa.dylib libxeddsa-macos-arm64.dylib
- name: Upload the binaries
uses: actions/[email protected]
with:
name: libxeddsa-macos-arm64
path: |
bin/libxeddsa-macos-arm64.a
bin/libxeddsa-macos-arm64.dylib
ubuntu:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Install libsodium
run: sudo apt-get install -y libsodium-dev
- name: Run cmake
run: |
mkdir build/
cd build/
FORCE_URANDOM= cmake ..
- name: Run make
run: |
cd build/
make
- name: Run ctest
run: |
cd build/
ctest ..
- name: Rename the binaries
run: |
cd bin/
mv static/libxeddsa.a libxeddsa-linux-amd64.a
mv dynamic/libxeddsa.so libxeddsa-linux-amd64.so
- name: Upload the binaries
uses: actions/[email protected]
with:
name: libxeddsa-linux-amd64
path: |
bin/libxeddsa-linux-amd64.a
bin/libxeddsa-linux-amd64.so