17
17
GOCACHE : /home/runner/work/go/pkg/build
18
18
GOPATH : /home/runner/work/go
19
19
GO_VERSION : 1.17.x
20
- GOPRIVATE : " github.com/lightninglabs/aperture-mailbox"
21
- TOKEN : ${{ secrets.ACCESS_TOKEN }}
22
20
23
21
jobs :
22
+ # #######################
23
+ # build pkg and wasm bin
24
+ # #######################
24
25
build :
25
- name : build package, run linter
26
+ name : build package and wasm
26
27
runs-on : ubuntu-latest
27
28
steps :
28
29
- name : git checkout
@@ -32,32 +33,132 @@ jobs:
32
33
uses : actions/cache@v1
33
34
with :
34
35
path : /home/runner/work/go
35
- key : lndclient -${{ runner.os }}-go-${{ env.GO_VERSION }}-${{ github.job }}-${{ hashFiles('**/go.sum') }}
36
+ key : lnc -${{ runner.os }}-go-${{ env.GO_VERSION }}-${{ github.job }}-${{ hashFiles('**/go.sum') }}
36
37
restore-keys : |
37
- lndclient -${{ runner.os }}-go-${{ env.GO_VERSION }}-${{ github.job }}-${{ hashFiles('**/go.sum') }}
38
- lndclient -${{ runner.os }}-go-${{ env.GO_VERSION }}-${{ github.job }}-
39
- lndclient -${{ runner.os }}-go-${{ env.GO_VERSION }}-
40
- lndclient -${{ runner.os }}-go-
38
+ lnc -${{ runner.os }}-go-${{ env.GO_VERSION }}-${{ github.job }}-${{ hashFiles('**/go.sum') }}
39
+ lnc -${{ runner.os }}-go-${{ env.GO_VERSION }}-${{ github.job }}-
40
+ lnc -${{ runner.os }}-go-${{ env.GO_VERSION }}-
41
+ lnc -${{ runner.os }}-go-
41
42
42
43
- name : setup go ${{ env.GO_VERSION }}
43
44
uses : actions/setup-go@v2
44
45
with :
45
46
go-version : ' ~${{ env.GO_VERSION }}'
46
47
47
- - name : configure for private repos
48
- run : git config --global url."https://roasbeef:${TOKEN}@github.com".insteadOf "https://github.com"
49
-
50
- - name : lint
51
- run : make lint
52
-
53
48
- name : go compile
54
49
run : make build
55
50
56
51
- name : wasm compile
57
52
run : make wasm
58
53
54
+ # #######################
55
+ # lint code
56
+ # #######################
57
+ lint :
58
+ name : lint code
59
+ runs-on : ubuntu-latest
60
+ steps :
61
+ - name : git checkout
62
+ uses : actions/checkout@v2
63
+
64
+ - name : Fetch all history for linter
65
+ run : git fetch --prune --unshallow
66
+
67
+ - name : go cache
68
+ uses : actions/cache@v1
69
+ with :
70
+ path : /home/runner/work/go
71
+ key : lnc-${{ runner.os }}-go-${{ env.GO_VERSION }}-${{ github.job }}-${{ hashFiles('**/go.sum') }}
72
+ restore-keys : |
73
+ lnc-${{ runner.os }}-go-${{ env.GO_VERSION }}-${{ github.job }}-${{ hashFiles('**/go.sum') }}
74
+ lnc-${{ runner.os }}-go-${{ env.GO_VERSION }}-${{ github.job }}-
75
+ lnc-${{ runner.os }}-go-${{ env.GO_VERSION }}-
76
+ lnc-${{ runner.os }}-go-
77
+
78
+ - name : setup go ${{ env.GO_VERSION }}
79
+ uses : actions/setup-go@v2
80
+ with :
81
+ go-version : ' ${{ env.GO_VERSION }}'
82
+
83
+ - name : lint
84
+ run : GOGC=50 make lint
85
+
86
+ # #######################
87
+ # run unit tests
88
+ # #######################
89
+ unit-test :
90
+ name : run unit tests
91
+ runs-on : ubuntu-latest
92
+ strategy :
93
+ # Allow other tests in the matrix to continue if one fails.
94
+ fail-fast : false
95
+ matrix :
96
+ unit_type :
97
+ - unit
98
+ - unit-race
99
+ steps :
100
+ - name : git checkout
101
+ uses : actions/checkout@v2
102
+
103
+ - name : go cache
104
+ uses : actions/cache@v1
105
+ with :
106
+ path : /home/runner/work/go
107
+ key : lnc-${{ runner.os }}-go-${{ env.GO_VERSION }}-${{ github.job }}-${{ hashFiles('**/go.sum') }}
108
+ restore-keys : |
109
+ lnc-${{ runner.os }}-go-${{ env.GO_VERSION }}-${{ github.job }}-${{ hashFiles('**/go.sum') }}
110
+ lnc-${{ runner.os }}-go-${{ env.GO_VERSION }}-${{ github.job }}-
111
+ lnc-${{ runner.os }}-go-${{ env.GO_VERSION }}-
112
+ lnc-${{ runner.os }}-go-
113
+
114
+ - name : setup go ${{ env.GO_VERSION }}
115
+ uses : actions/setup-go@v2
116
+ with :
117
+ go-version : ' ~${{ env.GO_VERSION }}'
118
+
119
+ - name : run ${{ matrix.unit_type }}
120
+ run : make ${{ matrix.unit_type }}
121
+
122
+ # #######################
123
+ # run integration tests
124
+ # #######################
125
+ integration-test :
126
+ name : run itests
127
+ runs-on : ubuntu-latest
128
+ steps :
129
+ - name : git checkout
130
+ uses : actions/checkout@v2
131
+
132
+ - name : go cache
133
+ uses : actions/cache@v1
134
+ with :
135
+ path : /home/runner/work/go
136
+ key : lnc-${{ runner.os }}-go-${{ env.GO_VERSION }}-${{ github.job }}-${{ hashFiles('**/go.sum') }}
137
+ restore-keys : |
138
+ lnc-${{ runner.os }}-go-${{ env.GO_VERSION }}-${{ github.job }}-${{ hashFiles('**/go.sum') }}
139
+ lnc-${{ runner.os }}-go-${{ env.GO_VERSION }}-${{ github.job }}-
140
+ lnc-${{ runner.os }}-go-${{ env.GO_VERSION }}-
141
+ lnc-${{ runner.os }}-go-
142
+
143
+ - name : setup go ${{ env.GO_VERSION }}
144
+ uses : actions/setup-go@v2
145
+ with :
146
+ go-version : ' ${{ env.GO_VERSION }}'
147
+
59
148
- name : prepare for itest
60
149
run : mkdir -p /home/runner/.aperture
61
150
62
- - name : unit-race
63
- run : make unit-race
151
+ - name : run itest
152
+ run : make itest
153
+
154
+ - name : Zip log files on failure
155
+ if : ${{ failure() }}
156
+ run : 7z a logs-itest.zip itest/**/*.log
157
+
158
+ - name : Upload log files on failure
159
+ uses : actions/upload-artifact@v2.2.4
160
+ if : ${{ failure() }}
161
+ with :
162
+ name : logs-itest
163
+ path : logs-itest.zip
164
+ retention-days : 5
0 commit comments