-
Notifications
You must be signed in to change notification settings - Fork 1
68 lines (50 loc) · 1.35 KB
/
Unique-CI.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
name: Unique CI
on:
push:
branches: [ master ]
pull_request:
branches: [ master ]
jobs:
build:
name: Build
runs-on: ubuntu-latest
steps:
- name: Set up Go 1.x
uses: actions/setup-go@v2
with:
go-version: ^1.13
id: go
- name: Check out code into the Go module directory
uses: actions/checkout@v2
- name: Go-linter
uses: Jerome1337/golint-action@v1.0.2
- name: Build Lean Go Binary
run: go build -o target/unique -v -ldflags="-s -w " mgudmund/unique
env:
GOOS: linux
GOARCH: amd64
CGO_ENABLED: 0
- name: Trim the fat with UPX
uses: crazy-max/ghaction-upx@v1
with:
version: latest
file: ./target/unique
- name: Test
run: go test -v .
- name: Run ShiftLeft Security Scans
uses: ShiftLeftSecurity/scan-action@v1.0.0
# upload artifacts
- name: Upload ShiftLeft Security Reports
uses: actions/upload-artifact@v2.1.4
with:
name: reports
path: reports
- name: Build and push Docker images
uses: docker/build-push-action@v1
with:
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
registry: docker.pkg.github.com
repository: mgudmund/unique/unique
tag_with_ref: true
tag_with_sha: true