diff --git a/.github/workflows/solid-tests-suites.yml b/.github/workflows/solid-tests-suites.yml index 74d61e9..4a475d8 100644 --- a/.github/workflows/solid-tests-suites.yml +++ b/.github/workflows/solid-tests-suites.yml @@ -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. @@ -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 diff --git a/docker/solid.Dockerfile b/docker/solid.Dockerfile index 36eb513..3e65df0 100755 --- a/docker/solid.Dockerfile +++ b/docker/solid.Dockerfile @@ -1,10 +1,14 @@ FROM php:8.3-apache LABEL maintainer="yvo@muze.nl" 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 diff --git a/docker/solid.Dockerfile.dockerignore b/docker/solid.Dockerfile.dockerignore index 3e23699..f880b1d 100644 --- a/docker/solid.Dockerfile.dockerignore +++ b/docker/solid.Dockerfile.dockerignore @@ -1,3 +1,4 @@ keys/ pods/ db/ +vendor/ \ No newline at end of file diff --git a/tests/testsuite/run-solid-test-suite.sh b/tests/testsuite/run-solid-test-suite.sh index d358ed4..9917402 100755 --- a/tests/testsuite/run-solid-test-suite.sh +++ b/tests/testsuite/run-solid-test-suite.sh @@ -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" }