Skip to content

Commit b038140

Browse files
authored
Add debugged CI workflow to run the test suites (#4)
Add debugged CI workflow to run the test suites
1 parent 6dff1ee commit b038140

File tree

4 files changed

+8
-68
lines changed

4 files changed

+8
-68
lines changed
Lines changed: 2 additions & 66 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,10 @@
11
---
22
name: Solid Test Suites
33

4-
env:
5-
# Docker Hub digest (i.e. hash) of the used Docker Images that do not have a version tag.
6-
PUBSUB_TAG: latest@sha256:b73a2a5c98d2005bb667dfc69d1c859d704366024298b9caa24ea2e182c456c2
7-
84
on:
95
push:
106
branches:
11-
- main
7+
- workflow
128
pull_request:
139
branches: [ main ]
1410
# Allow manually triggering the workflow.
@@ -21,82 +17,22 @@ concurrency:
2117
cancel-in-progress: true
2218

2319
jobs:
24-
# @TODO: Instead of building the docker image here, take a pre-build image and mount the code?
25-
# (only build when the Dockerfile changes) Or only push when tagged/main?
26-
build-docker:
27-
runs-on: ubuntu-latest
28-
steps:
29-
- name: Create docker tag from git reference
30-
# A tag name may only contain lower- and uppercase letters, digits, underscores, periods and dashes.
31-
run: |
32-
echo "TAG=$(echo -n "${{ github.ref_name }}" \
33-
| tr --complement --squeeze-repeats '[:alnum:]._-' '_')" \
34-
>> "${GITHUB_ENV}"
35-
36-
- uses: actions/cache@v4
37-
id: cache-solid-php-docker
38-
with:
39-
path: cache/solid-php
40-
key: solid-php-${{ github.sha }}
41-
42-
- uses: actions/checkout@v4
43-
44-
- uses: docker/login-action@v3
45-
with:
46-
registry: ghcr.io
47-
username: ${{ github.actor }}
48-
password: ${{ secrets.GITHUB_TOKEN }}
49-
50-
- name: Build Solid-PHP
51-
run: |
52-
docker build \
53-
--tag "solid-php:${{ env.TAG }}" \
54-
--tag "ghcr.io/${{ github.repository }}:${{ env.TAG }}" \
55-
-f docker\solid.Dockerfile \
56-
.
57-
docker push "ghcr.io/${{ github.repository }}:${{ env.TAG }}"
58-
mkdir -p cache/solid-php
59-
docker image save solid-php:${{ env.TAG }} --output ./cache/solid-php/${{ github.sha }}.tar
60-
6120
solid-testsuite:
6221
timeout-minutes: 30
63-
needs:
64-
- build-docker
65-
6622
runs-on: ubuntu-latest
6723

6824
strategy:
6925
fail-fast: false
7026

7127
steps:
72-
- name: Create docker tag from git reference
73-
# A tag name may only contain lower- and uppercase letters, digits, underscores, periods and dashes.
74-
run: |
75-
echo "TAG=$(echo -n "${{ github.ref_name }}" \
76-
| tr --complement --squeeze-repeats '[:alnum:]._-' '_')" \
77-
>> "${GITHUB_ENV}"
78-
7928
- uses: actions/checkout@v4
8029

81-
- uses: actions/cache@v4
82-
id: cache-solid-php-docker
83-
with:
84-
path: cache/solid-php
85-
key: solid-php-docker-${{ github.sha }}
86-
8730
- uses: docker/login-action@v3
8831
with:
8932
registry: ghcr.io
9033
username: ${{ github.actor }}
9134
password: ${{ secrets.GITHUB_TOKEN }}
9235

93-
# FIXME: The `docker pull` should be moved to a previous step and cached
94-
- name: Pull docker Images
95-
run: |
96-
docker image load --input ./cache/solid-php/${{ github.sha }}.tar
97-
docker pull ${{ matrix.test }}
98-
docker pull ghcr.io/pdsinterop/php-solid-pubsub-server:${{ env.PUBSUB_TAG }}
99-
100-
- name: Start Docker Containers
36+
- name: Run Solid Test Suite
10137
run: |
10238
./tests/testsuite/run-solid-test-suite.sh

docker/solid.Dockerfile

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,14 @@
11
FROM php:8.3-apache
22
LABEL maintainer="[email protected]"
33
RUN apt-get update
4-
RUN apt-get install -y ssl-cert
4+
RUN apt-get install -y ssl-cert git unzip
55
RUN docker-php-ext-install bcmath
66
RUN a2enmod rewrite allowmethods ssl
77

88
COPY . /opt/solid
99
COPY ./docker/solid.conf /etc/apache2/sites-enabled/000-default.conf
10+
11+
COPY --from=composer:latest /usr/bin/composer /usr/local/bin/composer
12+
RUN composer install --working-dir=/opt/solid --prefer-dist
13+
1014
EXPOSE 443
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
11
keys/
22
pods/
33
db/
4+
vendor/

tests/testsuite/run-solid-test-suite.sh

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,6 @@ function runTests {
9090
--env SERVER_ROOT_ECSAPED="$ALICE_SERVER_ROOT_ESCAPED" \
9191
--env SECOND_SERVER_ROOT="$BOB_SERVER_ROOT" \
9292
--env OIDC_ISSUER="$ALICE_OIDC_ISSUER" \
93-
# --env DEBUG=* \
9493
"$1-tests"
9594
}
9695

0 commit comments

Comments
 (0)