Test Ubuntu Deployments #309
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: Deployment Tests | |
run-name: Test Ubuntu Deployments | |
on: | |
push: | |
paths-ignore: | |
- 'gen-docs/**' | |
pull_request: | |
schedule: | |
- cron: '23 9 * * 0' | |
permissions: | |
contents: read | |
jobs: | |
Ubuntu_22: | |
runs-on: ubuntu-22.04 | |
steps: | |
- name: Check out repo code | |
uses: actions/checkout@v4 | |
- name: Install ansible | |
run: | | |
sudo apt update | |
sudo sudo apt install software-properties-common | |
sudo add-apt-repository --yes --update ppa:ansible/ansible | |
sudo apt install ansible | |
- name: Ensure base playbook requirements | |
# does not use the `make` command since it requires input and we cannot input in a Runner | |
run: | | |
mkdir -p ./inventory/group_vars/all | |
cp ./roles/hmsdocker/defaults/main/*.yml ./inventory/group_vars/all | |
chmod 0600 ./inventory/group_vars/all/*.yml | |
make install-reqs | |
- name: Run playbook in check mode | |
run: >- | |
sudo ansible-playbook | |
-i inventory/hosts.yml | |
hms-docker.yml | |
--diff | |
--check | |
--extra-vars "@.github/extra-vars.yml" | |
- name: Run playbook | |
run: >- | |
sudo ansible-playbook | |
-i inventory/hosts.yml | |
hms-docker.yml | |
--diff | |
--extra-vars "@.github/extra-vars.yml" | |
- name: Check containers | |
run: | | |
sleep 60 | |
sudo pip3 install -r .github/workflows/scripts/requirements.txt | |
sudo make verify-containers | |
- name: Run playbook again to ensure API keys are retrieved | |
run: >- | |
sudo ansible-playbook | |
-i inventory/hosts.yml | |
hms-docker.yml | |
--diff | |
--extra-vars "@.github/extra-vars.yml" | |
Ubuntu_24: | |
runs-on: ubuntu-24.04 | |
steps: | |
- name: Check out repo code | |
uses: actions/checkout@v4 | |
- name: Install ansible | |
run: | | |
sudo apt update | |
sudo sudo apt install software-properties-common | |
sudo add-apt-repository --yes --update ppa:ansible/ansible | |
sudo apt install ansible | |
- name: Ensure base playbook requirements | |
# does not use the `make` command since it requires input and we cannot input in a Runner | |
run: | | |
mkdir -p ./inventory/group_vars/all | |
cp ./roles/hmsdocker/defaults/main/*.yml ./inventory/group_vars/all | |
chmod 0600 ./inventory/group_vars/all/*.yml | |
make install-reqs | |
- name: Run playbook in check mode | |
run: >- | |
sudo ansible-playbook | |
-i inventory/hosts.yml | |
hms-docker.yml | |
--diff | |
--check | |
--extra-vars "@.github/extra-vars.yml" | |
- name: Run playbook | |
run: >- | |
sudo ansible-playbook | |
-i inventory/hosts.yml | |
hms-docker.yml | |
--diff | |
--extra-vars "@.github/extra-vars.yml" | |
- name: Check containers | |
run: | | |
sleep 60 | |
pip3 install -r .github/workflows/scripts/requirements.txt | |
sudo make verify-containers | |
- name: Run playbook again to ensure API keys are retrieved | |
run: >- | |
sudo ansible-playbook | |
-i inventory/hosts.yml | |
hms-docker.yml | |
--diff | |
--extra-vars "@.github/extra-vars.yml" |