yihong0618 和朋友们的频道 头像

消息来源频道

yihong0618 和朋友们的频道

@hyi0618

频道8,612 位成员公开可见0 人在线

yihong0618 和朋友们的频道

成员规模8,612 位成员
在线情况0 人在线
消息总数10,129 条消息
浏览量总数3,286,989 次浏览

在这个频道里搜索消息……

t.me/hyi0618

安利我司在 github action 里跑虚拟机的技术,不需自建 runner,只用免费 runner 比如 ubuntu-22.04 就行。典型用途是 CI 测试软件在不同内核版本下的行为,大鹅都说好。
总之照抄我这里的极简版就可以: https://github.com/jschwinger233/skbdump/blob/main/.github/workflows/test.yaml
1. 创建 vm
- name: Provision LVH VMs
uses: cilium/little-vm-helper@908ab1ff8a596a03cd5221a1f8602dc44c3f906d # v0.0.12
with:
test-name: test
image-version: 6.3-main
host-mount: ./
dns-resolver: '1.1.1.1'
install-dependencies: 'true'
cmd: |
uname -a
2. 跑命令
- name: Test
uses: cilium/little-vm-helper@908ab1ff8a596a03cd5221a1f8602dc44c3f906d # v0.0.12
with:
provision: 'false'
cmd: |
set -ex
iptables -t nat -I POSTROUTING 1 -d 1.1.1.1/32 -p tcp --dport 80 -o enp0s2 -j SNAT --to 10.0.0.6:23333
全程使用 cilium/little-vm-helper 这个 action,有手就行。