6
6
CGO_ENABLED : 0
7
7
8
8
jobs :
9
- golangci- lint :
9
+ lint :
10
10
runs-on : ubuntu-latest
11
11
steps :
12
- - name : Checkout code
13
- uses : actions/checkout@v2
14
- - name : Install Go
15
- uses : actions/setup-go@v2
16
- with :
17
- go-version : ' 1.14.6'
18
- - name : golangci-lint
19
- uses : golangci/golangci-lint-action@v2
20
- goimports :
21
- runs-on : ubuntu-latest
22
- steps :
23
- - name : Checkout code
24
- uses : actions/checkout@v2
25
- - name : Install Go
26
- uses : actions/setup-go@v2
27
- with :
28
- go-version : ' 1.14.6'
29
- - name : goimports
30
- run : go get golang.org/x/tools/cmd/goimports && goimports -d . | (! grep .)
31
- vet :
32
- runs-on : ubuntu-latest
33
- steps :
34
- - name : Checkout code
35
- uses : actions/checkout@v2
36
- - name : Install Go
37
- uses : actions/setup-go@v2
38
- with :
39
- go-version : ' 1.14.6'
40
- - name : go vet
41
- run : go vet ./...
12
+ - name : Checkout code
13
+ uses : actions/checkout@v2
14
+ - name : Install Go
15
+ uses : actions/setup-go@v2
16
+ with :
17
+ go-version : " 1.17.0"
18
+ - name : make lint
19
+ run : make lint
42
20
test :
43
21
runs-on : ubuntu-latest
44
22
steps :
45
- - name : Checkout code
46
- uses : actions/checkout@v2
47
- - name : Install Go
48
- uses : actions/setup-go@v2
49
- with :
50
- go-version : ' 1.14.6'
51
- - name : go test
52
- run : go test -coverprofile=coverage.txt ./...
53
- - name : upload codecov
54
- run : bash <(curl -s https://codecov.io/bash)
23
+ - name : Checkout code
24
+ uses : actions/checkout@v2
25
+ - name : Install Go
26
+ uses : actions/setup-go@v2
27
+ with :
28
+ go-version : " 1.14.6"
29
+ - name : go test
30
+ run : go test -coverprofile=coverage.txt ./...
31
+ - name : upload codecov
32
+ run : bash <(curl -s https://codecov.io/bash)
55
33
ci-checks :
56
34
runs-on : ubuntu-latest
57
35
steps :
58
- - name : Checkout code
59
- uses : actions/checkout@v2
60
- - uses : cachix/install-nix-action@v12
61
- with :
62
- nix_path : nixpkgs=channel:nixos-unstable
63
- - run : ./ci-checks.sh
36
+ - name : Checkout code
37
+ uses : actions/checkout@v2
38
+ - uses : cachix/install-nix-action@v12
39
+ with :
40
+ nix_path : nixpkgs=channel:nixos-unstable
41
+ - run : ./ci-checks.sh
64
42
validation :
65
43
runs-on : ubuntu-latest
66
44
needs :
67
45
- ci-checks
68
- - goimports
69
- - golangci-lint
46
+ - lint
70
47
- test
71
- - vet
72
48
steps :
73
- - name : fake
74
- run : echo ":+1:"
49
+ - name : fake
50
+ run : echo ":+1:"
75
51
crosscompile :
76
52
runs-on : ubuntu-latest
77
53
needs :
78
54
- validation
79
55
steps :
80
- - name : Checkout code
81
- uses : actions/checkout@v2
82
- - name : Install Go
83
- uses : actions/setup-go@v2
84
- with :
85
- go-version : ' 1.14.6'
86
- - run : make crosscompile -j$(nproc)
87
- - name : Upload tink-cli binaries
88
- uses : actions/upload-artifact@v2
89
- with :
56
+ - name : Checkout code
57
+ uses : actions/checkout@v2
58
+ - name : Install Go
59
+ uses : actions/setup-go@v2
60
+ with :
61
+ go-version : " 1.14.6"
62
+ - run : make crosscompile -j$(nproc)
63
+ - name : Upload tink-cli binaries
64
+ uses : actions/upload-artifact@v2
65
+ with :
90
66
name : tink-cli
91
67
path : cmd/tink-cli/tink-cli-*
92
- - name : Upload tink-server binaries
93
- uses : actions/upload-artifact@v2
94
- with :
68
+ - name : Upload tink-server binaries
69
+ uses : actions/upload-artifact@v2
70
+ with :
95
71
name : tink-server
96
72
path : cmd/tink-server/tink-server-*
97
- - name : Upload tink-worker binaries
98
- uses : actions/upload-artifact@v2
99
- with :
73
+ - name : Upload tink-worker binaries
74
+ uses : actions/upload-artifact@v2
75
+ with :
100
76
name : tink-worker
101
77
path : cmd/tink-worker/tink-worker-*
102
78
docker-images :
@@ -113,35 +89,35 @@ jobs:
113
89
- repository : quay.io/tinkerbell/tink-worker
114
90
binary : tink-worker
115
91
steps :
116
- - name : Docker Image Tag for Sha
117
- id : docker-image-tag
118
- run : |
119
- echo ::set-output name=tags::${{ matrix.repository }}:latest,${{ matrix.repository }}:sha-${GITHUB_SHA::8}
120
- - name : Checkout code
121
- uses : actions/checkout@v2
122
- - name : Login to quay.io
123
- uses : docker/login-action@v1
124
- if : ${{ startsWith(github.ref, 'refs/heads/main') }}
125
- with :
126
- registry : quay.io
127
- username : ${{ secrets.QUAY_USERNAME }}
128
- password : ${{ secrets.QUAY_PASSWORD }}
129
- - name : Set up QEMU
130
- uses : docker/setup-qemu-action@v1
131
- - name : Set up Docker Buildx
132
- uses : docker/setup-buildx-action@v1
133
- - name : Download ${{ matrix.binary }} artifacts
134
- uses : actions/download-artifact@v2
135
- with :
92
+ - name : Docker Image Tag for Sha
93
+ id : docker-image-tag
94
+ run : |
95
+ echo ::set-output name=tags::${{ matrix.repository }}:latest,${{ matrix.repository }}:sha-${GITHUB_SHA::8}
96
+ - name : Checkout code
97
+ uses : actions/checkout@v2
98
+ - name : Login to quay.io
99
+ uses : docker/login-action@v1
100
+ if : ${{ startsWith(github.ref, 'refs/heads/main') }}
101
+ with :
102
+ registry : quay.io
103
+ username : ${{ secrets.QUAY_USERNAME }}
104
+ password : ${{ secrets.QUAY_PASSWORD }}
105
+ - name : Set up QEMU
106
+ uses : docker/setup-qemu-action@v1
107
+ - name : Set up Docker Buildx
108
+ uses : docker/setup-buildx-action@v1
109
+ - name : Download ${{ matrix.binary }} artifacts
110
+ uses : actions/download-artifact@v2
111
+ with :
136
112
name : ${{ matrix.binary}}
137
113
path : cmd/${{ matrix.binary }}
138
- - name : Fix Permissions
139
- run : chmod +x cmd/${{ matrix.binary }}/${{ matrix.binary }}*
140
- - name : ${{ matrix.repository }}
141
- uses : docker/build-push-action@v2
142
- with :
143
- context : cmd/${{ matrix.binary }}/
144
- cache-from : type=registry,ref=${{ matrix.repository }}:latest
145
- push : ${{ startsWith(github.ref, 'refs/heads/main') }}
146
- tags : ${{ steps.docker-image-tag.outputs.tags }}
147
- platforms : linux/386,linux/amd64,linux/arm/v6,linux/arm/v7,linux/arm64
114
+ - name : Fix Permissions
115
+ run : chmod +x cmd/${{ matrix.binary }}/${{ matrix.binary }}*
116
+ - name : ${{ matrix.repository }}
117
+ uses : docker/build-push-action@v2
118
+ with :
119
+ context : cmd/${{ matrix.binary }}/
120
+ cache-from : type=registry,ref=${{ matrix.repository }}:latest
121
+ push : ${{ startsWith(github.ref, 'refs/heads/main') }}
122
+ tags : ${{ steps.docker-image-tag.outputs.tags }}
123
+ platforms : linux/386,linux/amd64,linux/arm/v6,linux/arm/v7,linux/arm64
0 commit comments