11name : Build with Clang/LLVM
2-
3- on : pull_request_target
2+ on :
3+ push :
4+ branches :
5+ - main
6+ - v*-branch
7+ - collab-*
48
59concurrency :
610 group : ${{ github.workflow }}-${{ github.event_name }}-${{ github.head_ref || github.ref }}
@@ -10,23 +14,20 @@ jobs:
1014 clang-build :
1115 if : github.repository_owner == 'zephyrproject-rtos'
1216 runs-on :
13- group : zephyr -runner-v2-linux-x64-4xlarge
17+ group : test -runner-v2-linux-x64-4xlarge
1418 container :
1519 image : ghcr.io/zephyrproject-rtos/ci-repo-cache:v0.27.4.20241026
1620 options : ' --entrypoint /bin/bash'
1721 strategy :
1822 fail-fast : false
1923 matrix :
20- platform : ["native_sim" ]
24+ subset : [1, 2 ]
2125 env :
2226 CCACHE_DIR : /node-cache/ccache-zephyr
2327 CCACHE_REMOTE_STORAGE : " redis://cache-*.keydb-cache.svc.cluster.local|shards=1,2,3"
2428 CCACHE_REMOTE_ONLY : " true"
2529 LLVM_TOOLCHAIN_PATH : /usr/lib/llvm-16
26- COMMIT_RANGE : ${{ github.event.pull_request.base.sha }}..${{ github.event.pull_request.head.sha }}
2730 BASE_REF : ${{ github.base_ref }}
28- outputs :
29- report_needed : ${{ steps.twister.outputs.report_needed }}
3031 steps :
3132 - name : Apply container owner mismatch workaround
3233 run : |
5152 - name : Checkout
5253 uses : actions/checkout@v4
5354 with :
54- ref : ${{ github.event.pull_request.head.sha }}
5555 fetch-depth : 0
5656 persist-credentials : false
5757
6262 git config --global user.name "Zephyr Bot"
6363 rm -fr ".git/rebase-apply"
6464 rm -fr ".git/rebase-merge"
65- git rebase origin/${BASE_REF}
6665 git clean -f -d
6766 git log --pretty=oneline | head -n 10
6867 west init -l . || true
@@ -107,26 +106,16 @@ jobs:
107106 export ZEPHYR_BASE=${PWD}
108107 export ZEPHYR_TOOLCHAIN_VARIANT=llvm
109108
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
109+ ./scripts/twister -p native_sim --no-detailed-test-id --force-color --inline-logs -M -N -v --retry-failed 2 \
110+ -T tests/ --subset ${{matrix.subset}}/2
122111
123112 - name : Print ccache stats
124113 if : always()
125114 run : |
126115 ccache -s -vv
127116
128117 - name : Upload Unit Test Results
129- if : always() && steps.twister.outputs.report_needed != 0
118+ if : always()
130119 uses : actions/upload-artifact@v4
131120 with :
132121 name : Unit Test Results (Subset ${{ matrix.platform }})
@@ -135,8 +124,8 @@ jobs:
135124 clang-build-results :
136125 name : " Publish Unit Tests Results"
137126 needs : clang-build
138- runs-on : ubuntu-22 .04
139- if : (success() || failure() ) && needs.clang-build.outputs.report_needed != 0
127+ runs-on : ubuntu-24 .04
128+ if : (success() || failure())
140129 steps :
141130 - name : Download Artifacts
142131 uses : actions/download-artifact@v4
0 commit comments