Skip to content

211 create config for global hardware configuration #168

211 create config for global hardware configuration

211 create config for global hardware configuration #168

Workflow file for this run

# Workflow requires Variables to be defined as follows:
# secrets.PUSH_TOKEN -> Password with rights to push to repository
name: "Tests"
on:
workflow_dispatch:
pull_request:
branches:
- 'main'
jobs:
lint-commits:
runs-on: ubuntu-latest
steps:
- name: Checkout Repository
uses: actions/checkout@v4
with:
ref: ${{ github.head_ref }}
persist-credentials: false
fetch-depth: 0
- name: Lint Commits
uses: wagoid/commitlint-github-action@v5
clang-format:
runs-on: ubuntu-latest
needs:
- lint-commits
outputs:
new_sha: ${{ steps.sha.outputs.SHA }}
steps:
- name: Checkout Repository
uses: actions/checkout@v4
with:
ref: ${{ github.head_ref }}
token: ${{ secrets.PUSH_TOKEN }}
- name: Install LLVM and Clang
uses: KyleMayes/install-llvm-action@v1
with:
version: "17"
directory: ${{ runner.temp }}/llvm
- name: Get C Files
run: |
echo SRC=$(git ls-tree --full-tree -r HEAD | grep -e "\.\(c\|h\)\$" | cut -f 2 | grep -v ^extern) >> $GITHUB_ENV
- name: Apply clang-format to Files
run: |
clang-format --style=file --fallback-style=llvm -i $SRC
- name: Commit Changes
uses: stefanzweifel/git-auto-commit-action@v4
with:
commit_message: "style(all): apply clang-format to '${{ github.head_ref }}'"
commit_user_name: github-actions
commit_user_email: [email protected]
commit_author: github-actions <[email protected]>
- name: Update SHA
id: sha
run: |
new_sha=$(git rev-parse HEAD)
echo "SHA=$new_sha" >> $GITHUB_OUTPUT
unit-tests:
runs-on: ubuntu-latest
needs:
- clang-format
steps:
- name: Checkout Repository
uses: actions/checkout@v4
with:
ref: ${{ needs.clang-format.outputs.new_sha }}
- name: Fetch Git Submodules
run: |
git submodule update --init --recursive
- name: Install Environment
run: |
sudo apt update
sudo apt install -y ninja-build
- name: Setup CMake
run: |
cmake -B build/unit-tests -D UNIT_TEST:BOOL=ON -D CMAKE_BUILD_TYPE=DEBUG -G Ninja .
- name: Build Targets
run: |
cmake --build build/unit-tests -j 4
- name: Run Unit-Tests
run: ctest --test-dir build/unit-tests/test/unit --output-on-failure
build_all_targets:
runs-on: ubuntu-latest
needs:
- clang-format
- unit-tests
strategy:
matrix:
config: [1, 2]
steps:
- name: Checkout Repository
uses: actions/checkout@v4
with:
ref: ${{ needs.clang-format.outputs.new_sha }}
- name: Setup Graphviz
uses: ts-graphviz/setup-graphviz@v1
- name: Setup Environment
run: |
sudo apt update
sudo apt install -y ninja-build gcc-arm-none-eabi
- name: Setup CMake
run: |
cmake -B build -D CMAKE_BUILD_TYPE=RELEASE -D REVISION=${{ matrix.config }} -G Ninja .
- name: Build Targets
run: cmake --build build -j 4