@@ -2,13 +2,21 @@ name: Build and Test
22
33on :
44 push :
5+ paths-ignore :
6+ - " docs/**"
7+ - " **/*.md"
8+ - " LICENSE"
59 pull_request :
10+ paths-ignore :
11+ - " docs/**"
12+ - " **/*.md"
13+ - " LICENSE"
614
715permissions :
816 contents : read
917
1018concurrency :
11- group : ci-${{ github.ref }}
19+ group : ci-${{ github.event.pull_request.head. ref || github.ref_name }}
1220 cancel-in-progress : true
1321
1422jobs :
5058 - run : npm run test:run
5159 - run : npm run build
5260
53- native-adapters :
54- name : Native adapters (${{ matrix.name }})
61+ native-and-examples :
62+ name : Native adapters and C examples
5563 runs-on : ubuntu-latest
56- strategy :
57- fail-fast : false
58- matrix :
59- include :
60- - name : default
61- c_flags : " "
62- - name : asan-ubsan
63- c_flags : " -fsanitize=address,undefined -fno-omit-frame-pointer -g"
6464 steps :
6565 - uses : actions/checkout@v4
6666 - name : Install build dependencies
@@ -69,27 +69,27 @@ jobs:
6969 sudo apt-get install -y --no-install-recommends cmake pkg-config build-essential libfuse3-dev
7070 - name : Build and test adapters
7171 env :
72- CFLAGS_EXTRA : ${{ matrix.c_flags }}
7372 ASAN_OPTIONS : detect_leaks=1
7473 UBSAN_OPTIONS : halt_on_error=1:print_stacktrace=1
7574 run : |
7675 set -eu
77- for adapter in spi-cuse i2c-cuse gpio-sim uart-pty; do
78- echo "::group::$adapter"
79- cmake -S "adapters/$adapter" -B "$RUNNER_TEMP/build-$adapter" \
80- -DCMAKE_BUILD_TYPE=Debug \
81- -DCMAKE_C_FLAGS="$CFLAGS_EXTRA" \
82- -DCMAKE_EXE_LINKER_FLAGS="$CFLAGS_EXTRA"
83- cmake --build "$RUNNER_TEMP/build-$adapter" --parallel
84- ctest --test-dir "$RUNNER_TEMP/build-$adapter" --output-on-failure
85- echo "::endgroup::"
76+ for variant in default asan-ubsan; do
77+ case "$variant" in
78+ default) flags="" ;;
79+ asan-ubsan) flags="-fsanitize=address,undefined -fno-omit-frame-pointer -g" ;;
80+ esac
81+ for adapter in spi-cuse i2c-cuse gpio-sim uart-pty; do
82+ echo "::group::$variant / $adapter"
83+ build_dir="$RUNNER_TEMP/build-$variant-$adapter"
84+ cmake -S "adapters/$adapter" -B "$build_dir" \
85+ -DCMAKE_BUILD_TYPE=Debug \
86+ -DCMAKE_C_FLAGS="$flags" \
87+ -DCMAKE_EXE_LINKER_FLAGS="$flags"
88+ cmake --build "$build_dir" --parallel
89+ ctest --test-dir "$build_dir" --output-on-failure
90+ echo "::endgroup::"
91+ done
8692 done
87-
88- examples :
89- name : Embedded C examples
90- runs-on : ubuntu-latest
91- steps :
92- - uses : actions/checkout@v4
9393 - name : Build example applications
9494 run : |
9595 set -eu
@@ -112,6 +112,6 @@ jobs:
112112 name : Device ABI integration (disabled)
113113 if : false
114114 runs-on : ubuntu-latest
115- needs : [rust, native-adapters ]
115+ needs : [rust, native-and-examples ]
116116 steps :
117117 - run : echo "TODO - see comment above"
0 commit comments