diff --git a/.github/workflows/install.yaml b/.github/workflows/install.yaml index 16c1ef12ac..480870fd41 100644 --- a/.github/workflows/install.yaml +++ b/.github/workflows/install.yaml @@ -13,28 +13,37 @@ on: - "tests/install/**" workflow_dispatch: {} 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: name: "Smoke Test" + needs: build runs-on: macos-12 timeout-minutes: 40 strategy: fail-fast: false matrix: - channel: [stable] 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 defaults: run: working-directory: tests/install/${{ matrix.vm }} env: - INSTALL_K3S_CHANNEL: ${{ matrix.channel }} + INSTALL_K3S_SKIP_DOWNLOAD: true steps: - name: "Checkout" uses: actions/checkout@v2 @@ -49,9 +58,25 @@ jobs: id: vagrant-cache continue-on-error: true - name: "Vagrant Plugin(s)" - run: vagrant plugin install vagrant-k3s vagrant-reload - - name: "Vagrant Up ⏩ Install K3s" - run: vagrant up + run: vagrant plugin install vagrant-k3s vagrant-reload vagrant-scp + - name: "Download k3s binary" + 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" run: vagrant provision --provision-with=k3s-wait-for-node - name: "⏳ CoreDNS" diff --git a/install.sh b/install.sh index 783b4329ec..4f5975e78c 100755 --- a/install.sh +++ b/install.sh @@ -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 " - 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" elif [ "${ID_LIKE:-}" != coreos ] && [ "${VARIANT_ID:-}" != coreos ]; then install_selinux_rpm ${rpm_site} ${rpm_channel} ${rpm_target} ${rpm_site_infix} diff --git a/tests/install/opensuse-leap/Vagrantfile b/tests/install/opensuse-leap/Vagrantfile index 2a50a6d933..e948e163ce 100644 --- a/tests/install/opensuse-leap/Vagrantfile +++ b/tests/install/opensuse-leap/Vagrantfile @@ -44,7 +44,7 @@ Vagrant.configure("2") do |config| sh.inline = <<~SHELL #!/usr/bin/env bash 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 end test.vm.provision "k3s-wait-for-local-storage", type: "shell", run: ENV['CI'] == 'true' ? 'never' : 'once' do |sh|