Skip to content

ci: test: flash latest 91m1 firmware in tests #200

ci: test: flash latest 91m1 firmware in tests

ci: test: flash latest 91m1 firmware in tests #200

Workflow file for this run

name: Compliance
on:
pull_request:
permissions:
contents: read
concurrency:
group: compliance-${{ github.event.pull_request.number || github.run_id }}
cancel-in-progress: true
jobs:
compliance_job:
runs-on: self-hosted-build
name: Run compliance checks on patch series (PR)
container: ghcr.io/zephyrproject-rtos/ci:v0.29.2
# Skip job if it was triggered by Renovate Bot
if: ${{ !contains(github.actor, 'renovate') }}
steps:
- name: Installation
run: |
apt-get update && apt-get install --no-install-recommends -y libmagic1
python3 -m pip install -U pip wheel setuptools
python3 -m pip install west gitlint
- name: Checkout the code
uses: actions/checkout@v6
with:
path: serial-modem-host-applications
ref: ${{ github.event.pull_request.head.sha }}
fetch-depth: 0
- name: Initialize West workspace
uses: ./serial-modem-host-applications/.github/actions/west-init
- name: Install zephyr requirements
run: |
python3 -m pip install --no-cache-dir -r zephyr/scripts/requirements-compliance.txt
# Junitparser v3 and 4 don't work with check_compliance.py
python3 -m pip install --no-cache-dir junitparser==2.8.0
- name: Run Compliance Tests
id: compliance
shell: bash
env:
BASE_REF: ${{ github.base_ref }}
working-directory: serial-modem-host-applications
run: |
export ZEPHYR_BASE="../zephyr"
$ZEPHYR_BASE/scripts/ci/check_compliance.py \
--annotate \
-m Devicetree \
-m Gitlint \
-m Identity \
-m Nits \
-m pylint \
-m checkpatch \
-c origin/${BASE_REF}.. || \
echo "COMPLIANCE_FAILED=true" >> $GITHUB_ENV
- name: Upload compliance results
uses: actions/upload-artifact@v7
if: always()
with:
name: compliance.xml
path: serial-modem-host-applications/compliance.xml
if-no-files-found: ignore
- name: Process Compliance Results
working-directory: serial-modem-host-applications
shell: bash
run: |
# Check for compliance.xml existence
if [[ ! -s "compliance.xml" ]]; then
echo "::error::compliance.xml file is missing or empty"
exit 1
fi
# Initialize exit code
exit_code=0
export ZEPHYR_BASE="../zephyr"
files=($($ZEPHYR_BASE/scripts/ci/check_compliance.py -l))
for file in "${files[@]}"; do
f="${file}.txt"
if [[ -s $f ]]; then
errors=$(cat $f)
errors="${errors//'%'/'%25'}"
errors="${errors//$'\n'/'%0A'}"
errors="${errors//$'\r'/'%0D'}"
echo "::error file=${f}::$errors"
exit_code=1
fi
done
# Check if compliance test failed
if [[ "$COMPLIANCE_FAILED" == "true" ]]; then
echo "::error::Compliance tests failed. Please check the logs for details."
exit_code=1
fi
exit $exit_code