Feature cm cloud message #39
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 and test | |
| on: | |
| push: | |
| branches: | |
| - main | |
| - develop | |
| - feature* | |
| pull_request_target: | |
| types: | |
| - edited | |
| - opened | |
| - reopened | |
| - synchronize | |
| branches: | |
| - main | |
| - develop | |
| - feature* | |
| 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@v4 | |
| 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@v4 | |
| - name: Build | |
| run: | | |
| ./build.sh build --ci | |
| - name: Test | |
| run: | | |
| ./build.sh coverage | |
| - name: Static analysis | |
| run: | | |
| ./build.sh lint | |
| - name: Upload codecov report | |
| uses: codecov/codecov-action@v4 | |
| with: | |
| token: ${{ secrets.CODECOV_TOKEN }} | |
| files: ./build/coverage.total | |
| - name: SonarQube analysis | |
| if: github.event_name == 'push' | |
| uses: SonarSource/sonarqube-scan-action@v4 | |
| 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 | |
| if: github.event_name == 'pull_request_target' | |
| uses: SonarSource/sonarqube-scan-action@v4 | |
| 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 |