Skip to content

Commit

Permalink
does this work?
Browse files Browse the repository at this point in the history
  • Loading branch information
MajorArkwolf authored Aug 17, 2023
1 parent 7a699e9 commit 2ff9167
Showing 1 changed file with 28 additions and 6 deletions.
34 changes: 28 additions & 6 deletions .github/workflows/compile-sketch.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,9 @@ on:
branches: [dev, release/stm32-blackpill, fix/*]
# Manual trigger
workflow_dispatch:

env:
BUILD_CACHE: build_cache # Directory where build-wrapper output will be placed

jobs:
coding-style:
Expand Down Expand Up @@ -52,9 +55,14 @@ jobs:
- name: Install Platformio
run: |
python3 -c "$(curl -fsSL https://raw.githubusercontent.com/platformio/platformio/master/scripts/get-platformio.py)"
- name: Cache build
uses: actions/cache@v3
with:
path: .pio/build/${{ matrix.environment.name }}
key: ${{ env.BUILD_CACHE }}_${{ matrix.environment.name }}
- name: Run build-wrapper on ${{ matrix.environment.name }}
run: |
build-wrapper-linux-x86-64 --out-dir ${{ env.BUILD_WRAPPER_OUT_DIR }} ~/.platformio/penv/bin/platformio run -e ${{ matrix.environment.command }}
~/.platformio/penv/bin/platformio run -e ${{ matrix.environment.command }}
env:
PLATFORMIO_BUILD_SRC_FLAGS: -Wdouble-promotion -Wall -Werror

Expand All @@ -63,16 +71,30 @@ jobs:
runs-on: ubuntu-latest
needs: [compile]
env:
BUILD_WRAPPER_OUT_DIR: build_wrapper_output_directory # Directory where build-wrapper output will be placed
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
timeout-minutes: 30
strategy:
fail-fast: false
matrix:
environment:
- name: Main (Lego)
command: "lego-stlink"
- name: Main (PCB)
command: "all-pcb-stlink"
- name: Scales
command: "scales-calibration-stlink"
steps:
- name: Install sonar-scanner
uses: SonarSource/sonarcloud-github-c-cpp@v1
- uses: actions/cache@v3
with:
path: |
.pio/build/${{ matrix.environment.name }}
key: ${{ env.BUILD_CACHE }}_${{ matrix.environment.name }}
- name: Run sonar-scanner
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
run: |
sonar-scanner --define sonar.cfamily.build-wrapper-output="${{ env.BUILD_WRAPPER_OUT_DIR }}"
sonar-scanner --define sonar.cfamily.build-wrapper-output=".pio/build/${{ matrix.environment.name }}"
unit-tests:
name: Unit Tests
Expand Down

0 comments on commit 2ff9167

Please sign in to comment.