Skip to content

Commit 96a6f78

Browse files
authored
Merge pull request wolfSSL#470 from wolfSSL/add-ci-workflows
Add new CI tests for wolfMQTT
2 parents 0623422 + d84c3ec commit 96a6f78

4 files changed

Lines changed: 198 additions & 1 deletion

File tree

.github/workflows/codespell.yml

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
name: Codespell Check
2+
3+
on:
4+
push:
5+
branches: [ 'master', 'main', 'release/**' ]
6+
pull_request:
7+
branches: [ '*' ]
8+
9+
concurrency:
10+
group: ${{ github.workflow }}-${{ github.ref }}
11+
cancel-in-progress: true
12+
13+
jobs:
14+
codespell:
15+
runs-on: ubuntu-latest
16+
steps:
17+
- uses: actions/checkout@v4
18+
19+
- name: Install codespell
20+
run: pip install codespell
21+
22+
- name: Run codespell
23+
run: >
24+
codespell
25+
--skip=".git,./IDE,./certs,./m4,*.der,*.pem"
26+
--ignore-words-list="ser,parm,nd,inout,dout,ba,keypair,iterm,hel,assertIn,stoll,smb,childs,froms,regist,laf"
27+
.
Lines changed: 84 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,84 @@
1+
name: Multi-Compiler Tests
2+
3+
on:
4+
push:
5+
branches: [ 'master', 'main', 'release/**' ]
6+
pull_request:
7+
branches: [ '*' ]
8+
9+
concurrency:
10+
group: ${{ github.workflow }}-${{ github.ref }}
11+
cancel-in-progress: true
12+
13+
jobs:
14+
compiler_test:
15+
name: ${{ matrix.cc }}
16+
runs-on: ubuntu-latest
17+
timeout-minutes: 15
18+
strategy:
19+
fail-fast: false
20+
matrix:
21+
include:
22+
- cc: gcc-11
23+
- cc: gcc-12
24+
- cc: gcc-13
25+
- cc: clang-14
26+
- cc: clang-15
27+
- cc: clang-17
28+
29+
steps:
30+
- uses: actions/checkout@v4
31+
32+
- name: Install compiler and tools
33+
run: |
34+
sudo apt-get update
35+
sudo apt-get install -y ${{ matrix.cc }} autoconf automake libtool
36+
37+
- name: Cache wolfSSL
38+
id: cache-wolfssl
39+
uses: actions/cache@v4
40+
with:
41+
path: ~/wolfssl-install
42+
key: wolfssl-ubuntu-latest-v2
43+
44+
- name: Build wolfSSL
45+
if: steps.cache-wolfssl.outputs.cache-hit != 'true'
46+
run: |
47+
cd ~
48+
git clone --depth 1 https://github.com/wolfssl/wolfssl.git
49+
cd wolfssl
50+
./autogen.sh
51+
./configure --enable-enckeys --prefix=$HOME/wolfssl-install
52+
make -j$(nproc)
53+
make install
54+
55+
- name: Install wolfSSL
56+
run: |
57+
echo "$HOME/wolfssl-install/lib" | sudo tee /etc/ld.so.conf.d/wolfssl.conf
58+
sudo ldconfig
59+
60+
- name: autogen
61+
run: ./autogen.sh
62+
63+
- name: configure
64+
run: |
65+
# Add -Wno-gnu-zero-variadic-macro-arguments for clang (##__VA_ARGS__ is widely supported)
66+
EXTRA_CFLAGS=""
67+
if [[ "${{ matrix.cc }}" == clang* ]]; then
68+
EXTRA_CFLAGS="-Wno-gnu-zero-variadic-macro-arguments"
69+
fi
70+
CC=${{ matrix.cc }} ./configure \
71+
CFLAGS="-Wall -Wextra -Wpedantic $EXTRA_CFLAGS" \
72+
LDFLAGS="-L$HOME/wolfssl-install/lib" \
73+
CPPFLAGS="-I$HOME/wolfssl-install/include"
74+
75+
- name: make
76+
run: make -j$(nproc)
77+
78+
- name: make dist
79+
run: make dist
80+
81+
- name: Show logs on failure
82+
if: failure()
83+
run: |
84+
cat config.log || true

.github/workflows/sanitizer.yml

Lines changed: 86 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,86 @@
1+
name: Sanitizer Tests
2+
3+
on:
4+
push:
5+
branches: [ 'master', 'main', 'release/**' ]
6+
pull_request:
7+
branches: [ '*' ]
8+
9+
concurrency:
10+
group: ${{ github.workflow }}-${{ github.ref }}
11+
cancel-in-progress: true
12+
13+
jobs:
14+
sanitizer_test:
15+
name: ${{ matrix.name }}
16+
runs-on: ubuntu-22.04
17+
timeout-minutes: 10
18+
env:
19+
WOLFMQTT_NO_EXTERNAL_BROKER_TESTS: 1
20+
strategy:
21+
fail-fast: false
22+
matrix:
23+
include:
24+
- name: "ASan"
25+
sanitizer_flags: "-fsanitize=address"
26+
- name: "UBSan"
27+
sanitizer_flags: "-fsanitize=undefined -fno-sanitize-recover=all"
28+
- name: "LeakSan"
29+
sanitizer_flags: "-fsanitize=leak"
30+
31+
steps:
32+
- name: Workaround high-entropy ASLR
33+
run: sudo sysctl vm.mmap_rnd_bits=28
34+
35+
- name: Install dependencies
36+
run: |
37+
export DEBIAN_FRONTEND=noninteractive
38+
sudo apt-get update
39+
sudo apt-get install -y mosquitto bubblewrap
40+
41+
- name: Setup mosquitto broker
42+
run: |
43+
sudo service mosquitto stop
44+
sleep 1
45+
46+
- name: Checkout wolfSSL
47+
uses: actions/checkout@v4
48+
with:
49+
repository: wolfssl/wolfssl
50+
path: wolfssl
51+
52+
- name: Build wolfSSL with ${{ matrix.name }}
53+
working-directory: ./wolfssl
54+
run: |
55+
./autogen.sh
56+
./configure CC="gcc ${{ matrix.sanitizer_flags }}" --enable-enckeys
57+
make -j$(nproc)
58+
sudo make install
59+
sudo ldconfig
60+
61+
- name: Checkout wolfMQTT
62+
uses: actions/checkout@v4
63+
with:
64+
path: wolfmqtt
65+
66+
- name: Build wolfMQTT with ${{ matrix.name }}
67+
working-directory: ./wolfmqtt
68+
run: |
69+
./autogen.sh
70+
./configure CC="gcc ${{ matrix.sanitizer_flags }}"
71+
make -j$(nproc)
72+
73+
- name: Run tests
74+
working-directory: ./wolfmqtt
75+
run: make check
76+
77+
- name: Upload failure logs
78+
if: failure()
79+
uses: actions/upload-artifact@v4
80+
with:
81+
name: wolfmqtt-${{ matrix.name }}-logs
82+
path: |
83+
wolfmqtt/test-suite.log
84+
wolfmqtt/scripts/*.log
85+
wolfmqtt/config.log
86+
retention-days: 5

examples/threadx/threadx_netx.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626

2727

2828
/* This is a start to an example use with ThreadX. It currently is being used
29-
* to confirm that compiling with all necessary NetX ThreadX API's succeds */
29+
* to confirm that compiling with all necessary NetX ThreadX API's succeeds */
3030

3131
#ifdef HAVE_NETX
3232

0 commit comments

Comments
 (0)