|
6 | 6 | - main |
7 | 7 | - v*-branch |
8 | 8 | - collab-* |
| 9 | + - topic/twister/filter_cache |
9 | 10 | pull_request_target: |
10 | 11 | branches: |
11 | 12 | - main |
@@ -56,28 +57,28 @@ jobs: |
56 | 57 | echo "ZEPHYR_RUNNER_CLOUD_POD = ${ZEPHYR_RUNNER_CLOUD_POD}" |
57 | 58 |
|
58 | 59 | - name: Clone cached Zephyr repository |
59 | | - if: github.event_name == 'pull_request_target' |
| 60 | + #if: github.event_name == 'pull_request_target' |
60 | 61 | continue-on-error: true |
61 | 62 | run: | |
62 | 63 | git clone --shared /repo-cache/zephyrproject/zephyr . |
63 | 64 | git remote set-url origin ${GITHUB_SERVER_URL}/${GITHUB_REPOSITORY} |
64 | 65 |
|
65 | 66 | - name: Checkout |
66 | | - if: github.event_name == 'pull_request_target' |
| 67 | + #if: github.event_name == 'pull_request_target' |
67 | 68 | uses: actions/checkout@v4 |
68 | 69 | with: |
69 | 70 | ref: ${{ github.event.pull_request.head.sha }} |
70 | 71 | fetch-depth: 0 |
71 | 72 | persist-credentials: false |
72 | 73 |
|
73 | 74 | - name: Environment Setup |
74 | | - if: github.event_name == 'pull_request_target' |
| 75 | + #if: github.event_name == 'pull_request_target' |
75 | 76 | run: | |
76 | 77 | git config --global user.email "[email protected]" |
77 | 78 | git config --global user.name "Zephyr Bot" |
78 | | - rm -fr ".git/rebase-apply" |
79 | | - git rebase origin/${BASE_REF} |
80 | | - git clean -f -d |
| 79 | + #rm -fr ".git/rebase-apply" |
| 80 | + #git rebase origin/${BASE_REF} |
| 81 | + #git clean -f -d |
81 | 82 | git log --pretty=oneline | head -n 10 |
82 | 83 | west init -l . || true |
83 | 84 | west config manifest.group-filter -- +ci,+optional |
@@ -123,6 +124,29 @@ jobs: |
123 | 124 | echo "subset=${subset}" >> $GITHUB_OUTPUT |
124 | 125 | echo "size=${size}" >> $GITHUB_OUTPUT |
125 | 126 | echo "fullrun=${TWISTER_FULL}" >> $GITHUB_OUTPUT |
| 127 | + - name: generate filter cache |
| 128 | + if: github.event_name == 'push' |
| 129 | + run: | |
| 130 | + export ZEPHYR_BASE=${PWD} |
| 131 | + export ZEPHYR_TOOLCHAIN_VARIANT=zephyr |
| 132 | + python3 ./scripts/twister --cmake-only -T samples/synchronization/ --outdir filter_cache --force-color --inline-logs -v |
| 133 | + cd filter_cache |
| 134 | + for d in `ls -1`; do |
| 135 | + mkdir -p cache/${d}; |
| 136 | + test -f $d/samples/synchronization/sample.kernel.synchronization/zephyr/.config && \ |
| 137 | + cp $d/samples/synchronization/sample.kernel.synchronization/zephyr/.config cache/${d} && \ |
| 138 | + cp $d/samples/synchronization/sample.kernel.synchronization/zephyr/edt.pickle cache/${d} && \ |
| 139 | + cp $d/samples/synchronization/sample.kernel.synchronization/CMakeCache.txt cache/${d}; |
| 140 | + done |
| 141 | + mv cache ../twister_cache |
| 142 | + - name: Upload Filter Cache |
| 143 | + if: always() |
| 144 | + uses: actions/upload-artifact@v4 |
| 145 | + with: |
| 146 | + name: filter_cache |
| 147 | + if-no-files-found: ignore |
| 148 | + path: | |
| 149 | + twister_cache |
126 | 150 |
|
127 | 151 | twister-build: |
128 | 152 | runs-on: |
@@ -228,12 +252,18 @@ jobs: |
228 | 252 | west update |
229 | 253 | make everything -s -j 8 |
230 | 254 |
|
| 255 | + - if: github.event_name == 'push' |
| 256 | + name: Download Artifacts |
| 257 | + uses: actions/download-artifact@v4 |
| 258 | + with: |
| 259 | + path: filter_cache |
| 260 | + |
231 | 261 | - if: github.event_name == 'push' |
232 | 262 | name: Run Tests with Twister (Push) |
233 | 263 | run: | |
234 | 264 | export ZEPHYR_BASE=${PWD} |
235 | 265 | export ZEPHYR_TOOLCHAIN_VARIANT=zephyr |
236 | | - ./scripts/twister --subset ${{matrix.subset}}/${{ strategy.job-total }} ${TWISTER_COMMON} ${PUSH_OPTIONS} |
| 266 | + ./scripts/twister --subset ${{matrix.subset}}/${{ strategy.job-total }} ${TWISTER_COMMON} ${PUSH_OPTIONS} --filter-cache filter_cache/filter_cache |
237 | 267 | if [ "${{matrix.subset}}" = "1" ]; then |
238 | 268 | ./scripts/zephyr_module.py --twister-out module_tests.args |
239 | 269 | if [ -s module_tests.args ]; then |
|
0 commit comments