From 5decc2a307fc73f80f560ddcfb7939b2c816bc17 Mon Sep 17 00:00:00 2001 From: thefourCraft Date: Sat, 25 Feb 2023 14:09:28 +0200 Subject: [PATCH] Create Build CI --- code/.github/workflows/build.yml | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) create mode 100644 code/.github/workflows/build.yml diff --git a/code/.github/workflows/build.yml b/code/.github/workflows/build.yml new file mode 100644 index 0000000000..72c66c8db0 --- /dev/null +++ b/code/.github/workflows/build.yml @@ -0,0 +1,28 @@ +name: SonarCloud +on: + push: + branches: + - master + pull_request: + types: [opened, synchronize, reopened] +jobs: + build: + name: Build and analyze + runs-on: ubuntu-latest + env: + BUILD_WRAPPER_OUT_DIR: build_wrapper_output_directory # Directory where build-wrapper output will be placed + steps: + - uses: actions/checkout@v3 + with: + fetch-depth: 0 # Shallow clones should be disabled for a better relevancy of analysis + - name: Install sonar-scanner and build-wrapper + uses: SonarSource/sonarcloud-github-c-cpp@v1 + - name: Run build-wrapper + run: | + build-wrapper-linux-x86-64 --out-dir ${{ env.BUILD_WRAPPER_OUT_DIR }} + - 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 }}"