-
Notifications
You must be signed in to change notification settings - Fork 189
150 lines (127 loc) · 3.82 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
name: CI
on:
push:
pull_request:
workflow_dispatch:
env:
version: 0.4.14_git
jobs:
build:
strategy:
fail-fast: false
matrix:
include:
- id: ubuntu-24.04
triplet: x64-linux
compiler: gcc
os: ubuntu-24.04
generator: Unix Makefiles
- id: ubuntu-22.04
triplet: x64-linux
compiler: gcc
os: ubuntu-22.04
generator: Unix Makefiles
- id: ubuntu-20.04
triplet: x64-linux
compiler: gcc
os: ubuntu-20.04
generator: Unix Makefiles
- id: macOS-3
openssl: 'openssl@3'
triplet: x64-osx
compiler: clang
os: macOS-latest
generator: Unix Makefiles
- id: macOS-1.1
openssl: 'openssl@1.1'
triplet: x64-osx
compiler: clang
os: macOS-latest
generator: Unix Makefiles
runs-on: ${{matrix.os}}
steps:
- uses: actions/checkout@v4
- name: Install apt dependencies (Linux)
if: runner.os == 'Linux'
run: |
sudo apt-get update
sudo apt-get install -y libssl-dev opensc softhsm2
- name: Install brew dependencies (macOS)
if: runner.os == 'macOS'
run: |
brew install libtool automake opensc softhsm
- name: Set environment variables (macOS)
if: runner.os == 'macOS'
run: |
echo "/opt/homebrew/bin" >> $GITHUB_PATH
echo "/opt/homebrew/opt/${{matrix.openssl}}/bin" >> $GITHUB_PATH
echo "PKG_CONFIG_PATH=/opt/homebrew/opt/${{matrix.openssl}}/lib/pkgconfig" >> $GITHUB_ENV
- name: System information
run: |
which pkcs11-tool
which softhsm2-util
which openssl
openssl version -a
echo "PATH=$PATH"
- name: Bootstrap
run: autoreconf --verbose --install --force
- name: Configure
run: ./configure --enable-strict
- name: Build
run: make
- name: Test
timeout-minutes: 5
run: make check
- name: Results of tests
run: cat ${{github.workspace}}/tests/test-suite.log || true
windows:
strategy:
fail-fast: false
matrix:
include:
- id: windows-x86-vs
triplet: x86-windows
build_for: 'WIN32'
compiler: vs
arch: x86
os: windows-latest
generator: Ninja
vcpkg_root: C:/vcpkg
- id: windows-x64-vs
triplet: x64-windows
build_for: 'WIN64'
compiler: vs
arch: x64
os: windows-latest
generator: Ninja
vcpkg_root: C:/vcpkg
runs-on: windows-latest
steps:
- uses: actions/checkout@v4
- name: Cache the vcpkg archives
uses: actions/cache@v4
with:
path: C:/Users/runneradmin/AppData/Local/vcpkg/archives
key: ${{matrix.id}}-${{hashFiles('vcpkg.json')}}
restore-keys: |
${{matrix.id}}-${{hashFiles('vcpkg.json')}}
${{matrix.id}}-
- name: Configure Visual Studio
uses: ilammy/msvc-dev-cmd@v1
with:
arch: ${{matrix.arch}}
- name: Install OpenSSL with VCPKG
run: |
vcpkg install --triplet=${{matrix.triplet}} openssl[tools]
echo "C:\vcpkg\packages\openssl_${{matrix.triplet}}\tools\openssl" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append
- name: System information
run: openssl version -a
- name: Build
run: nmake -f Makefile.mak
BUILD_FOR=${{matrix.build_for}}
OPENSSL_DIR="C:\vcpkg\packages\openssl_${{matrix.triplet}}"
- name: Upload the DLLs
uses: actions/upload-artifact@v4
with:
name: libp11-${{env.version}}-${{matrix.arch}}
path: ${{github.workspace}}/src/*.dll