Skip to content

Commit f0876d4

Browse files
committed
[nrf noup] action: clang: parallel execution
Bring back parallel execution to the clang action. In the upstream they went to use a single dedicated powerfull agent to run this. We need to keep this as we have to base on agents available in github's cloud. Signed-off-by: Maciej Perkowski <[email protected]>
1 parent fced077 commit f0876d4

File tree

1 file changed

+16
-7
lines changed

1 file changed

+16
-7
lines changed

.github/workflows/clang.yaml

Lines changed: 16 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -21,12 +21,13 @@ jobs:
2121
strategy:
2222
fail-fast: false
2323
matrix:
24-
platform: ["native_posix"]
24+
subset: [1, 2, 3, 4, 5]
2525
env:
2626
ZEPHYR_SDK_INSTALL_DIR: /opt/toolchains/zephyr-sdk-0.13.2
2727
CLANG_ROOT_DIR: /usr/lib/llvm-12
2828
COMMIT_RANGE: ${{ github.event.pull_request.base.sha }}..${{ github.event.pull_request.head.sha }}
2929
BASE_REF: ${{ github.base_ref }}
30+
MATRIX_SIZE: 5
3031
outputs:
3132
report_needed: ${{ steps.twister.outputs.report_needed }}
3233
steps:
@@ -81,7 +82,7 @@ jobs:
8182
id: cache-ccache
8283
uses: nashif/action-s3-cache@master
8384
with:
84-
key: ${{ steps.ccache_cache_timestamp.outputs.repo }}-${{ github.ref_name }}-clang-${{ matrix.platform }}-ccache
85+
key: ${{ steps.ccache_cache_timestamp.outputs.repo }}-${{ github.ref_name }}-clang-${{ matrix.subset }}-ccache
8586
path: /github/home/.ccache
8687
aws-s3-bucket: ccache.zephyrproject.org
8788
aws-access-key-id: ${{ secrets.CCACHE_S3_ACCESS_KEY_ID }}
@@ -94,21 +95,29 @@ jobs:
9495
test -d github/home/.ccache && rm -rf /github/home/.ccache && mv github/home/.ccache /github/home/.ccache
9596
ccache -M 10G -s
9697
97-
- name: Run Tests with Twister
98+
- name: Build test plan with Twister
9899
working-directory: ./zephyr
99-
id: twister
100+
id: twister_test_plan
100101
run: |
101102
export ZEPHYR_BASE=${PWD}
102103
export ZEPHYR_TOOLCHAIN_VARIANT=llvm
103104
104105
# check if we need to run a full twister or not based on files changed
105-
python3 ./scripts/ci/test_plan.py --platform ${{ matrix.platform }} -c origin/${BASE_REF}..
106+
python3 ./scripts/ci/test_plan.py -p native_posix -c origin/${BASE_REF}..
107+
108+
109+
- name: Run Tests with Twister
110+
working-directory: ./zephyr
111+
id: twister
112+
run: |
113+
export ZEPHYR_BASE=${PWD}
114+
export ZEPHYR_TOOLCHAIN_VARIANT=llvm
106115
107116
# We can limit scope to just what has changed
108117
if [ -s testplan.csv ]; then
109118
echo "::set-output name=report_needed::1";
110119
# Full twister but with options based on changes
111-
./scripts/twister --inline-logs -M -N -v --load-tests testplan.csv --retry-failed 2
120+
./scripts/twister --inline-logs -M -N -v --load-tests testplan.csv --retry-failed 2 --subset ${{matrix.subset}}/${MATRIX_SIZE}
112121
else
113122
# if nothing is run, skip reporting step
114123
echo "::set-output name=report_needed::0";
@@ -123,7 +132,7 @@ jobs:
123132
if: always() && steps.twister.outputs.report_needed != 0
124133
uses: actions/upload-artifact@v2
125134
with:
126-
name: Unit Test Results (Subset ${{ matrix.platform }})
135+
name: Unit Test Results (Subset ${{ matrix.subset }})
127136
path: zephyr/twister-out/twister.xml
128137

129138
clang-build-results:

0 commit comments

Comments
 (0)