From 81b21fc2ef4c3daf3cff7a20e7a2d4c972902719 Mon Sep 17 00:00:00 2001 From: "Tianyu (Eric) Zhu" Date: Tue, 21 Nov 2023 09:53:09 -0500 Subject: [PATCH] Use selfhosted runners (#135) * fix(ci): add curl to Vagrantfile * fix(ci): use selfhosted runner * fix(tests/net): use exit in if block --- .github/workflows/vagrant.yaml | 6 +++++- Vagrantfile | 8 ++++---- test/network.sh | 4 ++-- 3 files changed, 11 insertions(+), 7 deletions(-) diff --git a/.github/workflows/vagrant.yaml b/.github/workflows/vagrant.yaml index 806f4ef0..0c1653ad 100644 --- a/.github/workflows/vagrant.yaml +++ b/.github/workflows/vagrant.yaml @@ -19,9 +19,13 @@ jobs: - debianlvm - rocky9 - fedora33 - runs-on: macos-12 + runs-on: self-hosted steps: - uses: actions/checkout@v3 - name: Start vagrant box run: vagrant up ${{ matrix.vagrant_target }} + + - name: Stop vagrant box + run: vagrant destroy -f ${{ matrix.vagrant_target }} + if: ${{ success() || failure() }} # we want to run this step even if the last step failed diff --git a/Vagrantfile b/Vagrantfile index fcf46c04..5972795a 100644 --- a/Vagrantfile +++ b/Vagrantfile @@ -11,7 +11,7 @@ Vagrant.configure("2") do |config| debian.vm.provision "file", source: "./", destination: "/home/vagrant/try" debian.vm.provision "shell", privileged: false, inline: " sudo apt-get update - sudo apt-get install -y git expect + sudo apt-get install -y git expect curl sudo chown -R vagrant:vagrant try cd try scripts/run_tests.sh @@ -39,7 +39,7 @@ Vagrant.configure("2") do |config| debianlvm.vm.provision "file", source: "./", destination: "/home/vagrant/try" debianlvm.vm.provision "shell", privileged: false, inline: " sudo apt-get update - sudo apt-get install -y git expect lvm2 mergerfs + sudo apt-get install -y git expect lvm2 mergerfs curl # Create an image for the lvm disk sudo fallocate -l 2G /root/lvm_disk.img @@ -74,7 +74,7 @@ Vagrant.configure("2") do |config| rocky.vm.box = "generic/rocky9" rocky.vm.provision "file", source: "./", destination: "/home/vagrant/try" rocky.vm.provision "shell", privileged: false, inline: " - sudo yum install -y git expect + sudo yum install -y git expect curl sudo chown -R vagrant:vagrant try cd try TRY_TOP=$(pwd) scripts/run_tests.sh @@ -86,7 +86,7 @@ Vagrant.configure("2") do |config| fedora.vm.box = "generic/fedora33" fedora.vm.provision "file", source: "./", destination: "/home/vagrant/try" fedora.vm.provision "shell", privileged: false, inline: " - sudo yum install -y git expect + sudo yum install -y git expect curl sudo chown -R vagrant:vagrant try cd try TRY_TOP=$(pwd) scripts/run_tests.sh diff --git a/test/network.sh b/test/network.sh index 6eb4ebd5..3d364146 100755 --- a/test/network.sh +++ b/test/network.sh @@ -12,7 +12,7 @@ TRY="$TRY_TOP/try" "$TRY" -x curl 1.1 if [ $? -eq 7 ] then - return 0 + exit 0 else - return 1 + exit 1 fi