Test AM package builds with Podman #15
Workflow file for this run
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 DEB Packages Test | |
on: | |
workflow_dispatch: | |
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: "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: | | |
debs/jammy-testing/requirements.txt | |
- name: "Cache the virtual environment" | |
id: "venv-cache" | |
uses: "actions/cache@v4" | |
with: | |
path: | | |
debs/jammy-testing/.venv/ | |
key: "os-${{ runner.os }}-python_version-${{ env.python_version }}-hash-${{ hashFiles('debs/jammy-testing/requirements.txt') }}" | |
- name: "Set up the virtual environment" | |
if: "steps.venv-cache.outputs.cache-hit == false" | |
working-directory: "${{ github.workspace }}/debs/jammy-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 }}/debs/jammy-testing" | |
run: | |
echo "$PWD/.venv/bin" >> $GITHUB_PATH | |
- name: "Start the Compose environment" | |
working-directory: "${{ github.workspace }}/debs/jammy-testing" | |
env: | |
DOCKER_IMAGE_NAME: "ubuntu" | |
DOCKER_IMAGE_TAG: "22.04" | |
run: | | |
podman-compose up --detach | |
- name: Install packages | |
working-directory: ${{ github.workspace }}/debs/jammy-testing | |
run: | | |
podman-compose exec --env LOCAL_REPOSITORY="yes" --user ubuntu archivematica /am-packbuild/debs/jammy-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 |