Archivematica Upgrade Test #62
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: "Archivematica Upgrade Test" | |
on: | |
workflow_dispatch: | |
schedule: | |
- cron: "0 2 * * *" | |
pull_request: | |
paths: | |
- "playbooks/archivematica-jammy/**" | |
- "tests/archivematica-upgrade/**" | |
- "!tests/archivematica-upgrade/README.md" | |
push: | |
branches: | |
- "master" | |
paths: | |
- "playbooks/archivematica-jammy/**" | |
- "tests/archivematica-upgrade/**" | |
- "!tests/archivematica-upgrade/README.md" | |
jobs: | |
test: | |
name: "Archivematica upgrade test on ${{ matrix.ubuntu_version }}" | |
runs-on: "ubuntu-${{ matrix.ubuntu_version }}" | |
env: | |
python_version: "3.12" | |
strategy: | |
fail-fast: false | |
matrix: | |
ubuntu_version: | |
- "22.04" | |
- "24.04" | |
steps: | |
- name: "Check out the code" | |
uses: "actions/checkout@v4" | |
- name: "Install Python" | |
uses: "actions/setup-python@v5" | |
with: | |
python-version: "${{ env.python_version }}" | |
cache: "pip" | |
cache-dependency-path: | | |
tests/archivematica-upgrade/requirements.txt | |
- name: "Cache the virtual environment" | |
id: "venv-cache" | |
uses: "actions/cache@v4" | |
with: | |
path: | | |
tests/archivematica-upgrade/.venv/ | |
key: "os-${{ runner.os }}-python_version-${{ env.python_version }}-hash-${{ hashFiles('tests/archivematica-upgrade/requirements.txt') }}" | |
- name: "Set up the virtual environment" | |
if: "steps.venv-cache.outputs.cache-hit == false" | |
working-directory: "${{ github.workspace }}/tests/archivematica-upgrade" | |
run: | | |
python3 -m venv .venv | |
.venv/bin/python -m pip install -r requirements.txt | |
- name: "Add virtual environment to PATH" | |
working-directory: "${{ github.workspace }}/tests/archivematica-upgrade" | |
run: | |
echo "$PWD/.venv/bin" >> $GITHUB_PATH | |
- name: "Generate an SSH key and copy it next to the Dockerfile" | |
run: | | |
mkdir $HOME/.ssh | |
ssh-keygen -t rsa -f $HOME/.ssh/id_rsa -N "" | |
cp $HOME/.ssh/id_rsa.pub ${{ github.workspace }}/tests/archivematica-upgrade/ssh_pub_key | |
- name: "Debug" | |
run: | | |
podman info | |
- name: "Start the Compose environment" | |
working-directory: "${{ github.workspace }}/tests/archivematica-upgrade" | |
run: | | |
podman-compose up --detach | |
podman-compose exec -u root archivematica bash -c "apt-get update" | |
podman-compose exec -u root archivematica bash -c "apt-get install -y curl" | |
podman-compose exec -u root archivematica bash -c "curl -O https://repo.percona.com/apt/percona-release_latest.generic_all.deb" | |
podman-compose exec -u root archivematica bash -c "apt-get install -y gnupg2 lsb-release ./percona-release_latest.generic_all.deb" | |
podman-compose exec -u root archivematica bash -c "apt update" | |
podman-compose exec -u root archivematica bash -c "percona-release setup ps80" | |
podman-compose exec -u root archivematica bash -c "apt-get install -y percona-server-server" | |
podman-compose exec -u root archivematica bash -c "service mysql start" | |
- name: "Debug" | |
if: ${{ always() }} | |
working-directory: "${{ github.workspace }}/tests/archivematica-upgrade" | |
run: | | |
podman-compose exec -u root archivematica bash -c "journalctl -xeu mysql.service --no-pager" | |
podman-compose exec -u root archivematica bash -c "cat /var/log/mysql/error.log" | |
- name: "Restart MySQL (two step)" | |
working-directory: "${{ github.workspace }}/tests/archivematica-upgrade" | |
run: | | |
podman-compose exec -u root archivematica bash -c "service mysql stop" | |
podman-compose exec -u root archivematica bash -c "service mysql start" | |
- name: "Debug" | |
if: ${{ always() }} | |
working-directory: "${{ github.workspace }}/tests/archivematica-upgrade" | |
run: | | |
podman-compose exec -u root archivematica bash -c "journalctl -xeu mysql.service --no-pager" | |
podman-compose exec -u root archivematica bash -c "cat /var/log/mysql/error.log" |