|
10 | 10 | ASF_ARCHIVE: https://archive.apache.org/dist/ |
11 | 11 | JENA_VERSION: 6.1.0 |
12 | 12 | BASE_URI: https://localhost:4443/ |
| 13 | + VERSIONING_TEST_TOKEN: ${{ secrets.VERSIONING_TEST_TOKEN }} # absent on forks - the versioning suite then skips |
| 14 | + VERSIONING_TEST_REPO: ${{ vars.VERSIONING_TEST_REPO }} |
13 | 15 | steps: |
14 | 16 | - name: Install Linux packages |
15 | 17 | run: sudo apt-get update && sudo apt-get install -qq raptor2-utils libxml2-utils && sudo apt-get install curl |
|
42 | 44 | printf "%s" "${{ secrets.HTTP_TEST_SECRETARY_CERT_PASSWORD }}" > ./secrets/secretary_cert_password.txt |
43 | 45 | printf "%s" "${{ secrets.HTTP_TEST_SECRETARY_CERT_PASSWORD }}" > ./secrets/client_truststore_password.txt |
44 | 46 | shell: bash |
| 47 | + - name: Enable graph versioning |
| 48 | + if: env.VERSIONING_TEST_TOKEN != '' |
| 49 | + run: | |
| 50 | + printf '@prefix a:\t<https://w3id.org/atomgraph/core#> .\n\n<urn:linkeddatahub:versioning/end-user>\n{\n <urn:linkeddatahub:versioning/end-user> a:authToken "%s" .\n}\n' "$VERSIONING_TEST_TOKEN" > ./secrets/credentials.trig |
| 51 | + cat >> ./http-tests/config/system.trig <<EOF |
| 52 | +
|
| 53 | + # GitHub-backed graph versioning (appended by CI; per-run path prefix isolates concurrent runs) |
| 54 | +
|
| 55 | + @prefix doap: <http://usefulinc.com/ns/doap#> . |
| 56 | + @prefix github: <https://w3id.org/atomgraph/linkeddatahub/services/github#> . |
| 57 | +
|
| 58 | + <urn:linkeddatahub:apps/end-user> |
| 59 | + { |
| 60 | + <urn:linkeddatahub:apps/end-user> lapp:versioningRepository <urn:linkeddatahub:versioning/end-user> . |
| 61 | + } |
| 62 | +
|
| 63 | + <urn:linkeddatahub:versioning/end-user> |
| 64 | + { |
| 65 | + <urn:linkeddatahub:versioning/end-user> a doap:GitRepository ; |
| 66 | + doap:location <https://github.com/$VERSIONING_TEST_REPO> ; |
| 67 | + github:branch "main" ; |
| 68 | + github:pathPrefix "graphs-${{ github.run_id }}" . |
| 69 | + } |
| 70 | + EOF |
| 71 | + echo "COMPOSE_VERSIONING=-f ./http-tests/docker-compose.versioning.yml" >> "$GITHUB_ENV" |
| 72 | + echo "VERSIONING_PATH_PREFIX=graphs-${{ github.run_id }}" >> "$GITHUB_ENV" |
| 73 | + shell: bash |
45 | 74 | - name: Build Docker image & Run Docker containers |
46 | | - run: docker compose -f docker-compose.yml -f ./http-tests/docker-compose.http-tests.yml --env-file ./http-tests/.env up --build -d |
| 75 | + run: docker compose -f docker-compose.yml -f ./http-tests/docker-compose.http-tests.yml ${COMPOSE_VERSIONING:-} --env-file ./http-tests/.env up --build -d |
47 | 76 | - name: Wait for the server to start... |
48 | 77 | run: while ! (status=$(curl -k -s -w "%{http_code}\n" https://localhost:4443 -o /dev/null) && echo "$status" && echo "$status" | grep "403") ; do sleep 1 ; done # wait for the webapp to start (returns 403 by default) |
49 | 78 | - name: Fix certificate permissions on the host |
|
54 | 83 | run: ./run.sh "$PWD/ssl/owner/cert.pem" "${{ secrets.HTTP_TEST_OWNER_CERT_PASSWORD }}" "$PWD/ssl/secretary/cert.pem" "${{ secrets.HTTP_TEST_SECRETARY_CERT_PASSWORD }}" |
55 | 84 | shell: bash |
56 | 85 | working-directory: http-tests |
| 86 | + env: |
| 87 | + GITHUB_TOKEN: ${{ secrets.VERSIONING_TEST_TOKEN }} # the versioning suite (and its gh api calls) authenticate with this; empty = suite skips |
57 | 88 | - name: Generate test summary |
58 | 89 | if: always() |
59 | 90 | run: python3 scripts/generate_test_summary.py http-tests/out http-tests/out/report.md |
|
0 commit comments