diff --git a/.github/actions/build-simulator/action.yaml b/.github/actions/build-simulator/action.yaml deleted file mode 100644 index 2193bb9be..000000000 --- a/.github/actions/build-simulator/action.yaml +++ /dev/null @@ -1,11 +0,0 @@ -name: Simulate -description: Build Target Simulator - -inputs: - subtarget: - description: simulator sub-target - required: false - -runs: - using: composite - steps: diff --git a/.github/actions/cross-compile-build/action.yaml b/.github/actions/cross-compile-build/action.yaml deleted file mode 100644 index ed2e2d2e5..000000000 --- a/.github/actions/cross-compile-build/action.yaml +++ /dev/null @@ -1,15 +0,0 @@ -name: Cross-Compile/Build -description: Build target - -runs: - using: composite - steps: - - name: Build g4 - run: cmake --build --preset=${{ env.TARGET }} --target ${{ env.TARGET }}-images ${{ env.TARGET }}-applications - shell: bash - working-directory: ${{ env.DEFAULT_DIRECTORY }} - - - name: Lint - run: cmake --build ./build-cross --target ${{ env.TARGET }}-lint - shell: bash - working-directory: ${{ env.DEFAULT_DIRECTORY }} diff --git a/.github/actions/cross-compile-check/action.yaml b/.github/actions/cross-compile-check/action.yaml deleted file mode 100644 index 402f27833..000000000 --- a/.github/actions/cross-compile-check/action.yaml +++ /dev/null @@ -1,15 +0,0 @@ -name: Cross-Compile/Check -description: Configure, Format and Lint - -runs: - using: composite - steps: - - name: Configure G4 - run: cmake --preset=cross . - shell: bash - working-directory: ${{ env.DEFAULT_DIRECTORY }} - - - name: Format - run: cmake --build ./build-cross --target ${{ env.TARGET }}-format-ci - shell: bash - working-directory: ${{ env.DEFAULT_DIRECTORY }} diff --git a/.github/actions/host-compile-test/action.yaml b/.github/actions/host-compile-test/action.yaml deleted file mode 100644 index c3086a6a4..000000000 --- a/.github/actions/host-compile-test/action.yaml +++ /dev/null @@ -1,16 +0,0 @@ -name: Host-Compile/Test -description: Build and Test Target - - -runs: - using: composite - steps: - - name: Configure - run: cmake --preset=host-gcc10 . - shell: bash - working-directory: ${{ env.DEFAULT_DIRECTORY }} - - - name: Build and test - run: cmake --build ./build-host --target ${{ env.TARGET }}-build-and-test - shell: bash - working-directory: ${{ env.DEFAULT_DIRECTORY }} diff --git a/.github/actions/parse-cmake-preset/action.yaml b/.github/actions/parse-cmake-preset/action.yaml deleted file mode 100644 index 96329b47f..000000000 --- a/.github/actions/parse-cmake-preset/action.yaml +++ /dev/null @@ -1,28 +0,0 @@ -name: Parse CMAKE preset targets -description: Parse targets from CMakePresets.json - -inputs: - name: - description: name of the preset target - required: true -outputs: - targets: - description: a list of valid targets - value: ${{ steps.get-targets.outputs.targets }} - -runs: - using: composite - steps: - - name: Install jq - shell: bash - run: | - sudo apt-get install jq - - - id: get-targets - run: | - targets=$(jq '.buildPresets[] | select(.name=="${{ inputs.name }}") | .targets' CMakePresets.json) - echo targets=$targets >> "$GITHUB_OUTPUT" - echo $GITHUB_OUTPUT - shell: bash - working-directory: ${{ env.DEFAULT_DIRECTORY }} - diff --git a/.github/workflows/codecov.yaml b/.github/workflows/codecov.yaml index f5b75e325..e236772ae 100644 --- a/.github/workflows/codecov.yaml +++ b/.github/workflows/codecov.yaml @@ -1,6 +1,5 @@ name: 'Code Coverage' on: - pull_request: push: branches: - 'main' @@ -12,6 +11,7 @@ env: defaults: run: shell: bash + working-directory: ot3-firmware concurrency: group: ${{ github.workflow }}-${{ github.ref_name }} @@ -22,33 +22,43 @@ jobs: name: 'Generate-Coverage' runs-on: 'ubuntu-20.04' timeout-minutes: 10 - env: - CC: gcc-10 - CXX: g++-10 steps: - - run: | - sudo apt update - sudo apt install gcc-10 g++-10 lcov - - uses: actions/setup-python@v4 + - name: Checkout ot3-firmware repo + uses: actions/checkout@v4 with: - python-version: '3.10' - - name: 'Install lcov_cobertura module' - run: pip install lcov_cobertura - - uses: 'actions/checkout@v2' + path: ot3-firmware + + - name: Checkout github actions directory + uses: actions/checkout@v4 with: - fetch-depth: 0 - - uses: "actions/cache@v3" + sparse-checkout: | + .github/actions + sparse-checkout-cone-mode: false + path: actions + + - name: Setup main + uses: ./actions/.github/actions/main-setup with: - path: "./stm32-tools" - key: ${{ runner.os }}-${{ hashFiles('**/cmake/*') }}-${{ secrets.CACHE_VERSION }} - - name: 'Configure' + cache-version: ${{ secrets.CACHE_VERSION }} + + - name: Install LCOV + run: sudo apt install -y lcov + + - name: Install lcov_cobertura module + run: pip install lcov_cobertura + + - name: Configure run: cmake --preset=host-gcc10 -DENABLE_COVERAGE=On -DCMAKE_BUILD_TYPE=Debug - - name: 'Run all tests' + + - name: Run all tests run: cmake --build --preset tests - - name: 'Generate coverage' + + - name: Generate coverage run: cmake --build --preset tests --target lcov-geninfo - - name: 'Convert coverage to xml' + + - name: Convert coverage to xml run: lcov_cobertura build-host/lcov/data/capture/all_targets.info + - name: Upload coverage to Codecov uses: codecov/codecov-action@v3 with: