Skip to content

Commit

Permalink
Add workflow job for testing upgrades
Browse files Browse the repository at this point in the history
  • Loading branch information
replaceafill committed Jun 28, 2024
1 parent 85e1abc commit 4f50a8c
Showing 1 changed file with 102 additions and 2 deletions.
104 changes: 102 additions & 2 deletions .github/workflows/archivematica-playbook.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@ on:
schedule:
- cron: "0 2 * * *"
jobs:
test:
name: Test Archivematica playbook
test-install:
name: Test installation
runs-on: ubuntu-22.04
steps:
- name: Check out code
Expand Down Expand Up @@ -76,3 +76,103 @@ jobs:
'http://192.168.168.198:8000/api/v2/pipeline/' \
| jq -r '.meta.total_count == 1' \
) == true
test-upgrade:
name: Test upgrade
runs-on: ubuntu-22.04
env:
TARGET_AM_VERSION: "qa/1.x"
TARGET_SS_VERSION: "qa/0.x"
steps:
- name: Check out code
uses: actions/checkout@v4
- name: "Create Vagrant boxes directory"
run: |
mkdir -p /home/runner/.vagrant.d/boxes
- name: "Cache Vagrant boxes"
uses: "actions/cache@v4"
with:
path: "/home/runner/.vagrant.d/boxes"
key: "${{ runner.os }}-boxes"
- name: Install Vagrant
run: |
wget -O- 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 apt update && sudo apt install vagrant
- name: Install VirtualBox
run: |
wget -O- https://www.virtualbox.org/download/oracle_vbox_2016.asc | sudo gpg --yes --output /usr/share/keyrings/oracle-virtualbox-2016.gpg --dearmor
echo "deb [arch=amd64 signed-by=/usr/share/keyrings/oracle-virtualbox-2016.gpg] https://download.virtualbox.org/virtualbox/debian jammy contrib" | sudo tee /etc/apt/sources.list.d/virtualbox.list
sudo apt update && sudo apt install virtualbox-7.0
- name: "Downgrade VirtualBox"
run: |
sudo apt-get purge virtualbox-7.0
wget -O /tmp/virtualbox-7.0_7.0.14-161095~Ubuntu~jammy_amd64.deb -L https://download.virtualbox.org/virtualbox/7.0.14/virtualbox-7.0_7.0.14-161095~Ubuntu~jammy_amd64.deb
sudo dpkg -i /tmp/virtualbox-7.0_7.0.14-161095~Ubuntu~jammy_amd64.deb
- name: Install the vagrant-vbguest plugin
run: |
vagrant plugin install vagrant-vbguest
- name: Update vbox networks
run: |
sudo mkdir -p /etc/vbox/
echo "* 192.168.168.198/24" | sudo tee -a /etc/vbox/networks.conf
- name: Download the Ansible roles
working-directory: ${{ github.workspace }}/playbooks/archivematica-jammy
run: |
ansible-galaxy install -f -p roles/ -r requirements.yml
- name: Create the virtual machine and provision it
working-directory: ${{ github.workspace }}/playbooks/archivematica-jammy
run: |
vagrant up
- name: Test AM API - Get processing configurations
run: |
test $( \
curl \
--silent \
--header 'Authorization: ApiKey admin:this_is_the_am_api_key' \
--header 'Content-Type: application/json' \
'http://192.168.168.198/api/processing-configuration/' \
| jq -r '.processing_configurations == ["automated", "default"]' \
) == true
- name: Test SS API - Get pipeline count
run: |
test $( \
curl \
--silent \
--header 'Authorization: ApiKey admin:this_is_the_ss_api_key' \
--header 'Content-Type: application/json' \
'http://192.168.168.198:8000/api/v2/pipeline/' \
| jq -r '.meta.total_count == 1' \
) == true
- name: Set target versions in playbook variables
working-directory: ${{ github.workspace }}/playbooks/archivematica-jammy
run: |
sed -i -e 's|archivematica_src_am_version: "stable/1.16.x"|archivematica_src_am_version: "${{ env.TARGET_AM_VERSION }}"|g' vars-singlenode-1.16.yml
sed -i -e 's|archivematica_src_ss_version: "stable/0.22.x"|archivematica_src_ss_version: "${{ env.TARGET_SS_VERSION }}"|g' vars-singlenode-1.16.yml
- name: Create the virtual machine and provision it
working-directory: ${{ github.workspace }}/playbooks/archivematica-jammy
run: |
vagrant up --provision
- name: Test AM API - Get processing configurations
run: |
test $( \
curl \
--silent \
--header 'Authorization: ApiKey admin:this_is_the_am_api_key' \
--header 'Content-Type: application/json' \
'http://192.168.168.198/api/processing-configuration/' \
| jq -r '.processing_configurations == ["automated", "default"]' \
) == true
- name: Test SS API - Get pipeline count
run: |
test $( \
curl \
--silent \
--header 'Authorization: ApiKey admin:this_is_the_ss_api_key' \
--header 'Content-Type: application/json' \
'http://192.168.168.198:8000/api/v2/pipeline/' \
| jq -r '.meta.total_count == 1' \
) == true

0 comments on commit 4f50a8c

Please sign in to comment.