forked from kubernetes/minikube
-
Notifications
You must be signed in to change notification settings - Fork 1
146 lines (145 loc) · 4.96 KB
/
smoke-test.yml
File metadata and controls
146 lines (145 loc) · 4.96 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
# Boot Smoke Test only tests Bare VM (start,stop,delete) and not any minikube/kubernetes functionality.
name: Smoke Test
on:
push:
branches: [ master ]
paths:
- "go.mod"
- "**.go"
- "Makefile"
- "!hack/**"
- "!site/**"
- "!**.md"
- "!**.json"
pull_request:
paths:
- "go.mod"
- "**.go"
- "Makefile"
- ".github/workflows/smoke-test.yml"
- "!hack/**"
- "!site/**"
- "!**.md"
- "!**.json"
workflow_dispatch:
env:
GOPROXY: https://proxy.golang.org
LOG_ARGS: --v=8 --alsologtostderr
permissions:
contents: read
# Limit one unit test job running per PR/Branch
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
# For example, if you push multiple commits to a pull request in quick succession, only the latest workflow run will continue
cancel-in-progress: true
jobs:
minikube-vm-boot:
name: ${{ matrix.name }}
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
include:
- name: qemu-docker-macos-15-x86
driver: qemu
os: macos-15-intel
start_flags: --network socket_vmnet --force
sudo: "sudo"
- name: vfkit-docker-macos-15-x86
driver: vfkit
os: macos-15-intel
start_flags: --network vmnet-shared --force
sudo: "sudo"
- name: docker-docker-ubuntu-24.04-x86
driver: docker
os: ubuntu-24.04
start_flags: ""
sudo: ""
- name: docker-docker-ubuntu-24.04-arm
driver: docker
os: ubuntu-24.04-arm
start_flags: ""
sudo: ""
steps:
- id: info-block
uses: medyagh/info-block@main
- name: Disable spotlight indexing (macos)
if: contains(matrix.os, 'macos')
run: |
# Disable indexing globally
sudo mdutil -a -i off
# Erase Existing Indexes
sudo mdutil -E /
- uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8
- uses: actions/setup-go@7a3fe6cf4cb3a834922a1244abfce67bcef6a0c5
with:
go-version-file: go.mod
cache: true
- name: Download Golang Dependencies
run: go mod download
- name: Build Binaries
run: make
- name: Update brew (macos)
if: contains(matrix.os, 'macos')
run: brew update
- name: Install tools (macos)
if: contains(matrix.os, 'macos')
run: brew install tree
- name: Install vfkit and vmnet-helper (macos)
if: matrix.driver == 'vfkit'
run: |
brew install vfkit
curl -fsSL https://github.com/minikube-machine/vmnet-helper/releases/latest/download/install.sh | sudo VMNET_INTERACTIVE=0 bash
- name: Install qemu and socket_vmnet (macos)
if: contains(matrix.os, 'macos') && matrix.driver == 'qemu'
run: |
brew install qemu socket_vmnet
HOMEBREW=$(which brew) && sudo ${HOMEBREW} services start socket_vmnet
- name: Inspect host before test (macos)
if: contains(matrix.os, 'macos')
run: |
echo "=== Top ==="
top -l 2 -s 10 -n 20 -stats pid,command,cpu,time,mem
echo "=== Interfaces ==="
ifconfig -u
echo "=== Routing table ==="
netstat -rn -f inet
echo "=== Packet Filter ==="
sudo pfctl -s all || true
- name: Start minikube (1st boot)
run: |
${{ matrix.sudo }} ./out/minikube start \
${{ env.LOG_ARGS }} \
--no-kubernetes \
--cpus 2 \
--memory 3gb \
--driver ${{ matrix.driver }} \
${{ matrix.start_flags }}
- name: Inspect host after test (macos)
if: always() && contains(matrix.os, 'macos')
run: |
echo "=== Top ==="
top -l 2 -s 10 -n 20 -stats pid,command,cpu,time,mem
echo "=== Interfaces ==="
ifconfig -u
echo "=== Routing table ==="
netstat -rn -f inet
echo "=== Packet Filter ==="
sudo pfctl -s all || true
- name: Inspect minikube
if: always()
run: |
${{ matrix.sudo }} tree -h ~/.minikube
machine="$HOME/.minikube/machines/minikube"
machine_logs=$(${{ matrix.sudo }} find "$machine" -name "*.log")
minikube_logs="$HOME/.minikube/logs/lastStart.txt"
for f in $machine_logs $minikube_logs /var/db/dhcpd_leases; do
echo "==> $f <=="
${{ matrix.sudo }} head -n 1000 "$f" || true
done
- name: Stop minikube
run: ${{ matrix.sudo }} ./out/minikube stop ${{ env.LOG_ARGS }}
- name: Start minikube again (2nd boot)
run: ${{ matrix.sudo }} ./out/minikube start ${{ env.LOG_ARGS }} ${{ matrix.start_flags }}
- name: Delete minikube
run: ${{ matrix.sudo }} ./out/minikube delete ${{ env.LOG_ARGS }}