mirror of https://github.com/k3s-io/k3s
Convert install tests to run PR build of k3s (#6003)
* Convert install tests to run PR version of k3s Signed-off-by: Derek Nola <derek.nola@suse.com>pull/6018/head
parent
f81138402e
commit
2b35f89664
|
@ -13,28 +13,37 @@ on:
|
||||||
- "tests/install/**"
|
- "tests/install/**"
|
||||||
workflow_dispatch: {}
|
workflow_dispatch: {}
|
||||||
jobs:
|
jobs:
|
||||||
|
build:
|
||||||
|
name: Build
|
||||||
|
runs-on: ubuntu-20.04
|
||||||
|
timeout-minutes: 20
|
||||||
|
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:
|
test:
|
||||||
name: "Smoke Test"
|
name: "Smoke Test"
|
||||||
|
needs: build
|
||||||
runs-on: macos-12
|
runs-on: macos-12
|
||||||
timeout-minutes: 40
|
timeout-minutes: 40
|
||||||
strategy:
|
strategy:
|
||||||
fail-fast: false
|
fail-fast: false
|
||||||
matrix:
|
matrix:
|
||||||
channel: [stable]
|
|
||||||
vm: [centos-7, rocky-8, fedora-coreos, opensuse-leap, opensuse-microos, ubuntu-focal]
|
vm: [centos-7, rocky-8, fedora-coreos, opensuse-leap, opensuse-microos, ubuntu-focal]
|
||||||
include:
|
|
||||||
- {channel: latest, vm: rocky-8}
|
|
||||||
- {channel: latest, vm: ubuntu-focal}
|
|
||||||
- {channel: latest, vm: opensuse-leap}
|
|
||||||
- {channel: testing, vm: rocky-8}
|
|
||||||
- {channel: testing, vm: opensuse-leap}
|
|
||||||
- {channel: testing, vm: ubuntu-focal}
|
|
||||||
max-parallel: 2
|
max-parallel: 2
|
||||||
defaults:
|
defaults:
|
||||||
run:
|
run:
|
||||||
working-directory: tests/install/${{ matrix.vm }}
|
working-directory: tests/install/${{ matrix.vm }}
|
||||||
env:
|
env:
|
||||||
INSTALL_K3S_CHANNEL: ${{ matrix.channel }}
|
INSTALL_K3S_SKIP_DOWNLOAD: true
|
||||||
steps:
|
steps:
|
||||||
- name: "Checkout"
|
- name: "Checkout"
|
||||||
uses: actions/checkout@v2
|
uses: actions/checkout@v2
|
||||||
|
@ -49,9 +58,25 @@ jobs:
|
||||||
id: vagrant-cache
|
id: vagrant-cache
|
||||||
continue-on-error: true
|
continue-on-error: true
|
||||||
- name: "Vagrant Plugin(s)"
|
- name: "Vagrant Plugin(s)"
|
||||||
run: vagrant plugin install vagrant-k3s vagrant-reload
|
run: vagrant plugin install vagrant-k3s vagrant-reload vagrant-scp
|
||||||
- name: "Vagrant Up ⏩ Install K3s"
|
- name: "Download k3s binary"
|
||||||
run: vagrant up
|
uses: actions/download-artifact@v2
|
||||||
|
with:
|
||||||
|
name: k3s
|
||||||
|
path: tests/install/${{ matrix.vm }}
|
||||||
|
- name: "Vagrant Up"
|
||||||
|
run: vagrant up --no-provision
|
||||||
|
- name: "Upload k3s binary"
|
||||||
|
run: |
|
||||||
|
chmod +x k3s
|
||||||
|
vagrant scp k3s /tmp/k3s
|
||||||
|
vagrant ssh -c "sudo mv /tmp/k3s /usr/local/bin/k3s"
|
||||||
|
vagrant provision --provision-with=k3s-upload
|
||||||
|
- name: "⏩ Install K3s"
|
||||||
|
run: |
|
||||||
|
vagrant provision --provision-with=k3s-prepare
|
||||||
|
vagrant provision --provision-with=k3s-install
|
||||||
|
if [ ${{ matrix.vm }} = 'opensuse-microos' ]; then vagrant reload --no-provision; fi
|
||||||
- name: "⏳ Node"
|
- name: "⏳ Node"
|
||||||
run: vagrant provision --provision-with=k3s-wait-for-node
|
run: vagrant provision --provision-with=k3s-wait-for-node
|
||||||
- name: "⏳ CoreDNS"
|
- name: "⏳ CoreDNS"
|
||||||
|
|
|
@ -483,7 +483,7 @@ setup_selinux() {
|
||||||
${package_installer} install -y https://${rpm_site}/k3s/${rpm_channel}/common/${rpm_site_infix}/noarch/k3s-selinux-0.4-1.${rpm_target}.noarch.rpm
|
${package_installer} install -y https://${rpm_site}/k3s/${rpm_channel}/common/${rpm_site_infix}/noarch/k3s-selinux-0.4-1.${rpm_target}.noarch.rpm
|
||||||
"
|
"
|
||||||
|
|
||||||
if [ "$INSTALL_K3S_SKIP_SELINUX_RPM" = true ] || can_skip_download || [ ! -d /usr/share/selinux ]; then
|
if [ "$INSTALL_K3S_SKIP_SELINUX_RPM" = true ] || [ ! -d /usr/share/selinux ]; then
|
||||||
info "Skipping installation of SELinux RPM"
|
info "Skipping installation of SELinux RPM"
|
||||||
elif [ "${ID_LIKE:-}" != coreos ] && [ "${VARIANT_ID:-}" != coreos ]; then
|
elif [ "${ID_LIKE:-}" != coreos ] && [ "${VARIANT_ID:-}" != coreos ]; then
|
||||||
install_selinux_rpm ${rpm_site} ${rpm_channel} ${rpm_target} ${rpm_site_infix}
|
install_selinux_rpm ${rpm_site} ${rpm_channel} ${rpm_target} ${rpm_site_infix}
|
||||||
|
|
|
@ -44,7 +44,7 @@ Vagrant.configure("2") do |config|
|
||||||
sh.inline = <<~SHELL
|
sh.inline = <<~SHELL
|
||||||
#!/usr/bin/env bash
|
#!/usr/bin/env bash
|
||||||
set -eu -o pipefail
|
set -eu -o pipefail
|
||||||
time timeout 300 bash -c 'while ! (kubectl --namespace kube-system rollout status --timeout 10s deploy/coredns 2>/dev/null); do sleep 5; done'
|
timeout 300 bash -c 'while ! (kubectl --namespace kube-system rollout status --timeout 10s deploy/coredns); do sleep 5; done'
|
||||||
SHELL
|
SHELL
|
||||||
end
|
end
|
||||||
test.vm.provision "k3s-wait-for-local-storage", type: "shell", run: ENV['CI'] == 'true' ? 'never' : 'once' do |sh|
|
test.vm.provision "k3s-wait-for-local-storage", type: "shell", run: ENV['CI'] == 'true' ? 'never' : 'once' do |sh|
|
||||||
|
|
Loading…
Reference in New Issue