diff --git a/.github/workflows/compliance.yml b/.github/workflows/compliance.yml index a91a8e534cc..ff044e6ef93 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: @@ -24,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 @@ -42,6 +40,7 @@ jobs: pip3 install west - name: west setup + if: github.event_name == 'pull_request' env: BASE_REF: ${{ github.base_ref }} run: | @@ -60,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: | @@ -68,6 +67,7 @@ jobs: exit 1 - name: Run Compliance Tests + if: github.event_name == 'pull_request' continue-on-error: true id: compliance env: @@ -83,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: @@ -90,6 +91,7 @@ jobs: path: compliance.xml - name: check-warns + if: github.event_name == 'pull_request' run: | if [[ ! -s "compliance.xml" ]]; then exit 1; 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..0a0560a2086 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 @@ -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: @@ -80,7 +84,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 +145,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: | 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