8
8
pull_request :
9
9
10
10
jobs :
11
- golangci-lint :
11
+ basic :
12
+ name : " Lints & Unit tests"
12
13
runs-on : ubuntu-20.04
13
- timeout-minutes : 20
14
+ timeout-minutes : 30
14
15
steps :
16
+ - uses : actions/setup-go@v2
17
+ with :
18
+ go-version : 1.17.x
15
19
- uses : actions/checkout@v2
16
20
with :
17
21
fetch-depth : 1
18
- - name : golangci-lint
22
+ - name : Run golangci-lint
19
23
uses : golangci/golangci-lint-action@v2
20
24
with :
21
25
version : v1.42.1
22
26
args : --verbose
23
-
24
- yamllint :
25
- runs-on : ubuntu-20.04
26
- timeout-minutes : 20
27
- steps :
28
- - uses : actions/checkout@v2
29
- with :
30
- fetch-depth : 1
31
27
- name : Run yamllint
32
28
run : yamllint .
33
-
34
- shellcheck :
35
- runs-on : ubuntu-20.04
36
- timeout-minutes : 20
37
- steps :
38
- - uses : actions/checkout@v2
39
- with :
40
- fetch-depth : 1
41
29
- name : Install shellcheck
42
30
run : |
43
31
sudo apt-get update
44
32
sudo apt-get install -y shellcheck
45
33
- name : Run shellcheck
46
34
run : find . -name '*.sh' | xargs shellcheck
47
-
48
- shfmt :
49
- runs-on : ubuntu-20.04
50
- timeout-minutes : 20
51
- steps :
52
- - uses : actions/setup-go@v2
53
- with :
54
- go-version : 1.17.x
55
- - uses : actions/checkout@v2
56
- with :
57
- fetch-depth : 1
58
35
- name : Install shfmt
59
36
run : GO111MODULE=on go get mvdan.cc/sh/v3/cmd/shfmt
60
37
- name : Run shfmt
61
38
run : find . -name '*.sh' | xargs shfmt -s -d
62
-
63
- check-hyperlinks :
64
- name : Check links in README.md
65
- runs-on : ubuntu-20.04
66
- timeout-minutes : 20
67
- steps :
68
- - uses : actions/checkout@v2
69
- with :
70
- fetch-depth : 1
71
- - uses : docker://dkhamsing/awesome_bot:latest
39
+ - name : Check hyperlinks
40
+ uses : docker://dkhamsing/awesome_bot:latest
72
41
with :
73
42
args : /github/workspace/README.md --allow-dupe --allow-redirect --request-delay 1 --white-list https://img.shields.io,http://127.0.0.1:8080,https://github.com/lima-vm/lima/releases/download
74
-
75
- basic :
76
- name : Basic tests
77
- runs-on : ${{ matrix.os }}
78
- strategy :
79
- matrix :
80
- os : [macos-11, ubuntu-20.04]
81
- timeout-minutes : 20
82
- steps :
83
- - uses : actions/setup-go@v2
84
- with :
85
- go-version : 1.17.x
86
- - uses : actions/checkout@v2
87
- with :
88
- fetch-depth : 1
89
43
- name : Unit tests
90
44
run : go test -v ./...
91
45
- name : Make
@@ -101,18 +55,15 @@ jobs:
101
55
name : Integration tests
102
56
runs-on : macos-11
103
57
timeout-minutes : 120
104
- strategy :
105
- matrix :
106
- # GHA macOS is slow and flaky, so we only test a few YAMLS here.
107
- # Other yamls are tested on Linux instances of Cirrus.
108
- example : [default.yaml, alpine.yaml, vmnet.yaml]
109
58
steps :
110
59
- uses : actions/setup-go@v2
111
60
with :
112
61
go-version : 1.17.x
113
62
- uses : actions/checkout@v2
114
63
with :
115
64
fetch-depth : 1
65
+ - name : Unit tests
66
+ run : go test -v ./...
116
67
- name : Make
117
68
run : make
118
69
- name : Install
132
83
time brew install qemu bash coreutils curl jq
133
84
time brew upgrade
134
85
- name : Install vde_switch and vde_vmnet
135
- if : matrix.example == 'vmnet.yaml'
136
86
env :
137
87
# 2021-12-12
138
88
VDE2_VERSION : 74278b9b7cf816f0356181f387012fdeb6d65b52
@@ -161,26 +111,34 @@ jobs:
161
111
(
162
112
limactl sudoers | sudo tee /etc/sudoers.d/lima
163
113
)
164
- - name : Prepare ssh
165
- run : |
166
- if [ -e ~/.ssh/id_rsa ]; then
167
- echo "~/.ssh/id_rsa already exists"
168
- else
169
- echo "Generating ~/.ssh/id_rsa"
170
- ssh-keygen -b 2048 -t rsa -f ~/.ssh/id_rsa -q -N ""
171
- fi
172
114
- name : Cache ~/Library/Caches/lima/download
173
115
uses : actions/cache@v2
174
116
with :
175
117
path : ~/Library/Caches/lima/download
176
- key : ${{ runner.os }}-examples/${{ matrix.example }}
177
- - name : Test
118
+ key : ${{ runner.os }}-integration
119
+ - name : " Test default.yaml"
120
+ uses : nick-invision/retry@v2
121
+ with :
122
+ timeout_minutes : 30
123
+ retry_on : error
124
+ max_attempts : 3
125
+ command : ./hack/test-example.sh examples/default.yaml
126
+ - name : " Test alpine.yaml"
127
+ uses : nick-invision/retry@v2
128
+ with :
129
+ timeout_minutes : 30
130
+ retry_on : error
131
+ max_attempts : 3
132
+ command : ./hack/test-example.sh examples/alpine.yaml
133
+ - name : " Test vmnet.yaml"
178
134
uses : nick-invision/retry@v2
179
135
with :
180
136
timeout_minutes : 30
181
137
retry_on : error
182
138
max_attempts : 3
183
- command : ./hack/test-example.sh examples/${{ matrix.example }}
139
+ command : ./hack/test-example.sh examples/vmnet.yaml
140
+ # GHA macOS is slow and flaky, so we only test a few YAMLS here.
141
+ # Other yamls are tested on Linux instances of Cirrus.
184
142
185
143
artifacts-darwin :
186
144
name : Artifacts Darwin
0 commit comments