Merge pull request #493 from Luos-io/torque #1240
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Code checker | |
on: | |
pull_request: | |
types: | |
- review_requested | |
push: | |
concurrency: | |
group: dev-build-${{ github.head_ref || github.ref_name }} | |
cancel-in-progress: true | |
defaults: | |
run: | |
shell: bash | |
jobs: | |
tests-run: | |
name: Tests run | |
runs-on: ${{ matrix.os }} | |
strategy: | |
matrix: | |
os: [macos-latest, windows-latest, ubuntu-latest] | |
steps: | |
- name: Check out Luos repository | |
uses: actions/checkout@v3 | |
- name: Set up Python | |
uses: actions/setup-python@v4 | |
with: | |
python-version: "3.10" | |
- name: Install dependencies | |
run: | | |
python -m pip install --upgrade pip | |
pip install wheel | |
pip install platformio | |
- name: Run PlatformIO Unit Tests | |
run: | | |
# Clean all projects | |
platformio run -t clean | |
# Run Unit tests | |
platformio test -vvv | |
- if: matrix.os == 'ubuntu-latest' | |
run: | | |
sudo apt-get install -y lcov | |
lcov -d .pio/build/native/ -c -o lcov.info | |
lcov --remove lcov.info '*/usr/*' '*/Platforms/*' '*/bootloader/*' '*/.pio/*' '*/HAL/*' '*/test/*' '*/network/*' -o lcov.info | |
- if: matrix.os == 'ubuntu-latest' | |
name: Coveralls | |
uses: coverallsapp/github-action@v2 | |
unit-tests: | |
name: Unit tests | |
needs: tests-run | |
runs-on: ubuntu-latest | |
steps: | |
- run: echo "Tests succeed!" | |
code-format: | |
name: Code format | |
runs-on: ubuntu-latest | |
steps: | |
- name: Check out Luos repository | |
uses: actions/checkout@v3 | |
- name: Set up Python | |
uses: actions/setup-python@v4 | |
with: | |
python-version: "3.10" | |
- name: Set up Node | |
uses: actions/setup-node@v2 | |
with: | |
node-version: "14" | |
- name: Install dependencies | |
run: npm install -g [email protected] | |
- name: Check for code format | |
run: python .github/workflows/run-clang-format.py -r . | |
examples-build: | |
name: Examples build | |
runs-on: ${{ matrix.os }} | |
strategy: | |
matrix: | |
project_folders: | |
[ | |
examples/projects/l0, | |
examples/projects/Arduino, | |
examples/projects/NUCLEO-L432KC, | |
examples/projects/NUCLEO-L476RG, | |
examples/projects/STM32F4-discovery, | |
examples/projects/NUCLEO-F401RE, | |
examples/projects/NUCLEO-F410RB, | |
examples/projects/NUCLEO-G431KB, | |
examples/projects/NUCLEO-G474RE, | |
examples/projects/NUCLEO-F072RB, | |
examples/projects/NUCLEO-L073RZ, | |
examples/projects/STM32L4S5_discovery, | |
# examples/projects/ESP32, | |
examples/projects/native, | |
] | |
os: [macos-latest, windows-latest, ubuntu-latest] | |
steps: | |
- name: Check out Luos repository | |
uses: actions/checkout@v3 | |
- name: Set up Python | |
uses: actions/setup-python@v4 | |
with: | |
python-version: "3.10" | |
- name: Install dependencies | |
run: | | |
python -m pip install --upgrade pip | |
pip install wheel | |
pip install platformio | |
- name: Run PlatformIO | |
run: | | |
for d in ${{ matrix.project_folders }}/*/ | |
do | |
# Parse all folder | |
if [ -f "$d/platformio.ini" ] | |
then | |
# This is a PIO project compile it | |
echo "Compiling : $d" | |
platformio run -d $d | |
else | |
# This folder could contain other projects, continue digging | |
for dd in $d*/ | |
do | |
# Parse all folder | |
if [ -f "$dd/platformio.ini" ] | |
then | |
# This is a PIO project compile it | |
echo "Compiling : $d" | |
platformio run -d $dd | |
fi | |
done | |
fi | |
done | |
# ******** missing bootloader CI ******** | |
build-success: | |
name: Build success | |
needs: examples-build | |
runs-on: ubuntu-latest | |
steps: | |
- run: echo "Build succeed!" |