Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unify Compose environments for testing AM packages #355

Merged
merged 8 commits into from
Jun 20, 2024
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
Move AM package build test directories
replaceafill committed Jun 19, 2024
commit d2bfb6dec90420fb5b65dfde90a7cdf57734795d
20 changes: 10 additions & 10 deletions .github/workflows/test-am-debs.yml
Original file line number Diff line number Diff line change
@@ -5,15 +5,15 @@ on:
paths:
- "debs/jammy/archivematica/**"
- "debs/jammy/archivematica-storage-service/**"
- "debs/jammy-testing/**"
- "tests/archivematica/jammy/**"
push:
branches:
- "stable/**"
- "qa/**"
paths:
- "debs/jammy/archivematica/**"
- "debs/jammy/archivematica-storage-service/**"
- "debs/jammy-testing/**"
- "tests/archivematica/jammy/**"
jobs:
build-am-deb:
name: Build Archivematica Debian packages
@@ -98,35 +98,35 @@ jobs:
python-version: "3.10"
cache: "pip"
cache-dependency-path: |
debs/jammy-testing/requirements.txt
tests/archivematica/jammy/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') }}"
tests/archivematica/jammy/.venv/
key: "os-${{ runner.os }}-python_version-${{ env.python_version }}-hash-${{ hashFiles('tests/archivematica/jammy/requirements.txt') }}"
- name: "Set up the virtual environment"
if: "steps.venv-cache.outputs.cache-hit == false"
working-directory: "${{ github.workspace }}/debs/jammy-testing"
working-directory: "${{ github.workspace }}/tests/archivematica/jammy"
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"
working-directory: "${{ github.workspace }}/tests/archivematica/jammy"
run:
echo "$PWD/.venv/bin" >> $GITHUB_PATH
- name: "Start the Compose environment"
working-directory: "${{ github.workspace }}/debs/jammy-testing"
working-directory: "${{ github.workspace }}/tests/archivematica/jammy"
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
working-directory: ${{ github.workspace }}/tests/archivematica/jammy
run: |
podman-compose exec --env LOCAL_REPOSITORY="yes" --user ubuntu archivematica /am-packbuild/debs/jammy-testing/install.sh
podman-compose exec --env LOCAL_REPOSITORY="yes" --user ubuntu archivematica /am-packbuild/tests/archivematica/jammy/install.sh
- name: Test AM API - Get processing configurations
run: |
test $( \
20 changes: 10 additions & 10 deletions .github/workflows/test-am-rpms.yml
Original file line number Diff line number Diff line change
@@ -5,15 +5,15 @@ on:
paths:
- "rpms/EL9/archivematica/**"
- "rpms/EL9/archivematica-storage-service/**"
- "rpms/EL9-testing/**"
- "tests/archivematica/EL9/**"
push:
branches:
- "stable/**"
- "qa/**"
paths:
- "rpms/EL9/archivematica/**"
- "rpms/EL9/archivematica-storage-service/**"
- "rpms/EL9-testing/**"
- "tests/archivematica/EL9/**"
jobs:
build-am-rpm:
name: Build Archivematica RPM packages
@@ -98,35 +98,35 @@ jobs:
python-version: "3.10"
cache: "pip"
cache-dependency-path: |
rpms/EL9-testing/requirements.txt
tests/archivematica/EL9/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') }}"
tests/archivematica/EL9/.venv/
key: "os-${{ runner.os }}-python_version-${{ env.python_version }}-hash-${{ hashFiles('tests/archivematica/EL9/requirements.txt') }}"
- name: "Set up the virtual environment"
if: "steps.venv-cache.outputs.cache-hit == false"
working-directory: "${{ github.workspace }}/rpms/EL9-testing"
working-directory: "${{ github.workspace }}/tests/archivematica/EL9"
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"
working-directory: "${{ github.workspace }}/tests/archivematica/EL9"
run:
echo "$PWD/.venv/bin" >> $GITHUB_PATH
- name: "Start the Compose environment"
working-directory: "${{ github.workspace }}/rpms/EL9-testing"
working-directory: "${{ github.workspace }}/tests/archivematica/EL9"
env:
DOCKER_IMAGE_NAME: "rockylinux"
DOCKER_IMAGE_TAG: "9"
run: |
podman-compose up --detach
- name: Install packages
working-directory: ${{ github.workspace }}/rpms/EL9-testing
working-directory: ${{ github.workspace }}/tests/archivematica/EL9
run: |
podman-compose exec --env LOCAL_REPOSITORY="yes" --user ubuntu archivematica /am-packbuild/rpms/EL9-testing/install.sh
podman-compose exec --env LOCAL_REPOSITORY="yes" --user ubuntu archivematica /am-packbuild/tests/archivematica/EL9/install.sh
- name: Test AM API - Get processing configurations
run: |
test $( \
File renamed without changes.
File renamed without changes.
12 changes: 7 additions & 5 deletions rpms/EL9-testing/README.md → tests/archivematica/EL9/README.md
Original file line number Diff line number Diff line change
@@ -37,20 +37,22 @@ podman-compose up --detach
Test packages from the published Archivematica repository:

```shell
podman-compose exec --user ubuntu archivematica /am-packbuild/rpms/EL9-testing/install.sh
podman-compose exec --user ubuntu archivematica /am-packbuild/tests/archivematica/EL9/install.sh
```

Alternatively, test using the local repository (`../EL9`), which needs to be
previously built:
Alternatively, test using the local repository (`../../../rpms/EL9`), which
needs to be previously built:

```shell
make -C ../EL9
make -C ../../../rpms/EL9/archivematica
make -C ../../../rpms/EL9/archivematica-storage-service
make -C ../../../rpms/EL9 createrepo
```

Test using the local repository:

```shell
podman-compose exec --env LOCAL_REPOSITORY="yes" --user ubuntu archivematica /am-packbuild/rpms/EL9-testing/install.sh
podman-compose exec --env LOCAL_REPOSITORY="yes" --user ubuntu archivematica /am-packbuild/tests/archivematica/EL9/install.sh
```

Once installation finishes you should be able to access to the web interfaces:
Original file line number Diff line number Diff line change
@@ -19,4 +19,4 @@ services:
- "8001:8001"
volumes:
- ".:/src"
- "../../:/am-packbuild"
- "../../../:/am-packbuild"
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -37,20 +37,22 @@ podman-compose up --detach
Test packages from the published Archivematica repository:

```shell
podman-compose exec --user ubuntu archivematica /am-packbuild/debs/jammy-testing/install.sh
podman-compose exec --user ubuntu archivematica /am-packbuild/tests/archivematica/jammy/install.sh
```

Alternatively, test using the local repository (`../jammy`), which needs to be
previously built:
Alternatively, test using the local repository (`../../../debs/jammy`), which
needs to be previously built:

```shell
make -C ../jammy
make -C ../../../debs/jammy/archivematica
make -C ../../../debs/jammy/archivematica-storage-service
make -C ../../../debs/jammy createrepo
```

Test using the local repository:

```shell
podman-compose exec --env LOCAL_REPOSITORY="yes" --user ubuntu archivematica /am-packbuild/debs/jammy-testing/install.sh
podman-compose exec --env LOCAL_REPOSITORY="yes" --user ubuntu archivematica /am-packbuild/tests/archivematica/jammy/install.sh
```

Once installation finishes you should be able to access to the web interfaces:
Original file line number Diff line number Diff line change
@@ -15,4 +15,4 @@ services:
- "8001:8000"
volumes:
- ".:/src"
- "../../:/am-packbuild"
- "../../../:/am-packbuild"
File renamed without changes.
File renamed without changes.