11---
22name : 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-
84on :
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
2319jobs :
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
0 commit comments