-
Notifications
You must be signed in to change notification settings - Fork 12
88 lines (88 loc) · 3.87 KB
/
archivematica-upgrade.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
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"
- "dev/test-foobar"
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: "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 -a --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"
sleep 30
# 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 -a --no-pager"
podman-compose exec -u root archivematica bash -c "cat /var/log/mysql/error.log"