Skip to content

Placed tire model in new folder software/vehicle_modelling_and_controls #3925

Placed tire model in new folder software/vehicle_modelling_and_controls

Placed tire model in new folder software/vehicle_modelling_and_controls #3925

Workflow file for this run

name: UBC Formula Electric CI
on:
pull_request:
jobs:
clang-format:
name: Check C Formatting
runs-on: ubuntu-22.04
container:
image: ubcformulaelectric/environment:latest
credentials:
username: ubcformulaelectric
password: ${{ secrets.DOCKER_TOKEN }}
steps:
# Fix to get git diff working in a Docker container
# https://github.com/actions/checkout/issues/363
- name: Setup git
run: git config --global --add safe.directory $(realpath .)
- name: Checkout repository
uses: actions/checkout@v4
- name: Format code
run: python3 scripts/utilities/fix_formatting.py
- name: Check for differences
run: git --no-pager diff --color --exit-code
codegen:
name: Check CubeMX Code Gen
runs-on: ubuntu-22.04
needs: [ clang-format ]
strategy:
fail-fast: false
matrix:
include:
- board: VC
ioc_dir: firmware/quadruna/VC/src/cubemx
- board: BMS
ioc_dir: firmware/quadruna/BMS/src/cubemx
- board: FSM
ioc_dir: firmware/quadruna/FSM/src/cubemx
- board: RSM
ioc_dir: firmware/quadruna/RSM/src/cubemx
- board: CRIT
ioc_dir: firmware/quadruna/CRIT/src/cubemx
- board: f4dev
ioc_dir: firmware/dev/f4dev/cubemx
- board: h7dev
ioc_dir: firmware/dev/h7dev/src/cubemx
container:
image: ubcformulaelectric/environment:latest
credentials:
username: ubcformulaelectric
password: ${{ secrets.DOCKER_TOKEN }}
steps:
# Fix to get git diff working in a Docker container
# https://github.com/actions/checkout/issues/363
- name: Setup git
run: git config --global --add safe.directory $(realpath .)
- name: Checkout repository
uses: actions/checkout@v4
- name: Generate Log4J file
run: python3 scripts/utilities/generate_log4j_properties.py --log4j_properties_output /root/.stm32cubemx/log4j.properties
# To ensure that the generated STM32CubeMX code is up to date with the .ioc file, we
# we also generate a checksum from the .ioc file when code is generated during builds.
# During CI, we re-generate the checksum. If it matches, then the code is up to date,
# otherwise, you need to re-generate STM32CubeMX code locally.
- name: Generate checksum
run: |
python3 scripts/utilities/generate_md5_checksum.py \
$GITHUB_WORKSPACE/${{ matrix.ioc_dir }}/${{ matrix.board }}.ioc \
$GITHUB_WORKSPACE/${{ matrix.ioc_dir }}/${{ matrix.board }}.ioc.md5
- name: Check for differences
run: git --no-pager diff --color --exit-code
build-firmware:
needs: [ clang-format ]
name: Build Firmware Binaries
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
board:
- quadruna_VC
- quadruna_BMS
- quadruna_FSM
- quadruna_RSM
- quadruna_CRIT
- f4dev
- h7dev
container:
image: ubcformulaelectric/environment:latest
credentials:
username: ubcformulaelectric
password: ${{ secrets.docker_token }}
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
submodules: recursive
- uses: ./.github/actions/build_binary
with:
board: ${{ matrix.board }}
test-firmware:
needs: [ clang-format ]
name: Test Firmware
runs-on: ubuntu-22.04
strategy:
fail-fast: false
matrix:
include:
- board: VC
car: quadruna
- board: BMS
car: quadruna
- board: FSM
car: quadruna
- board: RSM
car: quadruna
- board: CRIT
car: quadruna
container:
image: ubcformulaelectric/environment:latest
credentials:
username: ubcformulaelectric
password: ${{ secrets.DOCKER_TOKEN }}
env:
BUILD_DIR: build_fw_test
steps:
# Fix to ensure that commands like git status work in child directories
# for gitpython in git_commit_info
- name: Setup git
run: git config --global --add safe.directory $(realpath .)
- name: Checkout repository
uses: actions/checkout@v4
with:
submodules: recursive
- name: Build
run: |
cmake --preset "FW Test CI" -B $BUILD_DIR
cmake --build $BUILD_DIR --target ${{ matrix.car }}_${{ matrix.board }}_test
- name: Run Tests
run: |
cd $BUILD_DIR/firmware/${{ matrix.car }}/${{ matrix.board }}
valgrind --tool=memcheck --leak-check=yes ./${{ matrix.car }}_${{ matrix.board }}_test
test-shared:
name: Test Shared
runs-on: ubuntu-22.04
needs: [ clang-format ]
container:
image: ubcformulaelectric/environment:latest
credentials:
username: ubcformulaelectric
password: ${{ secrets.DOCKER_TOKEN }}
env:
BUILD_DIR: build_fw_test
steps:
# Fix to ensure that commands like git status work in child directories
# for gitpython in git_commit_info
- name: Setup git
run: git config --global --add safe.directory $(realpath .)
- name: Checkout repository
uses: actions/checkout@v4
with:
submodules: recursive
- name: Build
run: |
cmake --preset "FW Test CI" -B $BUILD_DIR
cmake --build $BUILD_DIR --target shared_test
- name: Run tests
run: |
cd $BUILD_DIR/firmware/shared
valgrind --tool=memcheck --leak-check=yes ./shared_test
test-fakegen:
name: Test Fake Function Generation
runs-on: ubuntu-22.04
needs: [ clang-format ]
container:
image: ubcformulaelectric/environment:latest
credentials:
username: ubcformulaelectric
password: ${{ secrets.DOCKER_TOKEN }}
env:
BUILD_DIR: build_fw_test
steps:
# Fix to ensure that commands like git status work in child directories
# for gitpython in git_commit_info
- name: Setup git
run: git config --global --add safe.directory $(realpath .)
- name: Checkout repository
uses: actions/checkout@v4
with:
submodules: recursive
- name: Build
run: |
cmake --preset "FW Test CI" -B $BUILD_DIR
cmake --build $BUILD_DIR --target fakegen_test
- name: Run tests
run: |
cd $BUILD_DIR/scripts/code_generation/fakegen
test-logfs:
name: Test logfs
runs-on: ubuntu-22.04
needs: [ clang-format ]
container:
image: ubcformulaelectric/environment:latest
credentials:
username: ubcformulaelectric
password: ${{ secrets.DOCKER_TOKEN }}
env:
BUILD_DIR: build_fw_test
steps:
# Fix to ensure that commands like git status work in child directories
# for gitpython in git_commit_info
- name: Setup git
run: git config --global --add safe.directory $(realpath .)
- name: Checkout repository
uses: actions/checkout@v4
with:
submodules: recursive
- name: Build and install `logfs`
run: |
cmake --preset "FW Test CI" -B $BUILD_DIR
cmake --build $BUILD_DIR --target install_python_logfs
pytest -v firmware/logfs/test