Installation test OneClickInstall-Workspace #203
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: > | |
Installation test OneClickInstall-Workspace | |
on: | |
pull_request: | |
types: [opened, reopened, synchronize] | |
paths-ignore: | |
- '.github/**' | |
- 'tests/**' | |
- '**/README.md' | |
schedule: | |
- cron: '00 21 * * 6' # At 21:00 on Saturday. | |
workflow_dispatch: | |
inputs: | |
centos7: | |
type: boolean | |
description: 'CentOS 7' | |
default: true | |
centos8s: | |
type: boolean | |
description: 'CentOS 8 Stream' | |
default: true | |
centos9s: | |
type: boolean | |
description: 'CentOS 9 Stream' | |
default: true | |
debian10: | |
type: boolean | |
description: 'Debian 10' | |
default: true | |
debian11: | |
type: boolean | |
description: 'Debian 11' | |
default: true | |
debian12: | |
type: boolean | |
description: 'Debian 12' | |
default: true | |
ubuntu1804: | |
type: boolean | |
description: 'Ubuntu 18.04' | |
default: true | |
ubuntu2004: | |
type: boolean | |
description: 'Ubuntu 20.04' | |
default: true | |
ubuntu2204: | |
type: boolean | |
description: 'Ubuntu 22.04' | |
default: true | |
ubuntu2404: | |
type: boolean | |
description: 'Ubuntu 24.04' | |
default: true | |
concurrency: | |
group: ${{ github.workflow }}-${{ github.ref_name }} | |
cancel-in-progress: true | |
jobs: | |
prepare: | |
runs-on: ubuntu-latest | |
outputs: | |
matrix: ${{ steps.set-matrix.outputs.matrix }} | |
steps: | |
- name: Set matrix names | |
id: set-matrix | |
run: | | |
matrix=$(echo '{ | |
"include": [ | |
{ | |
"execute": '${{ github.event.inputs.centos7 || true }}', | |
"name": "CentOS7", | |
"os": "centos7", | |
"distr": "generic", | |
"box-ver": "4.3.10" | |
}, | |
{ | |
"execute": '${{ github.event.inputs.centos8s || true }}', | |
"name": "CentOS8S", | |
"os": "centos8s", | |
"distr": "generic", | |
"box-ver": "4.3.10" | |
}, | |
{ | |
"execute": '${{ github.event.inputs.centos9s || true }}', | |
"name": "CentOS9S", | |
"os": "centos9s", | |
"distr": "generic", | |
"box-ver": "4.3.10" | |
}, | |
{ | |
"execute": '${{ github.event.inputs.debian10 || true }}', | |
"name": "Debian10", | |
"os":"debian10", | |
"distr": "generic", | |
"box-ver": "4.3.10" | |
}, | |
{ | |
"execute": '${{ github.event.inputs.debian11 || true }}', | |
"name": "Debian11", | |
"os": "debian11", | |
"distr": "generic", | |
"box-ver": "4.3.10" | |
}, | |
{ | |
"execute": '${{ github.event.inputs.debian12 || true }}', | |
"name": "Debian12", | |
"os": "debian12", | |
"distr": "generic", | |
"box-ver": "4.3.10" | |
}, | |
{ | |
"execute": '${{ github.event.inputs.ubuntu1804 || true }}', | |
"name": "Ubuntu18.04", | |
"os": "ubuntu1804", | |
"distr": "generic", | |
"box-ver": "4.3.10" | |
}, | |
{ | |
"execute": '${{ github.event.inputs.ubuntu2004 || true }}', | |
"name": "Ubuntu20.04", | |
"os": "ubuntu2004", | |
"distr": "generic", | |
"box-ver": "4.3.10" | |
}, | |
{ | |
"execute": '${{ github.event.inputs.ubuntu2204 || true }}', | |
"name": "Ubuntu22.04", | |
"os": "ubuntu2204", | |
"distr": "generic", | |
"box-ver": "4.3.10" | |
}, | |
{ | |
"execute": '${{ github.event.inputs.ubuntu2404 || true }}', | |
"name": "Ubuntu24.04", | |
"os": "ubuntu-24.04", | |
"distr": "bento", | |
"box-ver": "202404.26.0" | |
} | |
] | |
}' | jq -c '{include: [.include[] | select(.execute == true)]}') | |
echo "matrix=${matrix}" >> $GITHUB_OUTPUT | |
vagrant-up: | |
name: "Test Workspace with ${{ matrix.name}}" | |
runs-on: ubuntu-24.04 | |
needs: prepare | |
strategy: | |
fail-fast: false | |
matrix: ${{fromJSON(needs.prepare.outputs.matrix)}} | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v3 | |
- name: Set up Python 3. | |
uses: actions/setup-python@v5 | |
with: | |
python-version: '3.x' | |
- name: Get update and install vagrant | |
run: | | |
set -eux | |
sudo wget -O- https://apt.releases.hashicorp.com/gpg | sudo gpg --dearmor -o /usr/share/keyrings/hashicorp-archive-keyring.gpg | |
sudo 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 apt update -y | |
sudo apt install vagrant virtualbox -y | |
- name: Install from production scripts | |
if: ${{ github.event_name == 'schedule' }} | |
uses: nick-fields/retry@v2 | |
with: | |
max_attempts: 2 | |
timeout_minutes: 180 | |
retry_on: error | |
command: | | |
cd tests/vagrant | |
TEST_CASE='--production-install' \ | |
DISTR='${{ matrix.distr }}' \ | |
RAM='6100' \ | |
CPU='2' \ | |
BOX_VER='${{ matrix.box-ver }}' \ | |
OS='${{ matrix.os }}' \ | |
DOWNLOAD_SCRIPT='-ds true' \ | |
ARGUMENTS="-arg '--skiphardwarecheck true --makeswap false'" \ | |
vagrant up | |
on_retry_command: | | |
echo "RUN CLEAN UP: Destroy vagrant and one more try" | |
cd tests/vagrant | |
sleep 10 | |
vagrant destroy --force | |
- name: Install from local scripts | |
if: ${{ github.event_name == 'pull_request' || github.event_name == 'workflow_dispatch' }} | |
uses: nick-fields/retry@v2 | |
with: | |
max_attempts: 2 | |
timeout_minutes: 180 | |
retry_on: error | |
command: | | |
cd tests/vagrant | |
TEST_CASE='--local-install' \ | |
DISTR='${{ matrix.distr }}' \ | |
RAM='6100' \ | |
CPU='2' \ | |
BOX_VER='${{ matrix.box-ver }}' \ | |
OS='${{ matrix.os }}' \ | |
DOWNLOAD_SCRIPT='-ds false' \ | |
TEST_REPO='-tr true' \ | |
ARGUMENTS="-arg '--skiphardwarecheck true --makeswap false --localscripts true'" \ | |
vagrant up | |
on_retry_command: | | |
echo "RUN CLEAN UP: Destroy vagrant and one more try" | |
cd tests/vagrant | |
sleep 10 | |
vagrant destroy --force |