From b2086d19762e73fb0d8db894bebc45f657692e97 Mon Sep 17 00:00:00 2001 From: Anas Nashif Date: Wed, 20 Nov 2024 19:02:39 -0500 Subject: [PATCH 1/6] ci: twister: convert to pull_request Signed-off-by: Anas Nashif --- .github/workflows/twister-prep.yaml | 2 +- .github/workflows/twister-publish.yaml | 2 +- .github/workflows/twister.yaml | 6 +++--- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/.github/workflows/twister-prep.yaml b/.github/workflows/twister-prep.yaml index 4c8b03a5418..a54609668b5 100644 --- a/.github/workflows/twister-prep.yaml +++ b/.github/workflows/twister-prep.yaml @@ -15,7 +15,7 @@ on: jobs: prep_pr: - if: github.repository_owner == 'zephyrproject-rtos' && github.event_name == 'pull_request_target' + if: github.repository_owner == 'zephyrproject-rtos' && github.event_name == 'pull_request' runs-on: group: zephyr-runner-v2-linux-x64-4xlarge container: diff --git a/.github/workflows/twister-publish.yaml b/.github/workflows/twister-publish.yaml index f59a3edca3d..4e02047a33e 100644 --- a/.github/workflows/twister-publish.yaml +++ b/.github/workflows/twister-publish.yaml @@ -12,7 +12,7 @@ jobs: upload-to-elasticsearch: if: | github.repository == 'zephyrproject-rtos/zephyr' && - github.event.workflow_run.event != 'pull_request_target' + github.event.workflow_run.event != 'pull_request' env: ELASTICSEARCH_KEY: ${{ secrets.ELASTICSEARCH_KEY }} ELASTICSEARCH_SERVER: "https://elasticsearch.zephyrproject.io:443" diff --git a/.github/workflows/twister.yaml b/.github/workflows/twister.yaml index 0fa810b3dd7..6634ebb9a3a 100644 --- a/.github/workflows/twister.yaml +++ b/.github/workflows/twister.yaml @@ -6,7 +6,7 @@ on: - main - v*-branch - collab-* - pull_request_target: + pull_request: branches: - main - v*-branch @@ -80,7 +80,7 @@ jobs: - name: Environment Setup run: | - if [ "${{github.event_name}}" = "pull_request_target" ]; then + if [ "${{github.event_name}}" = "pull_request" ]; then git config --global user.email "bot@zephyrproject.org" git config --global user.name "Zephyr Builder" rm -fr ".git/rebase-apply" @@ -141,7 +141,7 @@ jobs: fi fi - - if: github.event_name == 'pull_request_target' + - if: github.event_name == 'pull_request' name: Run Tests with Twister (Pull Request) id: run_twister_pr run: | From aae46831a423b2ef45c6999d680177dc9f4c5ef4 Mon Sep 17 00:00:00 2001 From: Anas Nashif Date: Sat, 23 Nov 2024 06:49:54 -0500 Subject: [PATCH 2/6] convert compliance to workflow_call Signed-off-by: Anas Nashif --- .github/workflows/compliance.yml | 7 +------ .github/workflows/twister.yaml | 4 ++++ 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/.github/workflows/compliance.yml b/.github/workflows/compliance.yml index ecd874dd486..144754eb832 100644 --- a/.github/workflows/compliance.yml +++ b/.github/workflows/compliance.yml @@ -1,12 +1,7 @@ name: Compliance Checks on: - pull_request: - types: - - edited - - opened - - reopened - - synchronize + workflow_call: jobs: check_compliance: diff --git a/.github/workflows/twister.yaml b/.github/workflows/twister.yaml index 6634ebb9a3a..4f29df49ab1 100644 --- a/.github/workflows/twister.yaml +++ b/.github/workflows/twister.yaml @@ -20,7 +20,11 @@ concurrency: cancel-in-progress: true jobs: + compliance-check: + uses: ./.github/workflows/compliance.yml + twister-build-prep: + needs: compliance-check uses: ./.github/workflows/twister-prep.yaml twister-build: From 922a522041ba7230bbbcedcdbf81d97c4efb095d Mon Sep 17 00:00:00 2001 From: Anas Nashif Date: Fri, 29 Nov 2024 20:24:50 -0500 Subject: [PATCH 3/6] compliance on pr only Signed-off-by: Anas Nashif --- .github/workflows/compliance.yml | 1 + .github/workflows/twister.yaml | 1 + 2 files changed, 2 insertions(+) diff --git a/.github/workflows/compliance.yml b/.github/workflows/compliance.yml index 144754eb832..4938b1dce1e 100644 --- a/.github/workflows/compliance.yml +++ b/.github/workflows/compliance.yml @@ -5,6 +5,7 @@ on: jobs: check_compliance: + if: github.event_name == 'pull_request' runs-on: ubuntu-22.04 name: Run compliance checks on patch series (PR) steps: diff --git a/.github/workflows/twister.yaml b/.github/workflows/twister.yaml index 4f29df49ab1..58e434db13e 100644 --- a/.github/workflows/twister.yaml +++ b/.github/workflows/twister.yaml @@ -25,6 +25,7 @@ jobs: twister-build-prep: needs: compliance-check + if: always() uses: ./.github/workflows/twister-prep.yaml twister-build: From a24753a52888c6ac7f3149228ebe082918521aef Mon Sep 17 00:00:00 2001 From: Anas Nashif Date: Fri, 29 Nov 2024 20:39:42 -0500 Subject: [PATCH 4/6] limit scope --- .github/workflows/twister.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/twister.yaml b/.github/workflows/twister.yaml index 58e434db13e..9372abca602 100644 --- a/.github/workflows/twister.yaml +++ b/.github/workflows/twister.yaml @@ -138,7 +138,7 @@ jobs: run: | export ZEPHYR_BASE=${PWD} export ZEPHYR_TOOLCHAIN_VARIANT=zephyr - ./scripts/twister --subset ${{matrix.subset}}/${{ strategy.job-total }} ${TWISTER_COMMON} ${PUSH_OPTIONS} + ./scripts/twister -T tests/kernel/threads --subset ${{matrix.subset}}/${{ strategy.job-total }} ${TWISTER_COMMON} ${PUSH_OPTIONS} if [ "${{matrix.subset}}" = "1" ]; then ./scripts/zephyr_module.py --twister-out module_tests.args if [ -s module_tests.args ]; then From 4f047cbf96979c36ee086aba3211004458ec1def Mon Sep 17 00:00:00 2001 From: Anas Nashif Date: Fri, 29 Nov 2024 20:44:10 -0500 Subject: [PATCH 5/6] do nothing --- .github/workflows/compliance.yml | 9 +++++++++ .github/workflows/twister.yaml | 1 - 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/.github/workflows/compliance.yml b/.github/workflows/compliance.yml index 4938b1dce1e..e7ae5f8fead 100644 --- a/.github/workflows/compliance.yml +++ b/.github/workflows/compliance.yml @@ -4,6 +4,15 @@ on: workflow_call: jobs: + check_compliance_push: + if: github.event_name == 'push' + runs-on: ubuntu-22.04 + name: Run compliance checks on patch series (PR) + steps: + - name: Do nothing + run: | + echo "Doing nothing" + check_compliance: if: github.event_name == 'pull_request' runs-on: ubuntu-22.04 diff --git a/.github/workflows/twister.yaml b/.github/workflows/twister.yaml index 9372abca602..2f419ace572 100644 --- a/.github/workflows/twister.yaml +++ b/.github/workflows/twister.yaml @@ -25,7 +25,6 @@ jobs: twister-build-prep: needs: compliance-check - if: always() uses: ./.github/workflows/twister-prep.yaml twister-build: From a0ec1ea4f685dc7db5313bdf74f3407a090976b0 Mon Sep 17 00:00:00 2001 From: Anas Nashif Date: Sat, 30 Nov 2024 07:49:12 -0500 Subject: [PATCH 6/6] tests: dummy pr This is a dummy Signed-off-by: Anas Nashif --- tests/kernel/semaphore/semaphore/src/main.c | 1 + 1 file changed, 1 insertion(+) diff --git a/tests/kernel/semaphore/semaphore/src/main.c b/tests/kernel/semaphore/semaphore/src/main.c index 97816a3a47a..1f22916d37a 100644 --- a/tests/kernel/semaphore/semaphore/src/main.c +++ b/tests/kernel/semaphore/semaphore/src/main.c @@ -1,4 +1,5 @@ /* + * Copyright (c) 2016, 2020 Intel Corporation * * SPDX-License-Identifier: Apache-2.0