Skip to content

Commit d7f0a73

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 <akihiro.suda.cz@hco.ntt.co.jp>
1 parent 62ca0bb commit d7f0a73

File tree

3 files changed

+28
-56
lines changed

3 files changed

+28
-56
lines changed

.github/workflows/test.yml

Lines changed: 12 additions & 44 deletions
Original file line numberDiff line numberDiff line change
@@ -383,55 +383,23 @@ jobs:
383383
run: ./hack/bats/lib/bats-core/bin/bats --timing ./hack/bats/extras/k8s.bats
384384
env:
385385
LIMA_BATS_ALL_TESTS_RETRIES: 3
386-
387-
colima:
388-
name: "Colima tests (QEMU, Linux host)"
389-
runs-on: ubuntu-24.04
390-
timeout-minutes: 120
391-
strategy:
392-
matrix:
393-
colima-version: ["v0.6.5"]
394-
steps:
395-
- uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
396-
with:
397-
# fetch-depth is set to 0 to let `limactl --version` print semver-ish version
398-
# fetch-depth: 0 is required for Colima integration test because Colima
399-
# checks Lima's version and requires proper semantic version format
400-
fetch-depth: 0
401-
ref: ${{ github.event.pull_request.head.sha }}
402-
- uses: actions/setup-go@4dc6199c7b1a012772edbd06daecab0f50c9053c # v6.1.0
403-
with:
404-
go-version: 1.25.x
405-
- uses: actions/cache@0057852bfaa89a56745cba8c7296529d2fc39830 # v4.3.0
406-
with:
407-
path: ~/.cache/lima/download
408-
key: ${{ runner.os }}-colima-${{ matrix.colima-version }}
409-
- name: Make
410-
run: make
411-
- name: Install
412-
run: sudo make install
413-
- name: Install colima
386+
- name: "Install colima"
387+
id: install-colima
414388
run: |
415389
git clone https://github.com/abiosoft/colima
416390
cd colima
417-
git checkout ${{ matrix.colima-version }}
391+
latest="$(git tag --sort=-v:refname | head -n1)"
392+
git checkout "$latest"
418393
make
419394
sudo make install
420-
- name: Install test dependencies
421-
run: |
422-
sudo apt-get update
423-
sudo ./hack/install-qemu.sh
424-
- name: "Show cache"
425-
run: ./hack/debug-cache.sh
426-
- name: "Test"
427-
uses: nick-fields/retry@ce71cc2ab81d554ebbe88c79ab5975992d79ba08 # v3.0.2
428-
with:
429-
timeout_minutes: 30
430-
retry_on: error
431-
max_attempts: 3
432-
command: ./hack/test-colima.sh
433-
- name: "Show cache"
434-
run: ./hack/debug-cache.sh
395+
echo "version=$latest" >>$GITHUB_OUTPUT
396+
- name: "Cache colima"
397+
uses: actions/cache@0057852bfaa89a56745cba8c7296529d2fc39830 # v4.3.0
398+
with:
399+
path: ~/.cache/colima
400+
key: colima-${{ steps.install-colima.outputs.version }}
401+
- name: "Run BATS colima tests"
402+
run: ./hack/bats/lib/bats-core/bin/bats --timing ./hack/bats/extras/colima.bats
435403

436404
vmnet:
437405
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)