-
Notifications
You must be signed in to change notification settings - Fork 28
89 lines (77 loc) · 2.76 KB
/
go.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
name: GitHub actions
on:
push:
branches: ["**"]
pull_request:
branches: ["**"]
repository_dispatch:
types: ["**"]
env:
BUILD_TYPE: Debug
LD_LIBRARY_PATH: /usr/local/lib
DYLD_LIBRARY_PATH: /usr/local/lib
POSIX_PKG_CONFIG_PATH: ${{github.workspace}}/.config
WIN_LIBOQS_INSTALL_PATH: C:\liboqs
WIN_PKG_CONFIG_PATH: C:\Strawberry\c\lib\pkgconfig
jobs:
build:
strategy:
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v3
- name: Set up Go
uses: actions/setup-go@v3
with:
go-version: 1.21
- name: Install liboqs POSIX
if: matrix.os != 'windows-latest'
run: |
git clone --branch main --single-branch --depth 1 https://github.com/open-quantum-safe/liboqs
cmake -S liboqs -B liboqs/build -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}} -DBUILD_SHARED_LIBS=ON -DOQS_BUILD_ONLY_LIB=ON
cmake --build liboqs/build --parallel 4
sudo cmake --build liboqs/build --target install
- name: Run examples POSIX
if: matrix.os != 'windows-latest'
run: |
export PKG_CONFIG_PATH=${{env.POSIX_PKG_CONFIG_PATH}}
go run ./examples/kem/kem.go
echo
go run ./examples/sig/sig.go
echo
go run ./examples/rand/rand.go
- name: Run unit tests POSIX
if: matrix.os != 'windows-latest'
run: |
export PKG_CONFIG_PATH=${{env.POSIX_PKG_CONFIG_PATH}}
go test -v ./oqstests
- name: Install liboqs Windows
if: matrix.os == 'windows-latest'
shell: cmd
run: |
git clone --branch main --single-branch --depth 1 https://github.com/open-quantum-safe/liboqs
cmake -S liboqs -B liboqs\build -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}} -DCMAKE_INSTALL_PREFIX=${{env.WIN_LIBOQS_INSTALL_PATH}} -DBUILD_SHARED_LIBS=ON -DOQS_BUILD_ONLY_LIB=ON
cmake --build liboqs\build --parallel 4
cmake --build liboqs\build --target install
- name: Configure pkgconfig Windows
if: matrix.os == 'windows-latest'
shell: cmd
run: |
copy .\.config\liboqs-go.pc.win64 ${{env.WIN_PKG_CONFIG_PATH}}\liboqs-go.pc
- name: Run examples Windows
if: matrix.os == 'windows-latest'
shell: cmd
run: |
set PATH=%PATH%;${{env.WIN_LIBOQS_INSTALL_PATH}}\bin
go run .\examples\kem\kem.go
echo.
go run .\examples\sig\sig.go
echo.
go run .\examples\rand\rand.go
- name: Run unit tests Windows
shell: cmd
if: matrix.os == 'windows-latest'
run: |
set PATH=%PATH%;${{env.WIN_LIBOQS_INSTALL_PATH}}\bin
go test -v .\oqstests