This repository was archived by the owner on Aug 24, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 3
203 lines (172 loc) · 4.98 KB
/
ci.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
190
191
192
193
194
195
196
197
198
199
200
201
202
203
# https://cristianadam.eu/20191222/using-github-actions-with-c-plus-plus-and-cmake
name: CMake Build Matrix
on: [push]
jobs:
build:
name: ${{ matrix.config.name }}
runs-on: ${{ matrix.config.os }}
strategy:
fail-fast: false
matrix:
config:
- {
name: "Ubuntu Latest GCC",
artifact: "Linux",
os: ubuntu-20.04,
build_type: "Release", cc: "gcc"
}
steps:
- uses: actions/checkout@v1
- name: Download and build dependencies
run: bash .github/liboqs.sh
- name: Configure
shell: bash
run: |
CC=${{ matrix.config.cc }}
cmake \
-S . \
-B build \
-D CMAKE_BUILD_TYPE=${{ matrix.config.build_type }}
- name: Build
shell: bash
run: cmake --build build
- name: Run tests
shell: bash
run: cd build && ctest
- name: Archive binaries
uses: actions/upload-artifact@v2
with:
name: ${{ matrix.config.artifact }}
path: |
./build/bin/*
./build/lib/*
retention-days: 7
if-no-files-found: error
tests:
if: contains(github.ref, 'tags/v')
runs-on: self-hosted
needs: build
timeout-minutes: 0
steps:
- name: Set up Git repository
uses: actions/checkout@v2
- name: Download dependencies
run: sudo apt-get install python3 virtualenv
- name: Download all workflow run artifacts
uses: actions/download-artifact@v2
- name: Run tests
run: |
mkdir -p build build/results build/bin
ls -lah .
mv ./Linux/bin/* build/bin
chmod +x ./build/bin/*
bash graphics/run_tests.sh
- name: Generate CSVs
run: |
sudo apt install -y nodejs npm
npm i parse-markdown-table-cli
ls -lah .
ls -lah ./build
bash graphics/convert_tables.sh
- name: Run tests for FO_AKE
run: |
bash graphics/build-fo-ake.sh
- name: Download dependencies
run: sudo apt install python3 virtualenv
- name: Compute graphics
run: |
virtualenv --python=python3 venv
source venv/bin/activate
pip install -r graphics/requirements.txt
python graphics/generate_graphics.py graphics/config.yaml
python graphics/generate_graphics_time.py graphics/config.yaml
python graphics/generate_graphics_foake_vs_fsxy.py graphics/config.yaml
bash graphics/cut-images.sh
- name: Archive results
uses: actions/upload-artifact@v2
with:
name: results
path: ./build/results
retention-days: 7
release:
if: contains(github.ref, 'tags/v')
runs-on: ubuntu-20.04
needs: tests
steps:
- name: Create Release
id: create_release
uses: actions/create-release@v1.0.0
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ github.ref }}
release_name: Release ${{ github.ref }}
draft: false
prerelease: false
- name: Store Release url
run: |
echo "${{ steps.create_release.outputs.upload_url }}" > ./upload_url
- uses: actions/upload-artifact@v1
with:
path: ./upload_url
name: upload_url
publish:
if: contains(github.ref, 'tags/v')
name: ${{ matrix.config.name }}
runs-on: ${{ matrix.config.os }}
strategy:
fail-fast: false
matrix:
config:
- {
name: "Ubuntu Latest GCC", artifact: "Linux",
os: ubuntu-20.04
}
# - {
# name: "macOS Latest Clang", artifact: "macOS.tar.xz",
# os: ubuntu-20.04
# }
needs: release
steps:
- name: Download binaries
uses: actions/download-artifact@v1
with:
name: ${{ matrix.config.artifact }}
path: ./
- name: Download results
uses: actions/download-artifact@v1
with:
name: results
path: ./
- name: Download URL
uses: actions/download-artifact@v1
with:
name: upload_url
path: ./
- id: set_upload_url
run: |
upload_url=`cat ./upload_url`
echo ::set-output name=upload_url::$upload_url
- name: Compress results
run: |
zip -r results.zip *.csv *.txt *.png
zip -r Linux.zip bin/*
- name: Upload to Release
id: upload_to_release
uses: actions/upload-release-asset@v1.0.1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.set_upload_url.outputs.upload_url }}
asset_path: ./Linux.zip
asset_name: Linux.zip
asset_content_type: application/zip
- name: Upload to Release
uses: actions/upload-release-asset@v1.0.1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.set_upload_url.outputs.upload_url }}
asset_path: ./results.zip
asset_name: ./results.zip
asset_content_type: application/zip