-
Notifications
You must be signed in to change notification settings - Fork 3
78 lines (68 loc) · 2.17 KB
/
ci-build.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
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
name: Go
on:
push:
branches: ["main"]
pull_request:
jobs:
matrix-build:
strategy:
matrix:
go: ["1.21.12", "1.22.5"]
db: ["7.1.26", "8.27.0"]
env:
DEFAULT_GO: "1.21.12"
DEFAULT_DB: "8.27.0"
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}-go-${{ matrix.go }}-db-${{ matrix.db }}
cancel-in-progress: true
name: Build with go version ${{ matrix.go }} and db ${{ matrix.db }}
runs-on: ubuntu-22.04
defaults:
run:
shell: "bash"
steps:
- name: Check out code
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Set up Go
id: go
uses: actions/setup-go@v5
with:
go-version: ${{ matrix.go }}
cache: true
- name: golangci-lint
uses: golangci/golangci-lint-action@v6
with:
version: v1.59.1
skip-cache: true # Caching already done by actions/cache
- name: Enable testcontainer reuse
run: echo 'testcontainers.reuse.enable=true' > "$HOME/.testcontainers.properties"
- name: Go build
run: |
go clean
go build
go build ./...
- name: Go test -short
run: go test -v -count 1 -short ./...
- name: Go test with Exasol version ${{ matrix.db }}
env:
DB_VERSION: ${{ matrix.db }}
run: go test -v -p 1 -count 1 -coverprofile=coverage.out ./...
- name: SonarCloud Scan
if: matrix.go == env.DEFAULT_GO && matrix.db == env.DEFAULT_DB && github.repository_owner == 'exasol' && env.SONAR_TOKEN != null
uses: SonarSource/sonarcloud-github-action@master
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
- name: Run vulnerability check
if: matrix.go == env.DEFAULT_GO && matrix.db == env.DEFAULT_DB
run: |
go install golang.org/x/vuln/cmd/govulncheck@latest
govulncheck -version
govulncheck -format text -mode source -scan symbol -show verbose -test ./...
build:
needs: matrix-build
runs-on: ubuntu-latest
steps:
- run: echo "Build successful"