diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 82e5d95..6dcce20 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -3,10 +3,10 @@ name: Build and Analyze on: push: branches: - - '*' + - '**' pull_request: branches: - - '*' + - '**' jobs: build: @@ -14,33 +14,35 @@ jobs: runs-on: ubuntu-latest steps: - # Checkout the repository + # Step 1: Checkout the repository - name: Checkout code uses: actions/checkout@v4 with: fetch-depth: 0 # Ensure full history for analysis - # Install dependencies + # Step 2: Install dependencies - name: Install dependencies run: | sudo apt update - sudo apt install -y cmake build-essential pkg-config libglfw3-dev libgl1-mesa-dev libx11-dev libgl-dev libglm-dev + sudo apt install -y cmake build-essential pkg-config \ + libglfw3-dev libgl1-mesa-dev libx11-dev libgl-dev libglm-dev - # Generate and build the project using CMake - - name: Build project + # Step 3: Generate and build the project using CMake + - name: Configure and build project run: | mkdir -p build cmake -S . -B build -DCMAKE_BUILD_TYPE=Release cmake --build build - # Run SonarQube analysis + # Step 4: Run SonarQube analysis - name: Run SonarQube scan uses: sonarsource/sonarqube-scan-action@v3 env: SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} SONAR_HOST_URL: ${{ secrets.SONAR_HOST_URL }} - # (Optional) Enforce quality gate + # Optional: Enforce quality gate + # Uncomment the following lines to fail the workflow if the Quality Gate is not met # - name: Check SonarQube quality gate # uses: sonarsource/sonarqube-quality-gate-action@master # timeout-minutes: 5