-
Notifications
You must be signed in to change notification settings - Fork 0
104 lines (95 loc) · 2.94 KB
/
pr.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
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
name: Pull request
on:
pull_request:
branches:
- main
permissions:
id-token: write
contents: read
jobs:
build:
name: Build
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Build docker image
env:
REF: ${{ github. sha }}
run: make build
lint:
name: Lint
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 2
- uses: actions/setup-go@v4
with:
go-version: '1.21'
- name: Install dependencies
run: go mod download
- name: Install GolangCI Lint
run: curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b $(go env GOPATH)/bin v1.55.2
- name: golangci-lint
run: golangci-lint run --timeout=30m --max-same-issues=0 --out-format=github-actions
test:
name: Unit Test
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-go@v4
with:
go-version: '1.21'
- name: Install dependencies
run: go mod download
- name: Run Tests
run: go test -cover `go list ./... | grep -v 'pkg/client'`
test-sql-workflow:
name: Test SQL
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
target:
- name: "dev"
client-id: "0f26a8a6-3593-4eb3-9d74-b2fb814c6fee"
server: "sql-radix-vulnerability-scan-dev.database.windows.net"
env:
connection: >-
Server=${{matrix.target.server}};
Initial Catalog=radix-vulnerability-scan;
Authentication=Active Directory Default;
Encrypt=True;
TrustServerCertificate=False;
Connection Timeout=30;
steps:
- uses: actions/checkout@v4
- uses: azure/login@v1
with:
client-id: ${{matrix.target.client-id}}
tenant-id: "3aa4a235-b6e2-48d5-9195-7fcf05b459b0"
allow-no-subscriptions: true
- uses: azure/sql-action@v2.2.1
with:
connection-string: ${{env.connection}}
path: './azure-infrastructure/sql-scripts/predeploy.sql'
- uses: azure/sql-action@v2.2.1
with:
connection-string: ${{env.connection}}
path: './azure-infrastructure/sql-scripts/roles.sql'
- uses: azure/sql-action@v2.2.1
with:
connection-string: ${{env.connection}}
path: './azure-infrastructure/sql-scripts/types.sql'
- uses: azure/sql-action@v2.2.1
with:
connection-string: ${{env.connection}}
path: './azure-infrastructure/sql-scripts/tables.sql'
- uses: azure/sql-action@v2.2.1
with:
connection-string: ${{env.connection}}
path: './azure-infrastructure/sql-scripts/views.sql'
- uses: azure/sql-action@v2.2.1
with:
connection-string: ${{env.connection}}
path: './azure-infrastructure/sql-scripts/procedures.sql'