-
Notifications
You must be signed in to change notification settings - Fork 0
115 lines (94 loc) · 2.42 KB
/
test.yml
File metadata and controls
115 lines (94 loc) · 2.42 KB
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
105
106
107
108
109
110
111
112
113
114
115
name: CI
on: [push, pull_request]
jobs:
build:
name: Build
runs-on: ubuntu-latest
env:
GOTOOLCHAIN: go1.24.4
steps:
- uses: actions/checkout@v3
- name: Set up Go
uses: actions/setup-go@v3
with:
go-version: '1.24.4'
check-latest: true
- name: Build
run: go build -v ./...
- name: Build graft binary
run: go build ./cmd/graft
- name: Upload graft binary
uses: actions/upload-artifact@v4
with:
name: graft-binary
path: ./graft
vet:
name: Vet
runs-on: ubuntu-latest
env:
GOTOOLCHAIN: go1.24.4
steps:
- uses: actions/checkout@v3
- name: Set up Go
uses: actions/setup-go@v3
with:
go-version: '1.24.4'
check-latest: true
- name: Run go vet
run: go list ./... | grep -v vendor | xargs go vet
gosec:
name: Security Scan
runs-on: ubuntu-latest
env:
GOTOOLCHAIN: go1.24.4
steps:
- uses: actions/checkout@v3
- name: Set up Go
uses: actions/setup-go@v3
with:
go-version: '1.24.4'
check-latest: true
- name: Run Gosec Security Scanner
uses: securego/gosec@master
with:
args: ./...
unit-tests:
name: Unit Tests
needs: [build, vet, gosec]
runs-on: ubuntu-latest
env:
GOTOOLCHAIN: go1.24.4
steps:
- uses: actions/checkout@v3
- name: Set up Go
uses: actions/setup-go@v3
with:
go-version: '1.24.4'
check-latest: true
- name: Run unit tests
run: go list ./... | grep -v vendor | xargs go test
integration-tests:
name: Integration Tests
needs: unit-tests
runs-on: ubuntu-latest
env:
GOTOOLCHAIN: go1.24.4
steps:
- uses: actions/checkout@v3
- name: Set up Go
uses: actions/setup-go@v3
with:
go-version: '1.24.4'
check-latest: true
- name: Download graft binary
uses: actions/download-artifact@v4
with:
name: graft-binary
- name: Make graft binary executable
run: chmod +x ./graft
- name: Run integration tests with Docker
run: |
# Make integration script executable
chmod +x scripts/integration
# Run integration tests
make integration