1010 push :
1111 branches :
1212 - main
13+ - ci/multiple-nc-versions # @TODO: Remove this before merging to main
1314 pull_request :
1415 branches : [ main ]
16+ # Allow manually triggering the workflow.
17+ workflow_dispatch :
1518
1619# Cancels all previous workflow runs for the same branch that have not yet completed.
1720concurrency :
@@ -20,15 +23,24 @@ concurrency:
2023 cancel-in-progress : true
2124
2225jobs :
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)
26+ # @TODO: Instead of building the docker image here, take a pre-build image and mount the code?
27+ # (only build when the Dockerfile changes) Or only push when tagged/main?
2528 build-docker-nextcloud :
2629 runs-on : ubuntu-latest
30+ strategy :
31+ matrix :
32+ nextcloud_version :
33+ - 22
34+ - 23
35+ - 24
36+ - 25
37+ - latest
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
@@ -46,35 +58,47 @@ 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+ needs :
74+ - build-docker-nextcloud
75+
76+ runs-on : ubuntu-latest
77+
6078 strategy :
6179 fail-fast : false
6280 matrix :
81+ # Versions older than 22 are not tested as they run on PHP versions lower than 8.0
82+ nextcloud_version :
83+ - 22
84+ - 23
85+ - 24
86+ - 25
87+ - latest
6388 test :
6489 - ' solidtestsuite/solid-crud-tests:v7.0.5'
6590 - ' solidtestsuite/web-access-control-tests:v7.1.0'
6691 - ' solidtestsuite/webid-provider-tests:v2.1.0'
6792
68- needs :
69- - build-docker-nextcloud
70-
71- runs-on : ubuntu-latest
93+ # For the latest version information see: https://github.com/nextcloud/server/wiki/Maintenance-and-Release-Schedule
94+ # Allow EOL or non-stable versions of Nextcloud to fail the test-suite
95+ continue-on-error : ${{ contains(fromJson('[23, 24, 25]'), matrix.nextcloud_version) == false }}
7296
7397 steps :
7498 - name : Create docker tag from git reference
7599 # A tag name may only contain lower- and uppercase letters, digits, underscores, periods and dashes.
76100 run : |
77- echo "TAG=$(echo -n "${{ github.ref_name }}" \
101+ echo "TAG=$(echo -n "${{ github.ref_name }}-${{ matrix.nextcloud_version }} " \
78102 | tr --complement --squeeze-repeats '[:alnum:]._-' '_')" \
79103 >> "${GITHUB_ENV}"
80104
@@ -92,9 +116,10 @@ jobs:
92116 username : ${{ github.actor }}
93117 password : ${{ secrets.GITHUB_TOKEN }}
94118
119+ # FIXME: The `docker pull` should be moved to a previous step and cached
95120 - name : Pull docker Images
96121 run : |
97- docker image load --input ./cache/solid-nextcloud/${{ github.sha }}.tar
122+ docker image load --input ./cache/solid-nextcloud/${{ github.sha }}-${{ matrix.nextcloud_version }} .tar
98123 docker pull michielbdejong/nextcloud-cookie:${{ env.COOKIE_TAG }}
99124 docker pull ${{ matrix.test }}
100125 docker pull ghcr.io/pdsinterop/php-solid-pubsub-server:${{ env.PUBSUB_TAG }}
0 commit comments