Skip to content

Commit b3f0d4e

Browse files
committed
CI: reduce GHA parallelism to avoid limit
Signed-off-by: Akihiro Suda <[email protected]>
1 parent 03ffa07 commit b3f0d4e

File tree

1 file changed

+30
-72
lines changed

1 file changed

+30
-72
lines changed

.github/workflows/test.yml

Lines changed: 30 additions & 72 deletions
Original file line numberDiff line numberDiff line change
@@ -8,84 +8,38 @@ on:
88
pull_request:
99

1010
jobs:
11-
golangci-lint:
11+
basic:
12+
name: "Lints & Unit tests"
1213
runs-on: ubuntu-20.04
13-
timeout-minutes: 20
14+
timeout-minutes: 30
1415
steps:
16+
- uses: actions/setup-go@v2
17+
with:
18+
go-version: 1.17.x
1519
- uses: actions/checkout@v2
1620
with:
1721
fetch-depth: 1
18-
- name: golangci-lint
22+
- name: Run golangci-lint
1923
uses: golangci/golangci-lint-action@v2
2024
with:
2125
version: v1.42.1
2226
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
3127
- name: Run yamllint
3228
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
4129
- name: Install shellcheck
4230
run: |
4331
sudo apt-get update
4432
sudo apt-get install -y shellcheck
4533
- name: Run shellcheck
4634
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
5835
- name: Install shfmt
5936
run: GO111MODULE=on go get mvdan.cc/sh/v3/cmd/shfmt
6037
- name: Run shfmt
6138
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
7241
with:
7342
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
8943
- name: Unit tests
9044
run: go test -v ./...
9145
- name: Make
@@ -101,18 +55,15 @@ jobs:
10155
name: Integration tests
10256
runs-on: macos-11
10357
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]
10958
steps:
11059
- uses: actions/setup-go@v2
11160
with:
11261
go-version: 1.17.x
11362
- uses: actions/checkout@v2
11463
with:
11564
fetch-depth: 1
65+
- name: Unit tests
66+
run: go test -v ./...
11667
- name: Make
11768
run: make
11869
- name: Install
@@ -132,7 +83,6 @@ jobs:
13283
time brew install qemu bash coreutils curl jq
13384
time brew upgrade
13485
- name: Install vde_switch and vde_vmnet
135-
if: matrix.example == 'vmnet.yaml'
13686
env:
13787
# 2021-12-12
13888
VDE2_VERSION: 74278b9b7cf816f0356181f387012fdeb6d65b52
@@ -161,26 +111,34 @@ jobs:
161111
(
162112
limactl sudoers | sudo tee /etc/sudoers.d/lima
163113
)
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
172114
- name: Cache ~/Library/Caches/lima/download
173115
uses: actions/cache@v2
174116
with:
175117
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"
178134
uses: nick-invision/retry@v2
179135
with:
180136
timeout_minutes: 30
181137
retry_on: error
182138
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.
184142

185143
artifacts-darwin:
186144
name: Artifacts Darwin

0 commit comments

Comments
 (0)