-
Notifications
You must be signed in to change notification settings - Fork 172
146 lines (128 loc) · 4.55 KB
/
Copy pathmacos-check.yml
File metadata and controls
146 lines (128 loc) · 4.55 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
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
name: macOS Build Test
on:
push:
branches: [ 'master', 'main', 'release/**' ]
pull_request:
branches: [ '*' ]
env:
WOLFMQTT_NO_EXTERNAL_BROKER_TESTS: 1
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
build:
runs-on: macos-latest
timeout-minutes: 10
steps:
- uses: actions/checkout@master
- name: Resolve wolfSSL master SHA
id: wolfssl-sha
run: |
set -e
sha=$(git ls-remote https://github.com/wolfssl/wolfssl refs/heads/master | cut -f1)
if [ -z "$sha" ]; then echo "ERROR: failed to resolve wolfssl master SHA" >&2; exit 1; fi
echo "sha=$sha" >> "$GITHUB_OUTPUT"
- uses: actions/checkout@master
with:
repository: wolfssl/wolfssl
path: wolfssl
ref: ${{ steps.wolfssl-sha.outputs.sha }}
- name: brew
run: |
brew install automake libtool mosquitto coreutils
echo "/usr/local/sbin/" >> $GITHUB_PATH
echo "/usr/local/opt/mosquitto/sbin/" >> $GITHUB_PATH
# Cache the wolfSSL install (prefix build-dir) keyed on the live
# wolfssl master commit, so it is rebuilt only when master advances.
- name: Cache wolfSSL
id: cache-wolfssl
uses: actions/cache@v4
with:
path: ${{ github.workspace }}/build-dir
key: wolfssl-macos-${{ steps.wolfssl-sha.outputs.sha }}-enckeys
- name: wolfssl autogen
if: steps.cache-wolfssl.outputs.cache-hit != 'true'
working-directory: ./wolfssl
run: ./autogen.sh
- name: wolfssl configure
if: steps.cache-wolfssl.outputs.cache-hit != 'true'
working-directory: ./wolfssl
run: ./configure --enable-enckeys --prefix=$GITHUB_WORKSPACE/build-dir
- name: wolfssl make
if: steps.cache-wolfssl.outputs.cache-hit != 'true'
working-directory: ./wolfssl
run: make
- name: wolfssl make install
if: steps.cache-wolfssl.outputs.cache-hit != 'true'
working-directory: ./wolfssl
run: make install
- name: Check wolfSSL install dir
run: ls $GITHUB_WORKSPACE/build-dir
- name: autogen
run: ./autogen.sh
- name: configure
run: ./configure --with-libwolfssl-prefix=$GITHUB_WORKSPACE/build-dir
- name: make
run: make
- name: make check
run: make check
- name: configure without TLS
run: ./configure --enable-all --disable-tls
- name: make
run: make
- name: make check
run: make check
- name: configure with SN Enabled
run: ./configure --enable-sn --with-libwolfssl-prefix=$GITHUB_WORKSPACE/build-dir
- name: make
run: make
- name: make check
run: make check
- name: configure with Non-Block
run: ./configure --enable-nonblock CFLAGS="-DWOLFMQTT_TEST_NONBLOCK" --with-libwolfssl-prefix=$GITHUB_WORKSPACE/build-dir
- name: make
run: make
- name: make check
run: make check
- name: configure with Non-Block and Multi-threading
run: ./configure --enable-mt --enable-nonblock CFLAGS="-DWOLFMQTT_TEST_NONBLOCK" --with-libwolfssl-prefix=$GITHUB_WORKSPACE/build-dir
- name: make
run: make
- name: make check
run: make check
# capture logs on failure
- name: Show logs on failure
if: failure() || cancelled()
run: |
# Copy broker.test tmp dirs ($TMPDIR/tmp.* on macOS, e.g.
# /var/folders/.../T/tmp.XXXXXX) into the workspace so the
# next step can upload them as an artifact. Globbing the
# real /var/folders path directly trips over unreadable
# macOS LaunchServices files.
mkdir -p ci-logs
[ -f test-suite.log ] && cp test-suite.log ci-logs/ || true
cp scripts/*.log ci-logs/ 2>/dev/null || true
for d in "${TMPDIR%/}"/tmp.* /tmp/tmp.*; do
[ -d "$d" ] || continue
base=$(basename "$d")
mkdir -p "ci-logs/$base"
cp "$d"/*.log "ci-logs/$base/" 2>/dev/null || true
done
echo "=== test-suite.log ==="
cat test-suite.log 2>/dev/null || true
echo "=== scripts/*.log ==="
cat scripts/*.log 2>/dev/null || true
echo "=== ci-logs/tmp.*/*.log (broker.test per-test logs) ==="
for f in ci-logs/tmp.*/*.log; do
[ -f "$f" ] || continue
echo "--- $f ---"
cat "$f"
done
- name: Upload broker.test logs on failure
if: failure() || cancelled()
uses: actions/upload-artifact@v4
with:
name: broker-test-logs-macos
path: ci-logs/
if-no-files-found: ignore
retention-days: 7