-
Notifications
You must be signed in to change notification settings - Fork 6
145 lines (145 loc) · 5.17 KB
/
test-am-debs.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
name: Archivematica DEB Packages Test
on:
pull_request:
paths:
- "debs/jammy/archivematica/**"
- "debs/jammy/archivematica-storage-service/**"
- "debs/jammy-testing/**"
push:
branches:
- "stable/**"
- "qa/**"
paths:
- "debs/jammy/archivematica/**"
- "debs/jammy/archivematica-storage-service/**"
- "debs/jammy-testing/**"
jobs:
build-am-deb:
name: Build Archivematica Debian packages
runs-on: ubuntu-latest
steps:
- name: Check out code
uses: actions/checkout@v4
- name: Build
run: |
make -C ${{ github.workspace }}/debs/jammy/archivematica
- name: Save artifacts
uses: actions/upload-artifact@v4
with:
name: archivematica-deb
path: |
${{ github.workspace }}/debs/jammy/archivematica/repo
build-ss-deb:
name: Build Storage Service Debian package
runs-on: ubuntu-latest
steps:
- name: Check out code
uses: actions/checkout@v4
- name: Build
run: |
make -C ${{ github.workspace }}/debs/jammy/archivematica-storage-service
- name: Save artifacts
uses: actions/upload-artifact@v4
with:
name: archivematica-storage-service-deb
path: |
${{ github.workspace }}/debs/jammy/archivematica-storage-service/repo
create-deb-repo:
name: Create Debian repository
runs-on: ubuntu-latest
needs:
- build-am-deb
- build-ss-deb
steps:
- name: Check out code
uses: actions/checkout@v4
- name: Restore Archivematica packages
uses: actions/download-artifact@v4
with:
name: archivematica-deb
path: |
${{ github.workspace }}/debs/jammy/archivematica/repo
- name: Restore Storage Service package
uses: actions/download-artifact@v4
with:
name: archivematica-storage-service-deb
path: |
${{ github.workspace }}/debs/jammy/archivematica-storage-service/repo
- name: Create repository
run: |
make -C ${{ github.workspace }}/debs/jammy createrepo
- name: Save package repository
uses: actions/upload-artifact@v4
with:
name: repository-deb
path: |
${{ github.workspace }}/debs/jammy/_deb_repository
test-deb:
name: Test Debian packages
needs: create-deb-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-deb
path: ${{ github.workspace }}/debs/jammy/_deb_repository
- 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: Install the vagrant-vbguest plugin
run: |
vagrant plugin install vagrant-vbguest
- name: Update vbox networks
run: |
sudo mkdir -p /etc/vbox/
echo "* 192.168.33.0/24" | sudo tee -a /etc/vbox/networks.conf
- name: Start
run: |
vagrant up --no-provision
working-directory: ${{ github.workspace }}/debs/jammy-testing
- name: Install Guest Additions build dependencies
run: |
vagrant ssh -c 'sudo apt-get update -y'
vagrant ssh -c 'sudo apt-get install -y linux-headers-$(uname -r) build-essential dkms'
working-directory: ${{ github.workspace }}/debs/jammy-testing
- name: Stop
run: |
vagrant halt
working-directory: ${{ github.workspace }}/debs/jammy-testing
- name: Start and provision
run: |
vagrant up
working-directory: ${{ github.workspace }}/debs/jammy-testing
env:
PROVISION: yes
LOCAL_REPOSITORY: yes
- name: Test AM API - Get processing configurations
run: |
test $( \
curl \
--silent \
--header 'Authorization: ApiKey admin:apikey' \
--header 'Content-Type: application/json' \
'http://192.168.33.2/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://192.168.33.2:8000/api/v2/pipeline/' \
| jq -r '.meta.total_count == 1' \
) == true