-
Notifications
You must be signed in to change notification settings - Fork 3
34 lines (33 loc) · 1.26 KB
/
golang.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
on:
push:
pull_request: #sonar refuses to display branch analysis results on Free plan even for OSS
types: [opened, synchronize, reopened]
jobs:
golang:
runs-on: ubuntu-latest # we execute everything except make in docker anyway
name: GoLang Basics
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0 # Shallow clones should be disabled for a better relevancy of Sonar scan
- name: FS Permissions
# workaround for permissions with contaner attempting to create directories
run: chmod 777 -R "$(pwd)"
- name: Dep
run: make dep
- name: Lint
run: make lint
- name: Coverage Setup
# workaround for permissions with container attempting to create directory
run: mkdir .coverage && chmod 777 .coverage
- name: Unit Tests
run: make test
- name: Integration Tests
run: make integration
- name: SonarQube Scan
uses: SonarSource/sonarqube-scan-action@v4
env:
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
# run on PRs and once we merge to main, as we need baseline runs for main in Sonar
if: ${{ ( github.event_name == 'pull_request' ) || ( github.ref == 'refs/heads/main' ) }}