Skip to content
Open
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
67 changes: 37 additions & 30 deletions .github/workflows/basic_checks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -86,26 +86,25 @@ jobs:

style-check:
runs-on: ubuntu-latest
container:
image: ghcr.io/armmbed/mbed-os-env:master-latest
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Unfortunately this docker container still has an ancient Python version (3.8, I think), so I doubt it would support the latest versions of tools like Ruff. We really need a new version of this container, but that's really not something I am excited to do, so for now I had to make these jobs not use the container.


steps:

- name: Checkout repo
uses: actions/checkout@v4
uses: actions/checkout@v5
with:
fetch-depth: 0

- name: Install Formatters
run: |
sudo apt-get update -y
sudo apt-get install astyle aspell

-
name: UTF-8 Check
- name: UTF-8 Check
run: |
git config --global --add safe.directory "$GITHUB_WORKSPACE"
# Make sure we're not introducing any text which is not UTF-8 encoded
git diff origin/${GITHUB_BASE_REF} -U0 | ( grep -a '^+' || true ) | ( ! grep -axv '.*' )


-
name: astyle checks
- name: astyle checks
run: |
set -x
git config --global --add safe.directory "$GITHUB_WORKSPACE"
Expand Down Expand Up @@ -134,11 +133,26 @@ jobs:
tee BUILD/badlibs |
sed -e "s/^/Bad library name found: /" && [ ! -s BUILD/badlibs ]
# Assert that all assembler files are named correctly
# The strange command below asserts that there are exactly 0 libraries
# The strange command below asserts that there are exactly 0 files
# that do end with .s
find -name "*.s" | tee BUILD/badasm |
sed -e "s/^/Bad Assembler file name found: /" && [ ! -s BUILD/badasm ]

# Set up the oldest python version that's currently still supported by Python (as of Fall 2025)
- uses: actions/setup-python@v6
with:
python-version: '3.9'

- name: Install Python packages
run: |
pip install -e ./tools[linters]

- name: Check Python Formatting
run: |
cd tools
ruff format --diff


docs-check:
runs-on: ubuntu-latest

Expand All @@ -162,46 +176,39 @@ jobs:
python-tests:
runs-on: ubuntu-latest
steps:
-
name: Checkout repo
uses: actions/checkout@v4

- name: Install python3-venv
run: |
sudo apt-get update
sudo apt-get install -y python3-venv
- name: Checkout repo
uses: actions/checkout@v5

# Set up the oldest python version that's currently still supported by Python (as of Fall 2025)
- uses: actions/setup-python@v6
with:
python-version: '3.9'

- name: Install Python packages
run: |
python3 -m venv venv
source venv/bin/activate
pip install -e ./tools[unit-tests]

- name: Python Tests
run: |
source venv/bin/activate
tools/run_python_tests.sh

check-cmsis-mcu-descriptions-matches-target-list:
runs-on: ubuntu-latest
steps:
- name: Checkout repo
uses: actions/checkout@v4
uses: actions/checkout@v5

- name: Install python3-venv
run: |
sudo apt-get update
sudo apt-get install -y python3-venv
# Set up the oldest python version that's currently still supported by Python (as of Fall 2025)
- uses: actions/setup-python@v6
with:
python-version: '3.9'

- name: Install Python packages
run: |
python3 -m venv venv
source venv/bin/activate
pip install -e ./tools

- name: Verify that cmsis_mcu_descriptions.json5 is in sync with targets.json5
run: |
source venv/bin/activate
cd tools/python
mbed-tools cmsis-mcu-descr find-unused
mbed-tools cmsis-mcu-descr check-missing
Expand All @@ -214,7 +221,7 @@ jobs:
steps:
-
name: Checkout repo
uses: actions/checkout@v4
uses: actions/checkout@v5
with:
fetch-depth: 0

Expand Down
4 changes: 2 additions & 2 deletions tools/cmake/upload_methods/python_packagecheck.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# Copyright (c) 2020 ARM Limited. All rights reserved.
# SPDX-License-Identifier: Apache-2.0

#file which is invoked by the cmake build system to check if all necessary python packages are installed.
# file which is invoked by the cmake build system to check if all necessary python packages are installed.

import sys

Expand All @@ -10,4 +10,4 @@
except ImportError:
exit(1)

exit(0)
exit(0)
Loading