-
Notifications
You must be signed in to change notification settings - Fork 25
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
- Loading branch information
Showing
3 changed files
with
235 additions
and
101 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,115 @@ | ||
name: Prep PR | ||
|
||
on: | ||
workflow_call: | ||
outputs: | ||
subset: | ||
description: subset | ||
value: ${{ jobs.prep.outputs.subset }} | ||
size: | ||
description: size | ||
value: ${{ jobs.prep.outputs.size }} | ||
fullrun: | ||
description: fullrun | ||
value: ${{ jobs.prep.outputs.fullrun }} | ||
|
||
jobs: | ||
prep: | ||
if: github.repository_owner == 'zephyrproject-rtos' | ||
runs-on: | ||
group: zephyr-runner-v2-linux-x64-4xlarge | ||
container: | ||
image: ghcr.io/zephyrproject-rtos/ci-repo-cache:v0.27.4.20241026 | ||
options: '--entrypoint /bin/bash' | ||
outputs: | ||
subset: ${{ steps.output-services.outputs.subset }} | ||
size: ${{ steps.output-services.outputs.size }} | ||
fullrun: ${{ steps.output-services.outputs.fullrun }} | ||
env: | ||
MATRIX_SIZE: 10 | ||
PUSH_MATRIX_SIZE: 20 | ||
DAILY_MATRIX_SIZE: 80 | ||
BSIM_OUT_PATH: /opt/bsim/ | ||
BSIM_COMPONENTS_PATH: /opt/bsim/components | ||
TESTS_PER_BUILDER: 700 | ||
COMMIT_RANGE: ${{ github.event.pull_request.base.sha }}..${{ github.event.pull_request.head.sha }} | ||
BASE_REF: ${{ github.base_ref }} | ||
steps: | ||
- name: Apply container owner mismatch workaround | ||
run: | | ||
# FIXME: The owner UID of the GITHUB_WORKSPACE directory may not | ||
# match the container user UID because of the way GitHub | ||
# Actions runner is implemented. Remove this workaround when | ||
# GitHub comes up with a fundamental fix for this problem. | ||
git config --global --add safe.directory ${GITHUB_WORKSPACE} | ||
- name: Print cloud service information | ||
run: | | ||
echo "ZEPHYR_RUNNER_CLOUD_PROVIDER = ${ZEPHYR_RUNNER_CLOUD_PROVIDER}" | ||
echo "ZEPHYR_RUNNER_CLOUD_NODE = ${ZEPHYR_RUNNER_CLOUD_NODE}" | ||
echo "ZEPHYR_RUNNER_CLOUD_POD = ${ZEPHYR_RUNNER_CLOUD_POD}" | ||
- name: Clone cached Zephyr repository | ||
continue-on-error: true | ||
run: | | ||
git clone --shared /repo-cache/zephyrproject/zephyr . | ||
git remote set-url origin ${GITHUB_SERVER_URL}/${GITHUB_REPOSITORY} | ||
- name: Checkout | ||
uses: actions/checkout@v4 | ||
with: | ||
ref: ${{ github.event.pull_request.head.sha }} | ||
fetch-depth: 0 | ||
persist-credentials: false | ||
|
||
- name: Environment Setup | ||
run: | | ||
git config --global user.email "bot@zephyrproject.org" | ||
git config --global user.name "Zephyr Bot" | ||
rm -fr ".git/rebase-apply" | ||
git rebase origin/${BASE_REF} | ||
git clean -f -d | ||
git log --pretty=oneline | head -n 10 | ||
west init -l . || true | ||
west config manifest.group-filter -- +ci,+optional | ||
west config --global update.narrow true | ||
west update --path-cache /repo-cache/zephyrproject 2>&1 1> west.update.log || west update --path-cache /repo-cache/zephyrproject 2>&1 1> west.update.log || ( rm -rf ../modules ../bootloader ../tools && west update --path-cache /repo-cache/zephyrproject) | ||
west forall -c 'git reset --hard HEAD' | ||
echo "ZEPHYR_SDK_INSTALL_DIR=/opt/toolchains/zephyr-sdk-$( cat SDK_VERSION )" >> $GITHUB_ENV | ||
- name: Generate Test Plan with Twister | ||
id: test-plan | ||
run: | | ||
export ZEPHYR_BASE=${PWD} | ||
export ZEPHYR_TOOLCHAIN_VARIANT=zephyr | ||
python3 ./scripts/ci/test_plan.py -c origin/${BASE_REF}.. --pull-request -t $TESTS_PER_BUILDER | ||
if [ -s .testplan ]; then | ||
cat .testplan >> $GITHUB_ENV | ||
else | ||
echo "TWISTER_NODES=${MATRIX_SIZE}" >> $GITHUB_ENV | ||
fi | ||
rm -f testplan.json .testplan | ||
- name: Determine matrix size | ||
id: output-services | ||
run: | | ||
if [ "${{github.event_name}}" = "pull_request_target" ]; then | ||
if [ -n "${TWISTER_NODES}" ]; then | ||
subset="[$(seq -s',' 1 ${TWISTER_NODES})]" | ||
else | ||
subset="[$(seq -s',' 1 ${MATRIX_SIZE})]" | ||
fi | ||
size=${TWISTER_NODES} | ||
elif [ "${{github.event_name}}" = "push" ]; then | ||
subset="[$(seq -s',' 1 ${PUSH_MATRIX_SIZE})]" | ||
size=${MATRIX_SIZE} | ||
elif [ "${{github.event_name}}" = "schedule" -a "${{github.repository}}" = "zephyrproject-rtos/zephyr" ]; then | ||
subset="[$(seq -s',' 1 ${DAILY_MATRIX_SIZE})]" | ||
size=${DAILY_MATRIX_SIZE} | ||
else | ||
size=0 | ||
fi | ||
echo "subset=${subset}" >> $GITHUB_OUTPUT | ||
echo "size=${size}" >> $GITHUB_OUTPUT | ||
echo "fullrun=${TWISTER_FULL}" >> $GITHUB_OUTPUT |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,114 @@ | ||
name: Prep | ||
|
||
on: | ||
workflow_call: | ||
outputs: | ||
subset: | ||
description: subset | ||
value: ${{ jobs.prep_push.outputs.subset }} || ${{ jobs.prep_pr.outputs.subset }} | ||
size: | ||
description: size | ||
value: ${{ jobs.prep_push.outputs.size }} || ${{ jobs.prep_pr.outputs.size }} | ||
fullrun: | ||
description: fullrun | ||
value: ${{ jobs.prep_push.outputs.fullrun }} || ${{ jobs.prep_pr.outputs.size }} | ||
|
||
jobs: | ||
prep_pr: | ||
if: github.repository_owner == 'zephyrproject-rtos' && github.event_name == 'pull_request_target' | ||
runs-on: ubuntu-22.04 | ||
outputs: | ||
subset: ${{ steps.output-services.outputs.subset }} | ||
size: ${{ steps.output-services.outputs.size }} | ||
fullrun: ${{ steps.output-services.outputs.fullrun }} | ||
env: | ||
MATRIX_SIZE: 10 | ||
PUSH_MATRIX_SIZE: 20 | ||
DAILY_MATRIX_SIZE: 80 | ||
BSIM_OUT_PATH: /opt/bsim/ | ||
BSIM_COMPONENTS_PATH: /opt/bsim/components | ||
TESTS_PER_BUILDER: 700 | ||
COMMIT_RANGE: ${{ github.event.pull_request.base.sha }}..${{ github.event.pull_request.head.sha }} | ||
BASE_REF: ${{ github.base_ref }} | ||
steps: | ||
- name: Print cloud service information | ||
run: | | ||
echo "ZEPHYR_RUNNER_CLOUD_PROVIDER = ${ZEPHYR_RUNNER_CLOUD_PROVIDER}" | ||
echo "ZEPHYR_RUNNER_CLOUD_NODE = ${ZEPHYR_RUNNER_CLOUD_NODE}" | ||
echo "ZEPHYR_RUNNER_CLOUD_POD = ${ZEPHYR_RUNNER_CLOUD_POD}" | ||
- name: Determine matrix size | ||
id: output-services | ||
run: | | ||
if [ "${{github.event_name}}" = "pull_request_target" ]; then | ||
if [ -n "${TWISTER_NODES}" ]; then | ||
subset="[$(seq -s',' 1 ${TWISTER_NODES})]" | ||
else | ||
subset="[$(seq -s',' 1 ${MATRIX_SIZE})]" | ||
fi | ||
size=${TWISTER_NODES} | ||
elif [ "${{github.event_name}}" = "push" ]; then | ||
subset="[$(seq -s',' 1 ${PUSH_MATRIX_SIZE})]" | ||
size=${MATRIX_SIZE} | ||
elif [ "${{github.event_name}}" = "schedule" -a "${{github.repository}}" = "zephyrproject-rtos/zephyr" ]; then | ||
subset="[$(seq -s',' 1 ${DAILY_MATRIX_SIZE})]" | ||
size=${DAILY_MATRIX_SIZE} | ||
else | ||
size=0 | ||
fi | ||
echo ${subset} | ||
echo ${size} | ||
echo "subset=${subset}" >> $GITHUB_OUTPUT | ||
echo "size=${size}" >> $GITHUB_OUTPUT | ||
echo "fullrun=${TWISTER_FULL}" >> $GITHUB_OUTPUT | ||
prep_push: | ||
if: github.repository_owner == 'zephyrproject-rtos' && github.event_name == 'push' | ||
runs-on: ubuntu-22.04 | ||
outputs: | ||
subset: ${{ steps.output-services.outputs.subset }} | ||
size: ${{ steps.output-services.outputs.size }} | ||
fullrun: ${{ steps.output-services.outputs.fullrun }} | ||
env: | ||
MATRIX_SIZE: 10 | ||
PUSH_MATRIX_SIZE: 20 | ||
DAILY_MATRIX_SIZE: 80 | ||
BSIM_OUT_PATH: /opt/bsim/ | ||
BSIM_COMPONENTS_PATH: /opt/bsim/components | ||
TESTS_PER_BUILDER: 700 | ||
COMMIT_RANGE: ${{ github.event.pull_request.base.sha }}..${{ github.event.pull_request.head.sha }} | ||
BASE_REF: ${{ github.base_ref }} | ||
steps: | ||
- name: Print cloud service information | ||
run: | | ||
echo "ZEPHYR_RUNNER_CLOUD_PROVIDER = ${ZEPHYR_RUNNER_CLOUD_PROVIDER}" | ||
echo "ZEPHYR_RUNNER_CLOUD_NODE = ${ZEPHYR_RUNNER_CLOUD_NODE}" | ||
echo "ZEPHYR_RUNNER_CLOUD_POD = ${ZEPHYR_RUNNER_CLOUD_POD}" | ||
- name: Determine matrix size | ||
id: output-services | ||
run: | | ||
if [ "${{github.event_name}}" = "pull_request_target" ]; then | ||
if [ -n "${TWISTER_NODES}" ]; then | ||
subset="[$(seq -s',' 1 ${TWISTER_NODES})]" | ||
else | ||
subset="[$(seq -s',' 1 ${MATRIX_SIZE})]" | ||
fi | ||
size=${TWISTER_NODES} | ||
elif [ "${{github.event_name}}" = "push" ]; then | ||
subset="[$(seq -s',' 1 ${PUSH_MATRIX_SIZE})]" | ||
size=${MATRIX_SIZE} | ||
elif [ "${{github.event_name}}" = "schedule" -a "${{github.repository}}" = "zephyrproject-rtos/zephyr" ]; then | ||
subset="[$(seq -s',' 1 ${DAILY_MATRIX_SIZE})]" | ||
size=${DAILY_MATRIX_SIZE} | ||
else | ||
size=0 | ||
fi | ||
echo ${subset} | ||
echo ${size} | ||
echo "subset=${subset}" >> $GITHUB_OUTPUT | ||
echo "size=${size}" >> $GITHUB_OUTPUT | ||
echo "fullrun=${TWISTER_FULL}" >> $GITHUB_OUTPUT | ||
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters