1212 - main
1313 pull_request :
1414 branches : [ main ]
15+ # Allow manually triggering the workflow.
16+ workflow_dispatch :
1517
1618# Cancels all previous workflow runs for the same branch that have not yet completed.
1719concurrency :
@@ -20,23 +22,33 @@ concurrency:
2022 cancel-in-progress : true
2123
2224jobs :
23- # @TODO: Instead of building the docker image here, take a pre-build image and mount the code
24- # (only build when the Dockerfile changes)
25+ # @TODO: Instead of building the docker image here, take a pre-build image and mount the code?
26+ # (only build when the Dockerfile changes) Or only push when tagged/main?
2527 build-docker-nextcloud :
2628 runs-on : ubuntu-latest
29+ strategy :
30+ matrix :
31+ # For the latest version information see: https://github.com/nextcloud/server/wiki/Maintenance-and-Release-Schedule
32+ # Versions before 22 are not tested as they run on PHP versions lower than 8.0
33+ # Versions before 24 are not tested as they do not support `.well-known` entries
34+ # Latest is not tested here, as that could cause failures unrelated to project changes
35+ nextcloud_version :
36+ - 24
37+ - 25
38+
2739 steps :
2840 - name : Create docker tag from git reference
2941 # A tag name may only contain lower- and uppercase letters, digits, underscores, periods and dashes.
3042 run : |
31- echo "TAG=$(echo -n "${{ github.ref_name }}" \
43+ echo "TAG=$(echo -n "${{ github.ref_name }}-${{ matrix.nextcloud_version }} " \
3244 | tr --complement --squeeze-repeats '[:alnum:]._-' '_')" \
3345 >> "${GITHUB_ENV}"
3446
3547 - uses : actions/cache@v3
3648 id : cache-solid-nextcloud-docker
3749 with :
3850 path : cache/solid-nextcloud
39- key : solid-nextcloud-docker-${{ github.sha }}
51+ key : solid-nextcloud-docker-${{ matrix.nextcloud_version }}-${{ github.sha }}
4052
4153 - uses : actions/checkout@v3
4254
@@ -46,35 +58,43 @@ jobs:
4658 username : ${{ github.actor }}
4759 password : ${{ secrets.GITHUB_TOKEN }}
4860
49- - name : Build Solid-Nextcloud Docker image
61+ - name : Build Solid-Nextcloud Docker image from NC-${{ matrix.nextcloud_version }}
5062 run : |
5163 docker build \
5264 --tag "solid-nextcloud:${{ env.TAG }}" \
5365 --tag "ghcr.io/pdsinterop/solid-nextcloud:${{ env.TAG }}" \
66+ --build-arg 'NEXTCLOUD_VERSION=${{ matrix.nextcloud_version }}' \
5467 .
5568 docker push "ghcr.io/pdsinterop/solid-nextcloud:${{ env.TAG }}"
5669 mkdir -p cache/solid-nextcloud
57- docker image save solid-nextcloud:${{ env.TAG }} --output ./cache/solid-nextcloud/${{ github.sha }}.tar
70+ docker image save solid-nextcloud:${{ env.TAG }} --output ./cache/solid-nextcloud/${{ github.sha }}-${{ matrix.nextcloud_version }} .tar
5871
5972 solid-testsuite :
73+ timeout-minutes : 30
74+ needs :
75+ - build-docker-nextcloud
76+
77+ runs-on : ubuntu-latest
78+
6079 strategy :
6180 fail-fast : false
6281 matrix :
82+ nextcloud_version :
83+ - 24
84+ - 25
6385 test :
6486 - ' solidtestsuite/solid-crud-tests:v7.0.5'
6587 - ' solidtestsuite/web-access-control-tests:v7.1.0'
6688 - ' solidtestsuite/webid-provider-tests:v2.1.0'
6789
68- needs :
69- - build-docker-nextcloud
70-
71- runs-on : ubuntu-latest
90+ # Prevent EOL or non-stable versions of Nextcloud to fail the test-suite
91+ continue-on-error : ${{ contains(fromJson('[24, 25]'), matrix.nextcloud_version) == false }}
7292
7393 steps :
7494 - name : Create docker tag from git reference
7595 # A tag name may only contain lower- and uppercase letters, digits, underscores, periods and dashes.
7696 run : |
77- echo "TAG=$(echo -n "${{ github.ref_name }}" \
97+ echo "TAG=$(echo -n "${{ github.ref_name }}-${{ matrix.nextcloud_version }} " \
7898 | tr --complement --squeeze-repeats '[:alnum:]._-' '_')" \
7999 >> "${GITHUB_ENV}"
80100
@@ -84,17 +104,18 @@ jobs:
84104 id : cache-solid-nextcloud-docker
85105 with :
86106 path : cache/solid-nextcloud
87- key : solid-nextcloud-docker-${{ github.sha }}
107+ key : solid-nextcloud-docker-${{ matrix.nextcloud_version }}-${{ github.sha }}
88108
89109 - uses : docker/login-action@v2
90110 with :
91111 registry : ghcr.io
92112 username : ${{ github.actor }}
93113 password : ${{ secrets.GITHUB_TOKEN }}
94114
115+ # FIXME: The `docker pull` should be moved to a previous step and cached
95116 - name : Pull docker Images
96117 run : |
97- docker image load --input ./cache/solid-nextcloud/${{ github.sha }}.tar
118+ docker image load --input ./cache/solid-nextcloud/${{ github.sha }}-${{ matrix.nextcloud_version }} .tar
98119 docker pull michielbdejong/nextcloud-cookie:${{ env.COOKIE_TAG }}
99120 docker pull ${{ matrix.test }}
100121 docker pull ghcr.io/pdsinterop/php-solid-pubsub-server:${{ env.PUBSUB_TAG }}
0 commit comments