Skip to content

Fixed bug causing position control oscillation #196

Fixed bug causing position control oscillation

Fixed bug causing position control oscillation #196

Workflow file for this run

name: PlatformIO CI
on:
workflow_dispatch:
push:
paths:
- ".github/workflows/main.yaml"
- "firmware/src/**/*.c"
- "firmware/src/**/*.h"
- "firmware/*.json"
- "firmware/*.ini"
- "firmware/linker_options_pio.py"
pull_request:
paths:
- ".github/workflows/main.yaml"
- "firmware/src/**/*.c"
- "firmware/src/**/*.h"
- "firmware/*.json"
- "firmware/*.ini"
- "firmware/linker_options_pio.py"
jobs:
build_and_check:
name: Build and analyze
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Cache pip
uses: actions/cache@v2
with:
path: ~/.cache/pip
key: ${{ runner.os }}-pip-${{ hashFiles('**/requirements.txt') }}
restore-keys: |
${{ runner.os }}-pip-
- name: Cache PlatformIO
uses: actions/cache@v2
with:
path: ~/.platformio
key: ${{ runner.os }}-${{ hashFiles('**/lockfiles') }}
- name: Set up Python
uses: actions/setup-python@v2
- name: Install PlatformIO
run: |
python -m pip install --upgrade pip
pip install --upgrade platformio
- name: Run tests on the native platform
run: |
cd firmware
pio test -e PC_UnitTest
- name: PlatformIO build
run: |
cd firmware
pio run
- name: Upload firmware
uses: actions/upload-artifact@v3
with:
name: firmware
path: firmware/.pio/build/ServoCAN_release/firmware.bin
- name: PlatformIO Check
run: |
cd firmware
echo "${{ secrets.MISRA_TEXT }}" > misra_rules_set_cppcheck.txt
cat misra_rules_set_cppcheck.txt
pio check --fail-on-defect high > report.txt
- name: Upload report
uses: actions/upload-artifact@v3
with:
name: pio check report
path: firmware/report.txt
SonarCloud:
name: Test using SonarCloud
needs: build_and_check
runs-on: ubuntu-latest
env:
SONAR_SCANNER_VERSION: 4.7.0.2747 # Find the latest version in the "Linux" link on this page:
# https://docs.sonarcloud.io/advanced-setup/ci-based-analysis/sonarscanner-cli/
SONAR_SERVER_URL: "https://sonarcloud.io"
steps:
- uses: actions/checkout@v2
with:
fetch-depth: 0 # Shallow clones should be disabled for a better relevancy of analysis
- name: Set up JDK 11
uses: actions/setup-java@v1
with:
java-version: 11
- name: Cache SonarCloud packages
uses: actions/cache@v1
with:
path: ~/.sonar/cache
key: ${{ runner.os }}-sonar
restore-keys: ${{ runner.os }}-sonar
- name: Download and set up sonar-scanner
env:
SONAR_SCANNER_DOWNLOAD_URL: https://binaries.sonarsource.com/Distribution/sonar-scanner-cli/sonar-scanner-cli-${{ env.SONAR_SCANNER_VERSION }}-linux.zip
run: |
mkdir -p $HOME/.sonar
curl -sSLo $HOME/.sonar/sonar-scanner.zip ${{ env.SONAR_SCANNER_DOWNLOAD_URL }}
unzip -o $HOME/.sonar/sonar-scanner.zip -d $HOME/.sonar/
echo "$HOME/.sonar/sonar-scanner-${{ env.SONAR_SCANNER_VERSION }}-linux/bin" >> $GITHUB_PATH
- name: Cache pip
uses: actions/cache@v2
with:
path: ~/.cache/pip
key: ${{ runner.os }}-pip-${{ hashFiles('**/requirements.txt') }}
restore-keys: |
${{ runner.os }}-pip-
- name: Cache PlatformIO
uses: actions/cache@v2
with:
path: ~/.platformio
key: ${{ runner.os }}-${{ hashFiles('**/lockfiles') }}
- name: Set up Python
uses: actions/setup-python@v2
- name: Install PlatformIO
run: |
python -m pip install --upgrade pip
pip install --upgrade platformio
- name: Platformio Compilation Database
run: |
cd firmware
pio run -t compiledb
- name: Upload Compilation Database
uses: actions/upload-artifact@v3
with:
name: CompilationDB
path: firmware/compile_commands.json
- name: Install Arm GNU Toolchain (arm-none-eabi-gcc)
uses: carlosperate/arm-none-eabi-gcc-action@v1
- name: Run sonar-scanner
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
SONAR_TOKEN: ${{ secrets.SONARCLOUD_TOKEN }}
run: |
cd firmware
# Set the property "sonar.cfamily.compile-commands" to the compilation database file
sonar-scanner --define sonar.host.url="${{ env.SONAR_SERVER_URL }}" --define sonar.cfamily.compile-commands=compile_commands.json