Skip to content

Commit 780b36c

Browse files
author
Pat
authored
workflows: refactor MacOS tests (#5743)
Signed-off-by: Patrick Stephens <[email protected]>
1 parent b3494c8 commit 780b36c

File tree

1 file changed

+57
-30
lines changed

1 file changed

+57
-30
lines changed

.github/workflows/unit-tests.yaml

Lines changed: 57 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -23,49 +23,45 @@ on:
2323
workflow_dispatch:
2424

2525
jobs:
26-
run-unit-tests-amd64:
27-
name: ${{ matrix.os }} - ${{ matrix.compiler }} - ${{ matrix.flb_option }} unit tests run on AMD64
28-
runs-on: ${{ matrix.os }}
26+
run-ubuntu-unit-tests:
27+
runs-on: ubuntu-18.04
28+
timeout-minutes: 30
2929
strategy:
30-
max-parallel: 48
3130
fail-fast: false
3231
matrix:
33-
flb_option: [ "-DFLB_JEMALLOC=On", "-DFLB_JEMALLOC=Off", "-DFLB_SMALL=On", "-DSANITIZE_ADDRESS=On", "-DSANITIZE_UNDEFINED=On", "-DFLB_COVERAGE=On", "-DFLB_SANITIZE_MEMORY=On", "-DFLB_SANITIZE_THREAD=On"]
34-
os: [ubuntu-18.04, macos-latest]
35-
compiler: [ gcc, clang ]
32+
flb_option:
33+
- "-DFLB_JEMALLOC=On"
34+
- "-DFLB_JEMALLOC=Off"
35+
- "-DFLB_SMALL=On"
36+
- "-DSANITIZE_ADDRESS=On"
37+
- "-DSANITIZE_UNDEFINED=On"
38+
- "-DFLB_COVERAGE=On"
39+
- "-DFLB_SANITIZE_MEMORY=On"
40+
- "-DFLB_SANITIZE_THREAD=On"
41+
compiler:
42+
- gcc
43+
- clang
3644
exclude:
37-
- os: macos-latest
38-
flb_option: "-DFLB_JEMALLOC=On"
39-
- os: macos-latest
40-
flb_option: "-DFLB_SMALL=On"
41-
- os: macos-latest
42-
flb_option: "-DSANITIZE_ADDRESS=On"
43-
- os: macos-latest
44-
flb_option: "-DSANITIZE_UNDEFINED=On"
45-
- os: macos-latest
46-
flb_option: "-DFLB_COVERAGE=On"
47-
- os: macos-latest
48-
flb_option: "-DFLB_JEMALLOC=Off"
49-
compiler: clang
5045
- os: ubuntu-18.04
5146
flb_option: "-DFLB_COVERAGE=On"
5247
compiler: clang
48+
permissions:
49+
contents: read
5350
steps:
54-
- name: Setup environment ubuntu-18.04
55-
if: matrix.os == 'ubuntu-18.04'
51+
- name: Setup environment
5652
run: |
5753
sudo apt update
5854
sudo apt install -yyq gcc-7 g++-7 clang-6.0 libsystemd-dev gcovr libyaml-dev
5955
sudo ln -s /usr/bin/llvm-symbolizer-6.0 /usr/bin/llvm-symbolizer || true
6056
6157
- uses: actions/checkout@v3
58+
6259
- uses: actions/checkout@v3
6360
with:
6461
repository: calyptia/fluent-bit-ci
6562
path: ci
6663

67-
- name: Run ci/s/run-unit-tests.sh on ${{ matrix.os }} with ${{ matrix.compiler }} - ${{ matrix.flb_option }}
68-
if: matrix.os == 'ubuntu-18.04'
64+
- name: ${{ matrix.compiler }} - ${{ matrix.flb_option }}
6965
run: |
7066
echo "CC = $CC, CXX = $CXX, FLB_OPT = $FLB_OPT"
7167
sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-7 90
@@ -78,25 +74,56 @@ jobs:
7874
CXX: ${{ matrix.compiler }}
7975
FLB_OPT: ${{ matrix.flb_option }}
8076

81-
- name: Run ci/s/run-unit-tests.sh on ${{ matrix.os }} with ${{ matrix.compiler }} - ${{ matrix.flb_option }}
82-
if: matrix.os == 'macos-latest'
77+
run-macos-unit-tests:
78+
# We chain this after Linux one as there are costs and restrictions associated
79+
needs:
80+
- run-ubuntu-unit-tests
81+
runs-on: macos-latest
82+
timeout-minutes: 30
83+
strategy:
84+
fail-fast: false
85+
matrix:
86+
flb_option:
87+
- "-DFLB_JEMALLOC=Off"
88+
- "-DFLB_SANITIZE_MEMORY=On"
89+
- "-DFLB_SANITIZE_THREAD=On"
90+
compiler:
91+
- gcc
92+
permissions:
93+
contents: read
94+
steps:
95+
- uses: actions/checkout@v3
96+
- uses: actions/checkout@v3
97+
with:
98+
repository: calyptia/fluent-bit-ci
99+
path: ci
100+
101+
- name: ${{ matrix.compiler }} - ${{ matrix.flb_option }}
102+
# Currently MacOS is unsupported so we do not want to fail on any errors here, the unit tests are for information
103+
# during review - they should pass still.
104+
continue-on-error: true
83105
run: |
84106
echo "CC = $CC, CXX = $CXX, FLB_OPT = $FLB_OPT"
85107
brew update
86108
brew install bison flex || true
87-
ci/scripts/run-unit-tests.sh || true
109+
ci/scripts/run-unit-tests.sh
88110
env:
89111
CC: gcc
90112
CXX: g++
91113
FLB_OPT: ${{ matrix.flb_option }}
92114

93115
# Required check looks at this so do not remove
94116
run-all-unit-tests:
95-
if: ${{ always() }}
117+
if: always()
96118
runs-on: ubuntu-latest
97119
name: Unit tests (matrix)
98-
needs: run-unit-tests-amd64
120+
permissions:
121+
contents: none
122+
needs:
123+
- run-macos-unit-tests
124+
- run-ubuntu-unit-tests
99125
steps:
100126
- name: Check build matrix status
101-
if: ${{ needs.run-unit-tests-amd64.result != 'success' }}
127+
# Ignore MacOS failures
128+
if: ${{ needs.run-ubuntu-unit-tests.result != 'success' }}
102129
run: exit 1

0 commit comments

Comments
 (0)