-
Notifications
You must be signed in to change notification settings - Fork 14
164 lines (147 loc) · 4.86 KB
/
ci.yaml
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
name: CI
on: [push, pull_request]
env:
cpm-path: .cpm
jobs:
build:
strategy:
fail-fast: false
matrix:
preset: [android, ios, linux, macos, windows]
version: [1.1.1w, 3.0.15, 3.1.7, 3.2.3, 3.3.2, 3.4.0]
include:
- { os: macos, preset: ios }
- { os: macos, preset: macos }
- { os: ubuntu, preset: android }
- { os: ubuntu, preset: linux }
- { os: windows, preset: windows }
name: ${{ matrix.preset }}-${{ matrix.version }}
runs-on: ${{ matrix.os }}-latest
steps:
- uses: actions/checkout@v4
- uses: actions/cache@v4
with:
path: ${{ env.cpm-path }}
key: openssl-${{ matrix.version }}-cpm
enableCrossOsArchive: true
- uses: actions/cache@v4
with:
path: .ccache
key: openssl-${{ matrix.version }}-ccache-${{ matrix.preset }}-${{ github.run_id }}
restore-keys: openssl-${{ matrix.version }}-ccache-${{ matrix.preset }}-
- name: Install dependencies on Linux
if: runner.os == 'Linux'
run: |
sudo apt-get update
sudo apt-get install -y ninja-build ccache
- name: Install dependencies on macOS
if: runner.os == 'macOS'
run: |
brew update
brew install ccache
- name: Install dependencies on Windows
if: runner.os == 'Windows'
run: |
choco install -y jom nasm ccache
echo "PATH=$ENV:PATH;C:\Program Files\NASM" >> $ENV:GITHUB_ENV
- name: Configure ccache
run: |
ccache -o cache_dir=${{ github.workspace }}/.ccache
ccache -z
- name: Configure CMake
run: >
cmake --preset ${{ matrix.preset }}
-DCPM_SOURCE_CACHE="${{ env.cpm-path }}"
-DOPENSSL_BUILD_VERBOSE=ON
-DOPENSSL_CONFIGURE_VERBOSE=ON
-DOPENSSL_TARGET_VERSION="${{ matrix.version }}"
-DOPENSSL_TEST=ON
- name: Build
run: cmake --build --preset ${{ matrix.preset }}
- name: Test
if: contains(fromJSON('["linux", "macos", "windows"]'), matrix.preset)
run: ctest --preset ${{ matrix.preset }}
- name: Show ccache statistics
run: ccache -sv
build-freebsd:
strategy:
fail-fast: false
matrix:
version: [1.1.1w, 3.0.15, 3.1.7, 3.2.3, 3.3.2, 3.4.0]
name: freebsd-${{ matrix.version }}
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/cache@v4
with:
path: ${{ env.cpm-path }}
key: openssl-${{ matrix.version }}-cpm
enableCrossOsArchive: true
- uses: actions/cache@v4
with:
path: .ccache
key: openssl-${{ matrix.version }}-ccache-freebsd-${{ github.run_id }}
restore-keys: openssl-${{ matrix.version }}-ccache-freebsd-
- uses: cross-platform-actions/action@master
with:
operating_system: freebsd
architecture: x86_64
version: "14.1"
run: |
sudo pkg install -y ccache4 cmake perl5 ninja
ccache -o cache_dir=${{ github.workspace }}/.ccache
ccache -z
cmake -B build -G Ninja \
-DCPM_SOURCE_CACHE=${{ env.cpm-path }} \
-DOPENSSL_BUILD_VERBOSE=ON \
-DOPENSSL_CONFIGURE_VERBOSE=ON \
-DOPENSSL_TARGET_VERSION=${{ matrix.version }}
cmake --build build
ccache -sv
build-mingw64:
strategy:
fail-fast: false
matrix:
version: [1.1.1w, 3.0.15, 3.1.7, 3.2.3, 3.3.2, 3.4.0]
name: mingw64-${{ matrix.version }}
runs-on: windows-latest
defaults:
run:
shell: msys2 {0}
steps:
- uses: actions/checkout@v4
- uses: actions/cache@v4
with:
path: .ccache
key: openssl-${{ matrix.version }}-ccache-mingw64-${{ github.run_id }}
restore-keys: openssl-${{ matrix.version }}-ccache-mingw64-
- uses: msys2/setup-msys2@v2
with:
msystem: MINGW64
update: true
pacboy: >-
ccache:p
cmake:p
gcc:p
make:p
ninja:p
- name: Configure ccache
run: |
ccache -o cache_dir=$(cygpath -u "${{ github.workspace }}/.ccache")
ccache -z
- name: Configure CMake
run: >
cmake -B build -G Ninja
-DOPENSSL_BUILD_VERBOSE=ON
-DOPENSSL_CONFIGURE_VERBOSE=ON
-DOPENSSL_TARGET_VERSION=${{ matrix.version }}
- name: Build
run: cmake --build build
- name: Show ccache statistics
run: ccache -sv
create-xcframework:
runs-on: macos-latest
steps:
- uses: actions/checkout@v4
- name: Create XCFramework
run: bash ./script/create-xcframework.sh