From 7fc61ebc7a7b4e322ff7355602346506b4cf8028 Mon Sep 17 00:00:00 2001 From: Anas Nashif Date: Wed, 20 Nov 2024 19:02:39 -0500 Subject: [PATCH 1/4] 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 01be87ffabd..e0904629c7a 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 5ddcf3134e525dce7ba63b0f6729129a6df20d79 Mon Sep 17 00:00:00 2001 From: Anas Nashif Date: Sat, 23 Nov 2024 06:49:54 -0500 Subject: [PATCH 2/4] 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 a91a8e534cc..4e43ece9077 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 e0904629c7a..0a0560a2086 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 51e34f68ad2435bbd55deed0d14f0512340ec3b2 Mon Sep 17 00:00:00 2001 From: Anas Nashif Date: Sat, 23 Nov 2024 06:54:36 -0500 Subject: [PATCH 3/4] compliance on pr only Signed-off-by: Anas Nashif --- .github/workflows/compliance.yml | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/.github/workflows/compliance.yml b/.github/workflows/compliance.yml index 4e43ece9077..ff044e6ef93 100644 --- a/.github/workflows/compliance.yml +++ b/.github/workflows/compliance.yml @@ -19,17 +19,20 @@ jobs: fetch-depth: 0 - name: Set up Python + if: github.event_name == 'pull_request' uses: actions/setup-python@v5 with: python-version: 3.11 - name: cache-pip + if: github.event_name == 'pull_request' uses: actions/cache@v4 with: path: ~/.cache/pip key: ${{ runner.os }}-pip-${{ hashFiles('.github/workflows/compliance.yml') }} - name: Install python dependencies + if: github.event_name == 'pull_request' run: | pip3 install setuptools pip3 install wheel @@ -37,6 +40,7 @@ jobs: pip3 install west - name: west setup + if: github.event_name == 'pull_request' env: BASE_REF: ${{ github.base_ref }} run: | @@ -55,7 +59,7 @@ jobs: west update -o=--depth=1 -n 2>&1 1> west.update.log || west update -o=--depth=1 -n 2>&1 1> west.update2.log - name: Check for PR description - if: ${{ github.event.pull_request.body == '' }} + if: ${{ github.event.pull_request.body == '' }} && github.event_name == 'pull_request' continue-on-error: true id: pr_description run: | @@ -63,6 +67,7 @@ jobs: exit 1 - name: Run Compliance Tests + if: github.event_name == 'pull_request' continue-on-error: true id: compliance env: @@ -78,6 +83,7 @@ jobs: -c origin/${BASE_REF}.. - name: upload-results + if: github.event_name == 'pull_request' uses: actions/upload-artifact@v4 continue-on-error: true with: @@ -85,6 +91,7 @@ jobs: path: compliance.xml - name: check-warns + if: github.event_name == 'pull_request' run: | if [[ ! -s "compliance.xml" ]]; then exit 1; From fae5e7e48aacab15fde29fca136d0f2baa4548c1 Mon Sep 17 00:00:00 2001 From: Anas Nashif Date: Sat, 23 Nov 2024 07:06:56 -0500 Subject: [PATCH 4/4] test Signed-off-by: Anas Nashif --- kernel/init.c | 1 + 1 file changed, 1 insertion(+) diff --git a/kernel/init.c b/kernel/init.c index c3b6ea9bb33..9a6d0910417 100644 --- a/kernel/init.c +++ b/kernel/init.c @@ -11,6 +11,7 @@ * This module contains routines that are used to initialize the kernel. */ + #include #include #include