11name : Build with Clang/LLVM
2-
3- on : pull_request_target
2+ on :
3+ push :
4+ branches :
5+ - main
6+ - v*-branch
7+ - collab-*
8+ permissions :
9+ contents : read
410
511concurrency :
612 group : ${{ github.workflow }}-${{ github.event_name }}-${{ github.head_ref || github.ref }}
@@ -10,23 +16,21 @@ jobs:
1016 clang-build :
1117 if : github.repository_owner == 'zephyrproject-rtos'
1218 runs-on :
13- group : zephyr -runner-v2-linux-x64-4xlarge
19+ group : test -runner-v2-linux-x64-4xlarge
1420 container :
1521 image : ghcr.io/zephyrproject-rtos/ci-repo-cache:v0.27.4.20241026
1622 options : ' --entrypoint /bin/bash'
1723 strategy :
1824 fail-fast : false
1925 matrix :
20- platform : ["native_sim" ]
26+ subset : [1, 2 ]
2127 env :
2228 CCACHE_DIR : /node-cache/ccache-zephyr
2329 CCACHE_REMOTE_STORAGE : " redis://cache-*.keydb-cache.svc.cluster.local|shards=1,2,3"
2430 CCACHE_REMOTE_ONLY : " true"
31+ CCACHE_IGNOREOPTIONS : ' -specs=* --specs=*'
2532 LLVM_TOOLCHAIN_PATH : /usr/lib/llvm-16
26- COMMIT_RANGE : ${{ github.event.pull_request.base.sha }}..${{ github.event.pull_request.head.sha }}
2733 BASE_REF : ${{ github.base_ref }}
28- outputs :
29- report_needed : ${{ steps.twister.outputs.report_needed }}
3034 steps :
3135 - name : Apply container owner mismatch workaround
3236 run : |
5155 - name : Checkout
5256 uses : actions/checkout@v4
5357 with :
54- ref : ${{ github.event.pull_request.head.sha }}
5558 fetch-depth : 0
5659 persist-credentials : false
5760
6265 git config --global user.name "Zephyr Bot"
6366 rm -fr ".git/rebase-apply"
6467 rm -fr ".git/rebase-merge"
65- git rebase origin/${BASE_REF}
6668 git clean -f -d
6769 git log --pretty=oneline | head -n 10
6870 west init -l . || true
@@ -107,36 +109,31 @@ jobs:
107109 export ZEPHYR_BASE=${PWD}
108110 export ZEPHYR_TOOLCHAIN_VARIANT=llvm
109111
110- # check if we need to run a full twister or not based on files changed
111- python3 ./scripts/ci/test_plan.py --no-detailed-test-id --platform ${{ matrix.platform }} -c origin/${BASE_REF}..
112-
113- # We can limit scope to just what has changed
114- if [ -s testplan.json ]; then
115- echo "report_needed=1" >> $GITHUB_OUTPUT
116- # Full twister but with options based on changes
117- ./scripts/twister --no-detailed-test-id --force-color --inline-logs -M -N -v --load-tests testplan.json --retry-failed 2
118- else
119- # if nothing is run, skip reporting step
120- echo "report_needed=0" >> $GITHUB_OUTPUT
121- fi
112+ ./scripts/twister -p native_sim --no-detailed-test-id --force-color --inline-logs -M -N -v --retry-failed 2 \
113+ -T tests --subset ${{matrix.subset}}/2
122114
123115 - name : Print ccache stats
124116 if : always()
125117 run : |
126118 ccache -s -vv
127119
128120 - name : Upload Unit Test Results
129- if : always() && steps.twister.outputs.report_needed != 0
121+ if : always()
130122 uses : actions/upload-artifact@v4
131123 with :
132- name : Unit Test Results (Subset ${{ matrix.platform }})
133- path : twister-out/twister.xml
124+ name : Unit Test Results (Subset ${{ matrix.subset }})
125+ path : |
126+ twister-out/twister.xml
127+ twister-out/twister.json
128+ if-no-files-found : ignore
134129
135130 clang-build-results :
136131 name : " Publish Unit Tests Results"
137132 needs : clang-build
138- runs-on : ubuntu-22.04
139- if : (success() || failure() ) && needs.clang-build.outputs.report_needed != 0
133+ runs-on : ubuntu-24.04
134+ permissions :
135+ checks : write # to create GitHub annotations
136+ if : (success() || failure())
140137 steps :
141138 - name : Download Artifacts
142139 uses : actions/download-artifact@v4
0 commit comments