Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
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
68 changes: 2 additions & 66 deletions .github/workflows/solid-tests-suites.yml
Original file line number Diff line number Diff line change
@@ -1,14 +1,10 @@
---
name: Solid Test Suites

env:
# Docker Hub digest (i.e. hash) of the used Docker Images that do not have a version tag.
PUBSUB_TAG: latest@sha256:b73a2a5c98d2005bb667dfc69d1c859d704366024298b9caa24ea2e182c456c2

on:
push:
branches:
- main
- workflow
pull_request:
branches: [ main ]
# Allow manually triggering the workflow.
Expand All @@ -21,82 +17,22 @@ concurrency:
cancel-in-progress: true

jobs:
# @TODO: Instead of building the docker image here, take a pre-build image and mount the code?
# (only build when the Dockerfile changes) Or only push when tagged/main?
build-docker:
runs-on: ubuntu-latest
steps:
- name: Create docker tag from git reference
# A tag name may only contain lower- and uppercase letters, digits, underscores, periods and dashes.
run: |
echo "TAG=$(echo -n "${{ github.ref_name }}" \
| tr --complement --squeeze-repeats '[:alnum:]._-' '_')" \
>> "${GITHUB_ENV}"

- uses: actions/cache@v4
id: cache-solid-php-docker
with:
path: cache/solid-php
key: solid-php-${{ github.sha }}

- uses: actions/checkout@v4

- uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Build Solid-PHP
run: |
docker build \
--tag "solid-php:${{ env.TAG }}" \
--tag "ghcr.io/${{ github.repository }}:${{ env.TAG }}" \
-f docker\solid.Dockerfile \
.
docker push "ghcr.io/${{ github.repository }}:${{ env.TAG }}"
mkdir -p cache/solid-php
docker image save solid-php:${{ env.TAG }} --output ./cache/solid-php/${{ github.sha }}.tar

solid-testsuite:
timeout-minutes: 30
needs:
- build-docker

runs-on: ubuntu-latest

strategy:
fail-fast: false

steps:
- name: Create docker tag from git reference
# A tag name may only contain lower- and uppercase letters, digits, underscores, periods and dashes.
run: |
echo "TAG=$(echo -n "${{ github.ref_name }}" \
| tr --complement --squeeze-repeats '[:alnum:]._-' '_')" \
>> "${GITHUB_ENV}"

- uses: actions/checkout@v4

- uses: actions/cache@v4
id: cache-solid-php-docker
with:
path: cache/solid-php
key: solid-php-docker-${{ github.sha }}

- uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

# FIXME: The `docker pull` should be moved to a previous step and cached
- name: Pull docker Images
run: |
docker image load --input ./cache/solid-php/${{ github.sha }}.tar
docker pull ${{ matrix.test }}
docker pull ghcr.io/pdsinterop/php-solid-pubsub-server:${{ env.PUBSUB_TAG }}

- name: Start Docker Containers
- name: Run Solid Test Suite
run: |
./tests/testsuite/run-solid-test-suite.sh
6 changes: 5 additions & 1 deletion docker/solid.Dockerfile
Original file line number Diff line number Diff line change
@@ -1,10 +1,14 @@
FROM php:8.3-apache
LABEL maintainer="[email protected]"
RUN apt-get update
RUN apt-get install -y ssl-cert
RUN apt-get install -y ssl-cert git unzip
RUN docker-php-ext-install bcmath
RUN a2enmod rewrite allowmethods ssl

COPY . /opt/solid
COPY ./docker/solid.conf /etc/apache2/sites-enabled/000-default.conf

COPY --from=composer:latest /usr/bin/composer /usr/local/bin/composer
RUN composer install --working-dir=/opt/solid --prefer-dist

EXPOSE 443
1 change: 1 addition & 0 deletions docker/solid.Dockerfile.dockerignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
keys/
pods/
db/
vendor/
1 change: 0 additions & 1 deletion tests/testsuite/run-solid-test-suite.sh
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,6 @@ function runTests {
--env SERVER_ROOT_ECSAPED="$ALICE_SERVER_ROOT_ESCAPED" \
--env SECOND_SERVER_ROOT="$BOB_SERVER_ROOT" \
--env OIDC_ISSUER="$ALICE_OIDC_ISSUER" \
# --env DEBUG=* \
"$1-tests"
}

Expand Down
Loading