Skip to content

fix: Exclude .vscode directory from markdown linting #3

fix: Exclude .vscode directory from markdown linting

fix: Exclude .vscode directory from markdown linting #3

Workflow file for this run

name: CI
on:
push:
branches: ["**"]
pull_request:
branches: [main]
jobs:
cpp-format:
name: C++ Format Check
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Install clang-format
run: sudo apt-get install -y clang-format
- name: Check C++ code formatting
run: |
# Find all C++ files
FILES=$(find . -name "*.cpp" -o -name "*.h" -o -name "*.hpp" | grep -v \.pio | grep -v build)
if [ -n "$FILES" ]; then
echo "Checking formatting for files:"
echo "$FILES"
clang-format --dry-run --Werror $FILES
else
echo "No C++ files found to check"
fi
markdown-lint:
name: Markdown Lint
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: DavidAnson/markdownlint-cli2-action@v22
with:
globs: "*.md"
unit-tests:
name: Host Unit Tests
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Cache CMake build directory
uses: actions/cache@v4
with:
path: .vscode/build
key: cmake-${{ runner.os }}-${{ hashFiles('CMakeLists.txt', 'test/CMakeLists.txt') }}
restore-keys: |
cmake-${{ runner.os }}-
- name: Install build dependencies
run: sudo apt-get install -y cmake ninja-build g++
- name: Configure CMake
run: |
cmake -B .vscode/build \
-G Ninja \
-DCMAKE_BUILD_TYPE=Debug \
-Wno-dev
- name: Build tests
run: cmake --build .vscode/build --target pedal_tests -j$(nproc)
- name: Run tests
run: |
ctest --test-dir .vscode/build \
--output-on-failure \
--output-junit test-results.xml
- name: Publish test results
uses: EnricoMi/publish-unit-test-result-action@v2
if: always()
with:
files: test-results.xml
comment_mode: always
check_name: "GoogleTest Results"
- name: Upload test report artifact
uses: actions/upload-artifact@v4
if: always()
with:
name: test-results
path: test-results.xml
retention-days: 30