k3s/.github/workflows/cgroup2.yaml
Chris Wayne 71e1f1df8c
Ignore markdown files for github actions (#3676)
Signed-off-by: Chris Wayne <cwayne18@gmail.com>
2021-07-23 10:29:00 -04:00

76 lines
2.4 KiB
YAML

name: cgroup2
on:
push:
paths-ignore:
- "**.md"
pull_request:
paths-ignore:
- "**.md"
jobs:
build:
name: "Build"
runs-on: ubuntu-20.04
timeout-minutes: 40
steps:
- name: "Checkout"
uses: actions/checkout@v2
with:
fetch-depth: 1
- name: "Make"
run: DOCKER_BUILDKIT=1 SKIP_VALIDATE=1 make
- name: "Upload k3s binary"
uses: actions/upload-artifact@v2
with:
name: k3s
path: dist/artifacts/k3s
test:
name: "Test"
needs: build
# nested virtualization is only available on macOS hosts
runs-on: macos-10.15
timeout-minutes: 40
steps:
- name: "Checkout"
uses: actions/checkout@v2
with:
fetch-depth: 1
- name: "Download k3s binary"
uses: actions/download-artifact@v2
with:
name: k3s
path: ./tests/cgroup2
- name: "Boot Fedora VM"
run: |
cp -r k3s.service k3s-rootless.service ./tests/testutil ./tests/cgroup2
cd ./tests/cgroup2
vagrant up
vagrant ssh-config >> ~/.ssh/config
- name: "Starting k3s"
run: |
ssh default -- sudo systemctl start k3s
# Sonobuoy requires CoreDNS to be ready
- name: "Waiting for CoreDNS to be ready"
run: |
ssh default -- sudo KUBECONFIG=/etc/rancher/k3s/k3s.yaml /vagrant/testutil/wait-for-coredns.sh
# Vagrant is slow, so we set --mode=quick here
- name: "Run Sonobuoy (--mode=quick)"
run: |
ssh default -- sudo KUBECONFIG=/etc/rancher/k3s/k3s.yaml sonobuoy run --mode=quick --wait
- name: "Stopping k3s"
run: |
ssh default -- sudo systemctl stop k3s
# FIXME: rootful k3s processes are still running even after `systemctl stop k3s`, so we reboot the VM here.
# This reboot is also useful for ensuring `systemctl daemon-reload`: https://github.com/rootless-containers/rootlesscontaine.rs/issues/32
cd ./tests/cgroup2
vagrant halt
vagrant up
- name: "[Rootless] Starting k3s-rootless"
run: |
ssh default -- systemctl --user start k3s-rootless
- name: "[Rootless] Waiting for CoreDNS to be ready"
run: |
ssh default -- KUBECONFIG=/home/vagrant/.kube/k3s.yaml /vagrant/testutil/wait-for-coredns.sh
- name: "[Rootless] Run Sonobuoy (--mode=quick)"
run: |
ssh default -- KUBECONFIG=/home/vagrant/.kube/k3s.yaml sonobuoy run --mode=quick --wait