@@ -24,7 +24,102 @@ concurrency:
2424
2525jobs :
2626 twister-build-prep :
27- uses : ./.github/workflows/twister-prep.yaml
27+ if : github.repository_owner == 'zephyrproject-rtos'
28+ runs-on : ubuntu-24.04
29+ outputs :
30+ subset : ${{ steps.output-services.outputs.subset }}
31+ size : ${{ steps.output-services.outputs.size }}
32+ fullrun : ${{ steps.output-services.outputs.fullrun }}
33+ env :
34+ MATRIX_SIZE : 10
35+ PUSH_MATRIX_SIZE : 20
36+ WEEKLY_MATRIX_SIZE : 200
37+ BSIM_OUT_PATH : /opt/bsim/
38+ BSIM_COMPONENTS_PATH : /opt/bsim/components
39+ TESTS_PER_BUILDER : 900
40+ COMMIT_RANGE : ${{ github.event.pull_request.base.sha }}..${{ github.event.pull_request.head.sha }}
41+ BASE_REF : ${{ github.base_ref }}
42+ steps :
43+ - name : Checkout
44+ if : github.event_name == 'pull_request'
45+ uses : actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
46+ with :
47+ ref : ${{ github.event.pull_request.head.sha }}
48+ fetch-depth : 0
49+ path : zephyr
50+ persist-credentials : false
51+
52+ - name : Set up Python
53+ if : github.event_name == 'pull_request'
54+ uses : actions/setup-python@42375524e23c412d93fb67b49958b491fce71c38 # v5.4.0
55+ with :
56+ python-version : 3.12
57+ cache : pip
58+ cache-dependency-path : scripts/requirements-actions.txt
59+
60+ - name : install-packages
61+ working-directory : zephyr
62+ if : github.event_name == 'pull_request'
63+ run : |
64+ pip install -r scripts/requirements-actions.txt --require-hashes
65+
66+ - name : Setup Zephyr project
67+ if : github.event_name == 'pull_request'
68+ uses : zephyrproject-rtos/action-zephyr-setup@f7b70269a8eb01f70c8e710891e4c94972a2f6b4 # v1.0.6
69+ with :
70+ app-path : zephyr
71+ toolchains : all
72+
73+ - name : Environment Setup
74+ working-directory : zephyr
75+ if : github.event_name == 'pull_request'
76+ run : |
77+ git config --global user.email "[email protected] " 78+ git config --global user.name "Zephyr Bot"
79+ rm -fr ".git/rebase-apply"
80+ rm -fr ".git/rebase-merge"
81+ git rebase origin/${BASE_REF}
82+ git clean -f -d
83+ git log --pretty=oneline | head -n 10
84+
85+ - name : Generate Test Plan with Twister
86+ working-directory : zephyr
87+ if : github.event_name == 'pull_request'
88+ id : test-plan
89+ run : |
90+ export ZEPHYR_BASE=${PWD}
91+ export ZEPHYR_TOOLCHAIN_VARIANT=zephyr
92+ python3 ./scripts/ci/test_plan.py -c origin/${BASE_REF}.. --no-detailed-test-id --pull-request -t $TESTS_PER_BUILDER
93+ if [ -s .testplan ]; then
94+ cat .testplan >> $GITHUB_ENV
95+ else
96+ echo "TWISTER_NODES=${MATRIX_SIZE}" >> $GITHUB_ENV
97+ fi
98+ rm -f testplan.json .testplan
99+
100+ - name : Determine matrix size
101+ id : output-services
102+ run : |
103+ if [ "${{github.event_name}}" = "push" ]; then
104+ subset="[$(seq -s',' 1 ${PUSH_MATRIX_SIZE})]"
105+ size=${MATRIX_SIZE}
106+ elif [ "${{github.event_name}}" = "pull_request" ]; then
107+ if [ -n "${TWISTER_NODES}" ]; then
108+ subset="[$(seq -s',' 1 ${TWISTER_NODES})]"
109+ else
110+ subset="[$(seq -s',' 1 ${MATRIX_SIZE})]"
111+ fi
112+ size=${TWISTER_NODES}
113+ elif [ "${{github.event_name}}" = "schedule" -a "${{github.repository}}" = "zephyrproject-rtos/zephyr" ]; then
114+ subset="[$(seq -s',' 1 ${WEEKLY_MATRIX_SIZE})]"
115+ size=${WEEKLY_MATRIX_SIZE}
116+ else
117+ size=0
118+ fi
119+
120+ echo "subset=${subset}" >> $GITHUB_OUTPUT
121+ echo "size=${size}" >> $GITHUB_OUTPUT
122+ echo "fullrun=${TWISTER_FULL}" >> $GITHUB_OUTPUT
28123
29124 twister-build :
30125 runs-on :
0 commit comments