Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 9 additions & 7 deletions .github/workflows/compliance.yml
Original file line number Diff line number Diff line change
@@ -1,12 +1,7 @@
name: Compliance Checks

on:
pull_request:
types:
- edited
- opened
- reopened
- synchronize
workflow_call:

jobs:
check_compliance:
Expand All @@ -24,24 +19,28 @@ 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
pip3 install python-magic lxml junitparser gitlint pylint pykwalify yamllint clang-format unidiff sphinx-lint ruff
pip3 install west

- name: west setup
if: github.event_name == 'pull_request'
env:
BASE_REF: ${{ github.base_ref }}
run: |
Expand All @@ -60,14 +59,15 @@ 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: |
echo "Pull request description cannot be empty."
exit 1

- name: Run Compliance Tests
if: github.event_name == 'pull_request'
continue-on-error: true
id: compliance
env:
Expand All @@ -83,13 +83,15 @@ jobs:
-c origin/${BASE_REF}..

- name: upload-results
if: github.event_name == 'pull_request'
uses: actions/upload-artifact@v4
continue-on-error: true
with:
name: compliance.xml
path: compliance.xml

- name: check-warns
if: github.event_name == 'pull_request'
run: |
if [[ ! -s "compliance.xml" ]]; then
exit 1;
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/twister-prep.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/twister-publish.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
10 changes: 7 additions & 3 deletions .github/workflows/twister.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ on:
- main
- v*-branch
- collab-*
pull_request_target:
pull_request:
branches:
- main
- v*-branch
Expand All @@ -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:
Expand Down Expand Up @@ -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 "[email protected]"
git config --global user.name "Zephyr Builder"
rm -fr ".git/rebase-apply"
Expand Down Expand Up @@ -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: |
Expand Down
1 change: 1 addition & 0 deletions kernel/init.c
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
* This module contains routines that are used to initialize the kernel.
*/


Check notice on line 14 in kernel/init.c

View workflow job for this annotation

GitHub Actions / compliance-check / Run compliance checks on patch series (PR)

You may want to run clang-format on this change

kernel/init.c:14 -
#include <ctype.h>
#include <stdbool.h>
#include <string.h>
Expand Down
Loading