k3s/.github/workflows/snapshotter.yaml
Derek Nola 86e36225f5
Consolidate E2E tests and GH Actions (#6772)
* Consolidate cluster reset and snapshot E2E tests
* Add more context to secrets-encryption test
* Reuse build workflow
* Convert updatecli to job level permissions
* Remove dweomer microos from E2E and install testing

Signed-off-by: Derek Nola <derek.nola@suse.com>
2023-01-27 09:01:13 -08:00

74 lines
2.1 KiB
YAML

name: Snapshotter
on:
push:
paths-ignore:
- "**.md"
- "channel.yaml"
- "install.sh"
- "tests/**"
- "!tests/snapshotter/**"
- ".github/**"
- "!.github/workflows/snapshotter.yaml"
pull_request:
paths-ignore:
- "**.md"
- "channel.yaml"
- "install.sh"
- "tests/**"
- "!tests/snapshotter/**"
- ".github/**"
- "!.github/workflows/snapshotter.yaml"
workflow_dispatch: {}
permissions:
contents: read
jobs:
build:
uses: ./.github/workflows/build-k3s.yaml
test:
name: "Smoke Test"
needs: build
# nested virtualization is only available on macOS hosts
runs-on: macos-12
timeout-minutes: 40
strategy:
fail-fast: false
matrix:
vm: [opensuse-leap]
snapshotter: [btrfs]
max-parallel: 1
defaults:
run:
working-directory: tests/snapshotter/${{ matrix.snapshotter }}/${{ matrix.vm }}
env:
VAGRANT_EXPERIMENTAL: disks
steps:
- name: "Checkout"
uses: actions/checkout@v3
with: { fetch-depth: 1 }
- name: "Download Binary"
uses: actions/download-artifact@v3
with: { name: k3s, path: dist/artifacts/ }
- name: "Vagrant Cache"
uses: actions/cache@v3
with:
path: |
~/.vagrant.d/boxes
~/.vagrant.d/gems
key: snapshotter-${{ hashFiles(format('tests/snapshotter/{0}/{1}/Vagrantfile', matrix.snapshotter, matrix.vm)) }}
id: vagrant-cache
continue-on-error: true
- name: "Vagrant Plugin(s)"
run: vagrant plugin install vagrant-k3s
- name: "Vagrant Up ⏩ Install K3s"
run: vagrant up
- name: "⏳ Node"
run: vagrant provision --provision-with=k3s-wait-for-node
- name: "⏳ CoreDNS"
run: vagrant provision --provision-with=k3s-wait-for-coredns
- name: "k3s-status" # kubectl get node,all -A -o wide
run: vagrant provision --provision-with=k3s-status
- name: "k3s-snapshots" # if no snapshots then we fail
run: vagrant provision --provision-with=k3s-snapshots