-
Notifications
You must be signed in to change notification settings - Fork 6
149 lines (149 loc) · 4.97 KB
/
test-am-rpms.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
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
name: Archivematica RPM Packages Test
on:
workflow_dispatch:
pull_request:
paths:
- "rpms/EL9/archivematica/**"
- "rpms/EL9/archivematica-storage-service/**"
- "rpms/EL9-testing/**"
push:
branches:
- "stable/**"
- "qa/**"
paths:
- "rpms/EL9/archivematica/**"
- "rpms/EL9/archivematica-storage-service/**"
- "rpms/EL9-testing/**"
jobs:
build-am-rpm:
name: Build Archivematica RPM packages
runs-on: ubuntu-latest
steps:
- name: Check out code
uses: actions/checkout@v4
- name: Build
run: |
make -C ${{ github.workspace }}/rpms/EL9/archivematica
- name: Save artifacts
uses: actions/upload-artifact@v4
with:
name: archivematica-rpm
path: |
${{ github.workspace }}/rpms/EL9/archivematica/*.rpm
build-ss-rpm:
name: Build Storage Service RPM package
runs-on: ubuntu-latest
steps:
- name: Check out code
uses: actions/checkout@v4
- name: Build
run: |
make -C ${{ github.workspace }}/rpms/EL9/archivematica-storage-service
- name: Save artifacts
uses: actions/upload-artifact@v4
with:
name: archivematica-storage-service-rpm
path: |
${{ github.workspace }}/rpms/EL9/archivematica-storage-service/*.rpm
create-rpm-repo:
name: Create RPM repository
runs-on: ubuntu-latest
needs:
- build-am-rpm
- build-ss-rpm
steps:
- name: Check out code
uses: actions/checkout@v4
- name: Restore Archivematica packages
uses: actions/download-artifact@v4
with:
name: archivematica-rpm
path: |
${{ github.workspace }}/rpms/EL9/archivematica/
- name: Restore Storage Service package
uses: actions/download-artifact@v4
with:
name: archivematica-storage-service-rpm
path: |
${{ github.workspace }}/rpms/EL9/archivematica-storage-service
- name: Create repository
run: |
make -C ${{ github.workspace }}/rpms/EL9 createrepo
- name: Save package repository
uses: actions/upload-artifact@v4
with:
name: repository-rpm
path: |
${{ github.workspace }}/rpms/EL9/_yum_repository
test-rpm:
name: Test RPM packages
needs: create-rpm-repo
runs-on: ubuntu-latest
steps:
- name: Check out code
uses: actions/checkout@v4
- name: Restore package repository
uses: actions/download-artifact@v4
with:
name: repository-rpm
path: ${{ github.workspace }}/rpms/EL9/_yum_repository
- name: "Upgrade crun (supports Ubuntu's systemd in the Dockerfile)"
run: |
wget https://github.com/containers/crun/releases/download/1.15/crun-1.15-linux-amd64
sudo install crun-1.15-linux-amd64 /usr/bin/crun
rm crun-1.15-linux-amd64
- name: "Install Python"
uses: "actions/setup-python@v5"
with:
python-version: "3.10"
cache: "pip"
cache-dependency-path: |
rpms/EL9-testing/requirements.txt
- name: "Cache the virtual environment"
id: "venv-cache"
uses: "actions/cache@v4"
with:
path: |
rpms/EL9-testing/.venv/
key: "os-${{ runner.os }}-python_version-${{ env.python_version }}-hash-${{ hashFiles('rpms/EL9-testing/requirements.txt') }}"
- name: "Set up the virtual environment"
if: "steps.venv-cache.outputs.cache-hit == false"
working-directory: "${{ github.workspace }}/rpms/EL9-testing"
run: |
python3 -m venv .venv
.venv/bin/python -m pip install -r requirements.txt
- name: "Add virtual environment to PATH"
working-directory: "${{ github.workspace }}/rpms/EL9-testing"
run:
echo "$PWD/.venv/bin" >> $GITHUB_PATH
- name: "Start the Compose environment"
working-directory: "${{ github.workspace }}/rpms/EL9-testing"
env:
DOCKER_IMAGE_NAME: "rockylinux"
DOCKER_IMAGE_TAG: "9"
run: |
podman-compose up --detach
- name: Install packages
working-directory: ${{ github.workspace }}/rpms/EL9-testing
run: |
podman-compose exec --env LOCAL_REPOSITORY="yes" --user ubuntu archivematica /am-packbuild/rpms/EL9-testing/install.sh
- name: Test AM API - Get processing configurations
run: |
test $( \
curl \
--silent \
--header 'Authorization: ApiKey admin:apikey' \
--header 'Content-Type: application/json' \
'http://localhost:8000/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:apikey' \
--header 'Content-Type: application/json' \
'http://localhost:8001/api/v2/pipeline/' \
| jq -r '.meta.total_count == 1' \
) == true