-
Notifications
You must be signed in to change notification settings - Fork 91
129 lines (112 loc) · 3.77 KB
/
Copy pathmulti-compiler.yml
File metadata and controls
129 lines (112 loc) · 3.77 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
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
name: Multiple Compilers
on:
push:
branches: [ 'master', 'main', 'release/**' ]
pull_request:
branches: [ '*' ]
types: [opened, synchronize, reopened, ready_for_review]
repository_dispatch:
types: [nightly-trigger]
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
build_wolfssl:
name: Build wolfSSL
if: github.event_name != 'pull_request' || github.event.pull_request.draft == false
runs-on: ubuntu-latest
timeout-minutes: 5
steps:
# Cache the built wolfSSL tree keyed on the resolved upstream commit so it
# is rebuilt only when wolfSSL master moves, not on every CI run.
- name: Resolve wolfSSL commit
id: wolfssl_rev
run: echo "sha=$(git ls-remote https://github.com/wolfSSL/wolfssl.git master | awk 'NR==1{print $1}')" >> "$GITHUB_OUTPUT"
- name: Cache wolfSSL build
id: wolfssl_cache
uses: actions/cache@v4
with:
path: wolfssl
key: wolfssl-multicompiler-${{ runner.os }}-${{ steps.wolfssl_rev.outputs.sha }}-v1
- name: Checkout wolfSSL
if: steps.wolfssl_cache.outputs.cache-hit != 'true'
uses: actions/checkout@v4
with:
repository: wolfssl/wolfssl
path: wolfssl
ref: ${{ steps.wolfssl_rev.outputs.sha }}
- name: Build wolfSSL
if: steps.wolfssl_cache.outputs.cache-hit != 'true'
working-directory: ./wolfssl
run: |
./autogen.sh
./configure --enable-wolftpm --enable-pkcallbacks
make -j$(nproc)
- name: Install wolfSSL
working-directory: ./wolfssl
run: |
sudo make install
sudo ldconfig
- name: tar build-dir
run: tar -zcf wolfssl-install.tgz /usr/local/lib/libwolfssl* /usr/local/include/wolfssl
- name: Upload built lib
uses: actions/upload-artifact@v4
with:
name: wolfssl-multi-compiler
path: wolfssl-install.tgz
retention-days: 5
compiler_test:
name: ${{ matrix.cc }}
if: github.event_name != 'pull_request' || github.event.pull_request.draft == false
runs-on: ubuntu-latest
# Headroom for an occasionally-slow apt mirror installing a version-specific
# compiler (apt-retry handles real failures; this avoids a hard cancel).
timeout-minutes: 12
needs: build_wolfssl
strategy:
fail-fast: false
matrix:
include:
- cc: gcc-11
cxx: g++-11
- cc: gcc-12
cxx: g++-12
- cc: gcc-13
cxx: g++-13
- cc: clang-14
cxx: clang++-14
- cc: clang-15
cxx: clang++-15
- cc: clang-17
cxx: clang++-17
steps:
# Checkout first so the local apt-retry composite action is on disk.
- name: Checkout wolfTPM
uses: actions/checkout@v4
# Version-specific compilers are not baked into the CI image; keep this
# job on the host runner and just make apt resilient to mirror timeouts.
- name: Install compiler
uses: ./.github/actions/apt-retry
with:
packages: ${{ matrix.cc }}
- name: Download wolfSSL
uses: actions/download-artifact@v4
with:
name: wolfssl-multi-compiler
- name: Install wolfSSL
run: |
sudo tar -xzf wolfssl-install.tgz -C /
sudo ldconfig
- name: Build wolfTPM with ${{ matrix.cc }}
env:
CC: ${{ matrix.cc }}
CXX: ${{ matrix.cxx }}
run: |
./autogen.sh
./configure --disable-fwtpm CFLAGS="-Wall -Wextra -Wpedantic"
make -j$(nproc)
- name: Make dist
run: make dist
- name: Show log on errors
if: failure()
run: cat config.log