Skip to content

Commit 6c793b0

Browse files
committed
ci: make clang workflow run on push
Signed-off-by: Anas Nashif <[email protected]>
1 parent fafa9e4 commit 6c793b0

File tree

1 file changed

+18
-26
lines changed

1 file changed

+18
-26
lines changed

.github/workflows/clang.yaml

Lines changed: 18 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,10 @@
11
name: Build with Clang/LLVM
2-
3-
on: pull_request_target
2+
on:
3+
push:
4+
branches:
5+
- main
6+
- v*-branch
7+
- collab-*
48

59
concurrency:
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: |
@@ -51,7 +52,6 @@ jobs:
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

@@ -62,7 +62,6 @@ jobs:
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,36 +106,29 @@ 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:
132-
name: Unit Test Results (Subset ${{ matrix.platform }})
133-
path: twister-out/twister.xml
121+
name: Unit Test Results (Subset ${{ matrix.subset }})
122+
path: |
123+
twister-out/twister.xml
124+
twister-out/twister.json
125+
if-no-files-found: ignore
134126

135127
clang-build-results:
136128
name: "Publish Unit Tests Results"
137129
needs: clang-build
138-
runs-on: ubuntu-22.04
139-
if: (success() || failure() ) && needs.clang-build.outputs.report_needed != 0
130+
runs-on: ubuntu-24.04
131+
if: (success() || failure())
140132
steps:
141133
- name: Download Artifacts
142134
uses: actions/download-artifact@v4

0 commit comments

Comments
 (0)