Install test swap #94
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Install Script | |
on: | |
push: | |
branches: [main, master] | |
paths: | |
- "channel.yaml" | |
- "install.sh" | |
- "tests/install/**" | |
- ".github/workflows/install.yaml" | |
pull_request: | |
branches: [main, master] | |
paths: | |
- "install.sh" | |
- "tests/install/**" | |
- ".github/workflows/install.yaml" | |
workflow_dispatch: {} | |
permissions: | |
contents: read | |
jobs: | |
build: | |
uses: ./.github/workflows/build-k3s.yaml | |
test: | |
name: "Smoke Test" | |
needs: build | |
runs-on: ubuntu-latest | |
timeout-minutes: 40 | |
strategy: | |
fail-fast: false | |
matrix: | |
# vm: [centos-7, rocky-8, rocky-9, fedora, opensuse-leap, ubuntu-2004, ubuntu-2204] | |
vm: [rocky-8, ubuntu-2204] | |
max-parallel: 3 | |
defaults: | |
run: | |
working-directory: tests/install/${{ matrix.vm }} | |
env: | |
INSTALL_K3S_SKIP_DOWNLOAD: binary | |
steps: | |
- name: "Checkout" | |
uses: actions/checkout@v4 | |
with: {fetch-depth: 1} | |
- uses: actions/checkout@v4 | |
- name: "Vagrant Cache" | |
uses: actions/cache@v4 | |
with: | |
path: | | |
/root/.vagrant.d/boxes | |
/root/.vagrant.d/gems | |
key: install-${{ hashFiles(format('tests/install/{0}/Vagrantfile', matrix.vm)) }} | |
id: vagrant-cache | |
continue-on-error: true | |
# sudo apt-get build-dep -y vagrant ruby-libvirt | |
# sudo apt-get install -y --no-install-recommends libxslt-dev libxml2-dev libvirt-dev ruby-bundler ruby-dev zlib1g-dev | |
- name: Set up vagrant and libvirt | |
run: | | |
curl -fsSL https://apt.releases.hashicorp.com/gpg | sudo gpg --dearmor -o /usr/share/keyrings/hashicorp-archive-keyring.gpg | |
echo "deb [signed-by=/usr/share/keyrings/hashicorp-archive-keyring.gpg] https://apt.releases.hashicorp.com $(lsb_release -cs) main" | sudo tee /etc/apt/sources.list.d/hashicorp.list | |
sudo sed -i 's/^# deb-src/deb-src/' /etc/apt/sources.list | |
sudo apt-get update | |
sudo apt-get install -y libvirt-daemon libvirt-daemon-system vagrant | |
sudo systemctl enable --now libvirtd | |
sleep 10 | |
sudo vagrant plugin install vagrant-libvirt | |
- name: "Vagrant Plugin(s)" | |
run: sudo vagrant plugin install vagrant-k3s vagrant-reload vagrant-scp | |
- name: "Download k3s binary" | |
uses: actions/download-artifact@v3 | |
with: | |
name: k3s | |
path: tests/install/${{ matrix.vm }} | |
- name: "Vagrant Up" | |
run: sudo vagrant up --no-provision | |
- name: "Upload k3s binary to VM" | |
run: | | |
chmod +x k3s | |
sudo vagrant scp k3s /tmp/k3s | |
sudo vagrant ssh -c "sudo mv /tmp/k3s /usr/local/bin/k3s" | |
sudo vagrant provision --provision-with=k3s-upload | |
- name: Add binary to PATH | |
if: matrix.vm == 'centos-7' || matrix.vm == 'rocky-8' || matrix.vm == 'rocky-9' | |
run: sudo vagrant provision --provision-with=add-bin-path | |
- name: "⏩ Install K3s" | |
run: | | |
sudo vagrant provision --provision-with=k3s-prepare | |
sudo vagrant provision --provision-with=k3s-install | |
if [ ${{ matrix.vm }} = 'opensuse-microos' ]; then vagrant reload --no-provision; fi | |
- name: "⏳ Node" | |
run: sudo vagrant provision --provision-with=k3s-wait-for-node | |
- name: "⏳ CoreDNS" | |
run: sudo vagrant provision --provision-with=k3s-wait-for-coredns | |
- name: "⏳ Local Storage" | |
run: sudo vagrant provision --provision-with=k3s-wait-for-local-storage | |
continue-on-error: true | |
- name: "⏳ Metrics Server" | |
run: sudo vagrant provision --provision-with=k3s-wait-for-metrics-server | |
continue-on-error: true | |
- name: "⏳ Traefik" | |
run: sudo vagrant provision --provision-with=k3s-wait-for-traefik | |
continue-on-error: true | |
- name: "k3s-status" | |
run: sudo vagrant provision --provision-with=k3s-status | |
- name: "k3s-procps" | |
run: sudo vagrant provision --provision-with=k3s-procps | |
- name: Cleanup VM | |
run: sudo vagrant destroy -f | |
- name: On Failure, launch debug session | |
uses: lhotari/action-upterm@v1 | |
if: ${{ failure() }} | |
with: | |
## If no one connects after 5 minutes, shut down server. | |
wait-timeout-minutes: 5 |