WIP: apply comments #545
Workflow file for this run
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Build (Debug) and test | |
| on: | |
| push: | |
| branches: | |
| - main | |
| - develop | |
| - feature* | |
| - release* | |
| pull_request_target: | |
| types: | |
| - edited | |
| - opened | |
| - reopened | |
| - synchronize | |
| branches: | |
| - main | |
| - develop | |
| - feature* | |
| - release* | |
| jobs: | |
| build: | |
| runs-on: ubuntu-latest | |
| permissions: read-all | |
| container: | |
| image: ghcr.io/aosedge/aos-core-build:latest | |
| options: "--entrypoint /usr/bin/bash" | |
| credentials: | |
| username: ${{ github.actor }} | |
| password: ${{ github.token }} | |
| env: | |
| BUILD_WRAPPER_OUT_DIR: build_wrapper_output_directory | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v6 | |
| with: | |
| ref: ${{github.event.pull_request.head.ref}} | |
| repository: ${{github.event.pull_request.head.repo.full_name}} | |
| fetch-depth: 0 | |
| - name: Install build wrapper | |
| uses: SonarSource/sonarqube-scan-action/install-build-wrapper@v7 | |
| - name: Build (Debug) | |
| run: | | |
| ./build.sh build --ci --clean | |
| - name: Test | |
| run: | | |
| ./build.sh coverage | |
| - name: Upload codecov report | |
| uses: codecov/codecov-action@v5 | |
| with: | |
| token: ${{ secrets.CODECOV_TOKEN }} | |
| files: ./build/coverage.total | |
| - name: SonarQube analysis (on push) | |
| if: github.event_name == 'push' | |
| uses: SonarSource/sonarqube-scan-action@v7 | |
| env: | |
| SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} | |
| with: | |
| args: > | |
| --define "sonar.cfamily.compile-commands=${{ env.BUILD_WRAPPER_OUT_DIR }}/compile_commands.json" | |
| --define "sonar.coverageReportPaths=build/coverage_sonarqube.xml" | |
| - name: SonarQube analysis (on pull request) | |
| if: github.event_name == 'pull_request_target' | |
| uses: SonarSource/sonarqube-scan-action@v7 | |
| env: | |
| SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| with: | |
| projectBaseDir: "." | |
| args: > | |
| --define "sonar.scm.revision=${{ github.event.pull_request.head.sha }}" | |
| --define "sonar.pullrequest.key=${{ github.event.pull_request.number }}" | |
| --define "sonar.pullrequest.branch=${{ github.event.pull_request.head.ref }}" | |
| --define "sonar.pullrequest.base=${{ github.event.pull_request.base.ref }}" | |
| --define "sonar.cfamily.compile-commands=${{ env.BUILD_WRAPPER_OUT_DIR }}/compile_commands.json" | |
| --define "sonar.coverageReportPaths=build/coverage_sonarqube.xml" |