-
Notifications
You must be signed in to change notification settings - Fork 212
144 lines (138 loc) · 3.69 KB
/
porter.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
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
name: porter
on:
push:
branches:
- main
pull_request:
branches:
- main
paths-ignore:
- 'docs/**'
env:
GOVERSION: 1.21.3
jobs:
Build:
name: Native Compile
runs-on: ubuntu-latest
steps:
- name: checkout
uses: actions/checkout@v3.5.0
- uses: actions/setup-go@v4
with:
go-version: "${{ env.GOVERSION }}" # The Go version to download (if necessary) and use.
cache: true
- run: go version
- name: Native Build
run: go run mage.go build
shell: bash
- name: Check if all doc changes have been pushed
run: |
if [ "$(git status --porcelain docs/)" ];
then
echo "There are changes to the documentation that have not been pushed! Please push the following files after build"
git status -s docs/
exit 1
else
echo "All documentation changes have been pushed"
fi
shell: bash
- name: Publish Native Binaries
uses: actions/upload-artifact@v3.1.1
with:
name: build-bin
path: "${{ github.workspace }}/bin"
XBuild:
name: Cross Compile
runs-on: ubuntu-latest
steps:
- name: checkout
uses: actions/checkout@v3.5.0
- uses: actions/setup-go@v4
with:
go-version: "${{ env.GOVERSION }}" # The Go version to download (if necessary) and use.
cache: true
- run: go version
- name: Cross Compile
run: go run mage.go -v XBuildAll
shell: bash
- name: Publish Release Binaries
uses: actions/upload-artifact@v3.1.1
with:
name: xbuild-bin
path: "${{ github.workspace }}/bin"
Unit_test:
name: Unit Test
runs-on: ubuntu-latest
steps:
- name: checkout
uses: actions/checkout@v3.5.0
- uses: actions/setup-go@v4
with:
go-version: "${{ env.GOVERSION }}" # The Go version to download (if necessary) and use.
cache: true
- run: go version
- name: Unit Test
run: go run mage.go -v TestUnit
shell: bash
VetLint:
name: Vet and Lint
runs-on: ubuntu-latest
steps:
- name: checkout
uses: actions/checkout@v3.5.0
- uses: actions/setup-go@v4
with:
go-version: "${{ env.GOVERSION }}" # The Go version to download (if necessary) and use.
cache: true
- run: go version
- name: Vet
run: go run mage.go Vet
shell: bash
- name: Lint
run: go run mage.go Lint
shell: bash
Build-docker-images:
name: Build Docker Images
needs:
- XBuild
runs-on: ubuntu-latest
if: success()
steps:
- name: checkout
uses: actions/checkout@v3.5.0
- uses: actions/setup-go@v4
with:
go-version: "${{ env.GOVERSION }}" # The Go version to download (if necessary) and use.
cache: true
- run: go version
- name: Download Cross-Compiled Porter Binaries
uses: actions/download-artifact@v3.0.1
with:
name: xbuild-bin
path: bin
- name: Setup Bin
run: go run mage.go UseXBuildBinaries
- name: Build Docker Images
run: go run mage.go BuildImages
Smoke-test:
name: Smoke Test
needs:
- XBuild
runs-on: ubuntu-latest
steps:
- name: checkout
uses: actions/checkout@v3.5.0
- name: Download Cross-Compiled Porter Binaries
uses: actions/download-artifact@v3.0.1
with:
name: xbuild-bin
path: bin
- uses: actions/setup-go@v4
with:
go-version: "${{ env.GOVERSION }}" # The Go version to download (if necessary) and use.
cache: true
- run: go version
- name: Setup Bin
run: go run mage.go UseXBuildBinaries
- name: Run Smoke Tests
run: go run mage.go -v TestSmoke