forked from Election-Tech-Initiative/electionguard-c
-
Notifications
You must be signed in to change notification settings - Fork 0
92 lines (90 loc) · 2.88 KB
/
pr-workflow.yml
File metadata and controls
92 lines (90 loc) · 2.88 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
name: Pull Request
on: [pull_request]
jobs:
linux_build:
name: 'Linux Build'
runs-on: 'ubuntu-latest'
steps:
- uses: actions/checkout@master
with:
submodules: true
- name: Upgrade cmake
run: |
sudo mv /usr/local/bin/cmake /usr/local/bin/cmake-old
sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 8611B7A28669BB93
sudo apt-add-repository 'deb https://apt.kitware.com/ubuntu/ xenial main'
sudo apt-get update && sudo apt-get install -y cmake
cmake --version
- name: Build C Library
run: |
cmake --version
cmake -S . -B build
cmake --build build
- name: 'Build Simple Election'
run: |
ElectionGuard_DIR="$PWD/build/ElectionGuard" cmake -S examples/simple -B simple_build
cmake --build simple_build --target simple
- name: 'Test Simple Election'
run: |
cd simple_build
./simple
windows_build:
name: 'Windows Build'
runs-on: 'windows-latest'
steps:
- uses: actions/checkout@master
with:
submodules: true
- name: Install msys
run: |
$msyspath="msys64"
choco install msys2 --params="/InstallDir:$msyspath /NoPath" -y
echo "::add-path::$msyspath\usr\bin"
echo "::add-path::$msyspath"
echo "::add-path::$msyspath\mingw64\bin"
echo "::add-path::$msyspath\mingw64\lib"
echo "::add-path::$msyspath\mingw64\include"
- name: Install gcc and gmp
run: |
pacman --noconfirm -Syu
pacman --noconfirm -S mingw-w64-x86_64-gcc mingw-w64-x86_64-gmp
- name: Build C Library
run: |
cmake --version
cmake -S . -B build -G "MSYS Makefiles"
cmake --build build
- name: 'Build Simple Election'
run: |
$env:CMAKE_PREFIX_PATH="./build/ElectionGuard"
cmake -S examples/simple -B simple_build -G "MSYS Makefiles"
cmake --build simple_build --target simple
- name: 'Test Simple Election'
run: |
cd simple_build
$outcome = Invoke-Expression ".\simple.exe"
echo $outcome
macos_build:
name: 'MacOS Build'
runs-on: 'macOS-latest'
steps:
- uses: actions/checkout@master
with:
submodules: true
- name: Install gmp
run: |
brew install gmp
echo "::add-path::/usr/local/lib"
echo "::add-path::/usr/local/include"
- name: Build C Library
run: |
cmake --version
cmake -S . -B build
cmake --build build
- name: 'Build Simple Election'
run: |
ElectionGuard_DIR="$PWD/build/ElectionGuard" cmake -S examples/simple -B simple_build
cmake --build simple_build --target simple
- name: 'Test Simple Election'
run: |
cd simple_build
./simple