-
-
Notifications
You must be signed in to change notification settings - Fork 0
51 lines (43 loc) · 1.33 KB
/
master.yml
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
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
name: Master CI
on:
push:
branches: [ "master" ]
pull_request:
branches: [ "master" ]
jobs:
build-test:
name: Build & Test
runs-on: ubuntu-latest
if: "! contains(toJSON(github.event.commits.*.message), '[skip ci]')"
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Set up Go 1.23.0
uses: actions/setup-go@v5
with:
go-version: '1.23.0'
- name: Start MongoDB
uses: supercharge/[email protected]
with:
mongodb-version: 7.0
- name: Build
run: go build -v ./...
- name: Test
run: go test -p 1 -v ./... -coverprofile="coverage.out"
env:
GO_ENV: test
MONGODB_URI: mongodb://127.0.0.1:27017
MONGO_DB: switcher-gitops-test
SWITCHER_API_URL: ${{ secrets.SWITCHER_API_URL }}
SWITCHER_API_JWT_SECRET: ${{ secrets.SWITCHER_API_JWT_SECRET }}
GIT_TOKEN: ${{ secrets.GIT_TOKEN }}
GIT_USER: ${{ secrets.GIT_USER }}
GIT_TOKEN_READ_ONLY: ${{ secrets.GIT_TOKEN_READ_ONLY }}
GIT_REPO_URL: ${{ secrets.GIT_REPO_URL }}
GIT_BRANCH: ${{ secrets.GIT_BRANCH }}
- name: SonarCloud Scan
uses: sonarsource/[email protected]
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}