Skip to content

fix: update .gitignore #202

fix: update .gitignore

fix: update .gitignore #202

Workflow file for this run

name: Build
on:
push:
branches:
- main
pull_request:
types: [opened, synchronize, reopened]
env:
HAS_SONAR_TOKEN: ${{ secrets.SONAR_TOKEN != '' }}
jobs:
go-test:
name: Go Tests
runs-on: ubuntu-latest
permissions:
contents: read
defaults:
run:
working-directory: backend
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
fetch-depth: 0
- uses: actions/setup-go@4a3601121dd01d1626a1e23e37211e3254c1c06c # v6
with:
go-version-file: backend/go.mod
cache-dependency-path: backend/go.sum
- name: Test with coverage
run: go test -coverprofile=coverage.out ./...
- name: Upload coverage artifact
uses: actions/upload-artifact@bbbca2ddaa5d8feaa63e36b76fdaad77386f024f # v7.0.0
with:
name: go-coverage
path: backend/coverage.out
sonarqube:
name: SonarQube
needs: go-test
runs-on: ubuntu-latest
permissions:
contents: read
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
fetch-depth: 0
- name: Download coverage artifact
if: ${{ env.HAS_SONAR_TOKEN == 'true' && github.actor != 'dependabot[bot]' }}
uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1
with:
name: go-coverage
path: backend
- name: Skip SonarQube
if: ${{ env.HAS_SONAR_TOKEN != 'true' || github.actor == 'dependabot[bot]' }}
run: echo "Skipping SonarQube because SONAR_TOKEN is unavailable for this workflow context."
- name: SonarQube Scan
if: ${{ env.HAS_SONAR_TOKEN == 'true' && github.actor != 'dependabot[bot]' }}
uses: SonarSource/sonarqube-scan-action@a31c9398be7ace6bbfaf30c0bd5d415f843d45e9 # v7.0.0
env:
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}