Skip to content

Commit

Permalink
test full go setup before scan
Browse files Browse the repository at this point in the history
  • Loading branch information
Lennart01 committed Jan 27, 2025
1 parent 93583de commit 1fc0505
Showing 1 changed file with 32 additions and 13 deletions.
45 changes: 32 additions & 13 deletions .github/workflows/continuous-integration.yml
Original file line number Diff line number Diff line change
Expand Up @@ -94,13 +94,6 @@ jobs:
run: |
make test
make build-alpine
- name: Cache coverage file
uses: actions/cache/save@v4
id: cache-file
with:
path: server/src/coverage.txt
key: ${{ runner.os }}-coverage-${{ github.run_id }}
sonarqube:
name: SonarQube
Expand All @@ -110,21 +103,47 @@ jobs:
- uses: actions/checkout@v4
with:
fetch-depth: 0 # Shallow clones should be disabled for a better relevancy of analysis
- name: Restore coverage file
uses: actions/cache/restore@v4

- uses: actions/setup-go@v5
with:
path: server/src/coverage.txt
key: ${{ runner.os }}-coverage-${{ github.run_id }}
go-version: "^1.22"
cache: false

- name: Cache Go Modules
id: cache-go-modules
uses: actions/cache@v4
with:
path: |
~/.cache/go-build
/go/pkg/mod
key: ${{ runner.os }}-go-${{ hashFiles('server/src/go.sum') }}
restore-keys: |
${{ runner.os }}-go-
- name: Download Go Modules
if: steps.cache-go-modules.outputs.cache-hit != 'true'
working-directory: ./server/src
run: go mod download

- name: Verify Go Modules
working-directory: ./server/src
run: go list -m all

- name: Get coverage report
id: coverage
working-directory: ./server
run: |
make test
- name: SonarQube Scan
uses: SonarSource/sonarqube-scan-action@v4
env:
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}

- name: SonarQube Quality Gate
uses: SonarSource/sonarqube-quality-gate-action@v1
env:
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}


package:
needs: [test-frontend, test-backend]
uses: ./.github/workflows/package.yml
Expand Down

0 comments on commit 1fc0505

Please sign in to comment.