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 1845189e06b6c76e22e1e646e7695546775f5804 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..181ac07e22f 100644 --- a/.github/workflows/twister.yaml +++ b/.github/workflows/twister.yaml @@ -52,7 +52,7 @@ jobs: TWISTER_COMMON: '--no-detailed-test-id --force-color --inline-logs -v -N -M --retry-failed 3 --timeout-multiplier 2 ' WEEKLY_OPTIONS: ' -M --build-only --all --show-footprint --report-filtered' PR_OPTIONS: ' --clobber-output --integration' - PUSH_OPTIONS: ' --clobber-output -M --show-footprint --report-filtered' + PUSH_OPTIONS: ' --clobber-output -M --show-footprint --report-filtered -T tests/kernel/threads' COMMIT_RANGE: ${{ github.event.pull_request.base.sha }}..${{ github.event.pull_request.head.sha }} BASE_REF: ${{ github.base_ref }} steps: From 5c04ef444b761f9d1bfff77b502685461b58bb42 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 181ac07e22f..231210a6306 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 50b30dec350652ce6a8765463346cbb84d27bb4b Mon Sep 17 00:00:00 2001 From: Anas Nashif Date: Fri, 29 Nov 2024 22:09:58 -0500 Subject: [PATCH 6/6] kernel: test compliance test compliance. 2 Signed-off-by: Anas Nashif --- kernel/init.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/kernel/init.c b/kernel/init.c index 0327107129c..669a94633c3 100644 --- a/kernel/init.c +++ b/kernel/init.c @@ -10,7 +10,7 @@ * * This module contains routines that are used to initialize the kernel. */ - +/* blah */ #include #include #include