Skip to content

Commit 128276f

Browse files
committed
CI: migrate test-colima.sh to colima.bats
Also updated to: - use the latest Colima - test port forwarding Signed-off-by: Akihiro Suda <[email protected]>
1 parent 598e0e8 commit 128276f

File tree

3 files changed

+28
-28
lines changed

3 files changed

+28
-28
lines changed

.github/workflows/test.yml

Lines changed: 12 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -395,27 +395,23 @@ jobs:
395395
- name: Install
396396
run: sudo make install
397397
- name: Install colima
398+
- name: "Install colima"
399+
id: install-colima
398400
run: |
399401
git clone https://github.com/abiosoft/colima
400402
cd colima
401-
git checkout ${{ matrix.colima-version }}
403+
latest="$(git tag --sort=-v:refname | head -n1)"
404+
git checkout "$latest"
402405
make
403406
sudo make install
404-
- name: Install test dependencies
405-
run: |
406-
sudo apt-get update
407-
sudo ./hack/install-qemu.sh
408-
- name: "Show cache"
409-
run: ./hack/debug-cache.sh
410-
- name: "Test"
411-
uses: nick-fields/retry@ce71cc2ab81d554ebbe88c79ab5975992d79ba08 # v3.0.2
412-
with:
413-
timeout_minutes: 30
414-
retry_on: error
415-
max_attempts: 3
416-
command: ./hack/test-colima.sh
417-
- name: "Show cache"
418-
run: ./hack/debug-cache.sh
407+
echo "version=$latest" >>$GITHUB_OUTPUT
408+
- name: "Cache colima"
409+
uses: actions/cache@9255dc7a253b0ccc959486e2bca901246202afeb # v5.0.1
410+
with:
411+
path: ~/.cache/colima
412+
key: colima-${{ steps.install-colima.outputs.version }}
413+
- name: "Run BATS colima tests"
414+
run: ./hack/bats/lib/bats-core/bin/bats --timing ./hack/bats/extras/colima.bats
419415

420416
vmnet:
421417
name: "VMNet tests (QEMU)"

hack/bats/extras/colima.bats

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
# SPDX-FileCopyrightText: Copyright The Lima Authors
2+
# SPDX-License-Identifier: Apache-2.0
3+
4+
load "../helpers/load"
5+
6+
@test 'Docker' {
7+
colima start
8+
docker run -p 8080:80 -d --name nginx "${TEST_CONTAINER_IMAGES[nginx]}"
9+
sleep 5
10+
run curl -sSI http://localhost:8080
11+
[ "$status" -eq 0 ]
12+
[[ "$output" == *"200 OK"* ]]
13+
docker rm -f nginx
14+
colima stop
15+
colima delete -f
16+
}

hack/test-colima.sh

Lines changed: 0 additions & 12 deletions
This file was deleted.

0 commit comments

Comments
 (0)