Skip to content

Commit 2ba46c1

Browse files
authored
Merge pull request #4952 from AkihiroSuda/ci-freebsd
CI: replace Vagrant with Lima for FreeBSD tests
2 parents d7c1dd2 + 0929f62 commit 2ba46c1

7 files changed

Lines changed: 66 additions & 203 deletions

File tree

.dockerignore

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,3 @@ _output
55

66
# golangci-lint
77
/build
8-
9-
# vagrant
10-
/.vagrant
Lines changed: 65 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,65 @@
1+
name: job-test-in-lima-freebsd
2+
3+
on:
4+
workflow_call:
5+
inputs:
6+
timeout:
7+
required: true
8+
type: number
9+
runner:
10+
required: true
11+
type: string
12+
13+
jobs:
14+
test:
15+
name: "FreeBSD"
16+
timeout-minutes: ${{ inputs.timeout }}
17+
runs-on: "${{ inputs.runner }}"
18+
steps:
19+
- name: "Init: checkout"
20+
uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3
21+
with:
22+
fetch-depth: 1
23+
persist-credentials: false
24+
25+
- name: "Init: lima"
26+
uses: lima-vm/lima-actions/setup@55627e31b78637bf254a8b2a14da8ea7d12564e5 # v1.1.0
27+
id: lima-actions-setup
28+
29+
- name: "Init: Cache"
30+
uses: actions/cache@27d5ce7f107fe9357f9df03efb73ab90386fccae # v5.0.5
31+
with:
32+
path: ~/.cache/lima
33+
key: lima-${{ steps.lima-actions-setup.outputs.version }}-freebsd
34+
35+
- name: "Init: Install xorriso (required by Lima for running FreeBSD)"
36+
run: |
37+
set -eux
38+
sudo apt-get update
39+
sudo apt-get install -y xorriso
40+
41+
- name: "Init: start the guest VM"
42+
run: |
43+
set -eux
44+
limactl start --plain --name=default template://freebsd
45+
lima freebsd-version -kru
46+
lima sudo pkg install -y bash go containerd runj
47+
48+
- name: "Init: copy source into the guest VM"
49+
run: |
50+
set -eux
51+
limactl copy -r . default:/tmp/nerdctl
52+
53+
- name: "Init: build nerdctl"
54+
run: lima --workdir /tmp/nerdctl sudo go build -o /usr/local/bin/nerdctl ./cmd/nerdctl
55+
56+
- name: "Run: test-unit"
57+
run: lima --workdir /tmp/nerdctl go test -v ./pkg/...
58+
59+
- name: "Run: test-integration"
60+
timeout-minutes: 3
61+
run: |
62+
set -eux
63+
lima sudo containerd >containerd.log 2>&1 &
64+
sleep 3
65+
lima sudo /usr/local/bin/nerdctl run --rm --net=none dougrabson/freebsd-minimal:13 echo 'Nerdctl is up and running.'

.github/workflows/job-test-in-vagrant.yml

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

.github/workflows/workflow-flaky.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ jobs:
3636

3737
test-integration-freebsd:
3838
name: "FreeBSD"
39-
uses: ./.github/workflows/job-test-in-vagrant.yml
39+
uses: ./.github/workflows/job-test-in-lima-freebsd.yml
4040
with:
4141
timeout: 15
4242
runner: ubuntu-24.04

.gitignore

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,3 @@ _output
55

66
# golangci-lint
77
/build
8-
9-
# vagrant
10-
/.vagrant
11-
Vagrantfile

Vagrantfile.freebsd

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

hack/provisioning/gpg/hashicorp

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

0 commit comments

Comments
 (0)