Merge pull request #1 from Genefold/fix/governance-wiring-gaps #16
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Solid Specification Tests | |
| on: | |
| push: | |
| branches: [main] | |
| pull_request: | |
| branches: [main] | |
| workflow_dispatch: | |
| jobs: | |
| spec-tests: | |
| name: CTH (ubuntu) | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout solid-community-rs | |
| uses: actions/checkout@v4 | |
| - name: Install Rust stable | |
| uses: dtolnay/rust-toolchain@stable | |
| - name: Cache Rust build artefacts | |
| uses: Swatinem/rust-cache@v2 | |
| - name: Install Podman | |
| run: | | |
| sudo apt-get update -qq | |
| sudo apt-get install -y podman | |
| - name: Build server (release) | |
| run: cargo build --release -p cli | |
| - name: Start solid-community-rs | |
| shell: bash | |
| run: | | |
| ./target/release/cli \ | |
| --port 3000 \ | |
| --host 0.0.0.0 \ | |
| --base-url http://127.0.0.1:3000/ & | |
| echo "SERVER_PID=$!" >> "$GITHUB_ENV" | |
| - name: Wait for server | |
| shell: bash | |
| run: | | |
| for i in $(seq 1 30); do | |
| curl --silent --fail --output /dev/null http://127.0.0.1:3000/ && break | |
| echo "Waiting... ($i)" | |
| sleep 1 | |
| done | |
| curl --silent --fail --output /dev/null http://127.0.0.1:3000/ \ | |
| || (echo "Server never became ready" && exit 1) | |
| - name: Seed WebID profile documents | |
| shell: bash | |
| run: | | |
| cat > /tmp/alice-card.ttl <<'TTL' | |
| @prefix foaf: <http://xmlns.com/foaf/0.1/> . | |
| @prefix solid: <http://www.w3.org/ns/solid/terms#> . | |
| @prefix pim: <http://www.w3.org/ns/pim/space#> . | |
| <http://127.0.0.1:3000/alice/profile/card#me> | |
| a foaf:Person ; | |
| foaf:name "Alice" ; | |
| solid:oidcIssuer <http://127.0.0.1:3000/> ; | |
| pim:storage <http://127.0.0.1:3000/alice/> . | |
| TTL | |
| cat > /tmp/bob-card.ttl <<'TTL' | |
| @prefix foaf: <http://xmlns.com/foaf/0.1/> . | |
| @prefix solid: <http://www.w3.org/ns/solid/terms#> . | |
| @prefix pim: <http://www.w3.org/ns/pim/space#> . | |
| <http://127.0.0.1:3000/bob/profile/card#me> | |
| a foaf:Person ; | |
| foaf:name "Bob" ; | |
| solid:oidcIssuer <http://127.0.0.1:3000/> ; | |
| pim:storage <http://127.0.0.1:3000/bob/> . | |
| TTL | |
| for USER in alice bob; do | |
| echo "--- seeding ${USER} ---" | |
| curl --silent --output /dev/null \ | |
| --request POST \ | |
| --header 'Content-Type: text/turtle' \ | |
| --header "Slug: ${USER}" \ | |
| http://127.0.0.1:3000/ || true | |
| curl --silent --output /dev/null \ | |
| --request POST \ | |
| --header 'Content-Type: text/turtle' \ | |
| --header 'Slug: profile' \ | |
| http://127.0.0.1:3000/${USER}/ || true | |
| HTTP_STATUS=$(curl --silent --output /dev/null --write-out "%{http_code}" \ | |
| --request PUT \ | |
| --header 'Content-Type: text/turtle' \ | |
| --data-binary @/tmp/${USER}-card.ttl \ | |
| http://127.0.0.1:3000/${USER}/profile/card) | |
| echo "PUT ${USER}/profile/card -> HTTP ${HTTP_STATUS}" | |
| if [[ "$HTTP_STATUS" != "200" && "$HTTP_STATUS" != "201" && "$HTTP_STATUS" != "204" ]]; then | |
| echo "ERROR: unexpected status ${HTTP_STATUS} seeding ${USER} WebID" | |
| exit 1 | |
| fi | |
| done | |
| # Create alice's test container | |
| curl --silent --output /dev/null \ | |
| --request POST \ | |
| --header 'Content-Type: text/turtle' \ | |
| --header 'Slug: test' \ | |
| http://127.0.0.1:3000/alice/ || true | |
| echo "--- verifying alice ---" | |
| curl --silent --fail --header 'Accept: text/turtle' \ | |
| http://127.0.0.1:3000/alice/profile/card | |
| echo "--- verifying bob ---" | |
| curl --silent --fail --header 'Accept: text/turtle' \ | |
| http://127.0.0.1:3000/bob/profile/card | |
| - name: Clone specification-tests | |
| shell: bash | |
| run: | | |
| git clone --depth=1 \ | |
| https://github.com/solid-contrib/specification-tests.git \ | |
| specification-tests | |
| - name: Write config/application.yaml | |
| shell: bash | |
| run: | | |
| mkdir -p config | |
| cat > config/application.yaml <<'YAML' | |
| subjects: /app/config/test-subjects.ttl | |
| sources: | |
| - https://solidproject.org/TR/protocol | |
| - https://github.com/solid-contrib/specification-tests/blob/main/protocol/solid-protocol-test-manifest.ttl | |
| - https://github.com/solid-contrib/specification-tests/blob/main/protocol/requirement-comments.ttl | |
| mappings: | |
| - prefix: https://github.com/solid-contrib/specification-tests/blob/main | |
| path: /data | |
| YAML | |
| - name: Write config/test-subjects.ttl | |
| shell: bash | |
| run: | | |
| cat > config/test-subjects.ttl <<'TTL' | |
| @prefix solid-test: <https://github.com/solid/conformance-test-harness/vocab#> . | |
| @prefix earl: <http://www.w3.org/ns/earl#> . | |
| @prefix doap: <http://usefulinc.com/ns/doap#> . | |
| <https://github.com/tuned-org-uk/solid-community-rs#server> | |
| a earl:Software, earl:TestSubject ; | |
| doap:name "solid-community-rs" ; | |
| doap:programming-language "Rust" ; | |
| doap:homepage <https://github.com/tuned-org-uk/solid-community-rs> ; | |
| solid-test:skip "acp wac authentication" ; | |
| solid-test:serverRoot <http://127.0.0.1:3000/> . | |
| TTL | |
| - name: Write CTH env file | |
| shell: bash | |
| run: | | |
| # Only core config — no auth vars. Supplying USERS_*_USERNAME/PASSWORD | |
| # or SOLID_IDENTITY_PROVIDER triggers CTH's OIDC bootstrap which calls | |
| # /.well-known/openid-configuration. Since this server has no IdP that | |
| # endpoint returns 404 and CTH aborts before running any tests. | |
| cat > cth.env <<'ENV' | |
| USERS_ALICE_WEBID=http://127.0.0.1:3000/alice/profile/card#me | |
| USERS_BOB_WEBID=http://127.0.0.1:3000/bob/profile/card#me | |
| RESOURCE_SERVER_ROOT=http://127.0.0.1:3000 | |
| TEST_CONTAINER=http://127.0.0.1:3000/alice/test/ | |
| CTH_TIMEOUT=10000 | |
| quarkus.log.category."com.intuit.karate".level=DEBUG | |
| quarkus.log.category."org.solid.testharness.http.Client".level=DEBUG | |
| ENV | |
| - name: Show generated config (debug) | |
| shell: bash | |
| run: | | |
| echo "=== test-subjects.ttl ===" | |
| cat config/test-subjects.ttl | |
| echo "=== application.yaml ===" | |
| cat config/application.yaml | |
| echo "=== cth.env ===" | |
| cat cth.env | |
| echo "=== alice WebID ===" | |
| curl -s --header 'Accept: text/turtle' http://127.0.0.1:3000/alice/profile/card | |
| echo "=== bob WebID ===" | |
| curl -s --header 'Accept: text/turtle' http://127.0.0.1:3000/bob/profile/card | |
| - name: Create output directories | |
| shell: bash | |
| run: mkdir -p reports target | |
| - name: Pull CTH image | |
| run: podman pull solidproject/conformance-test-harness | |
| - name: Run CTH | |
| shell: bash | |
| run: | | |
| podman run --rm \ | |
| --network=host \ | |
| --env-file="$(pwd)/cth.env" \ | |
| --volume "$(pwd)/specification-tests:/data:ro" \ | |
| --volume "$(pwd)/config:/app/config:ro" \ | |
| --volume "$(pwd)/reports:/reports" \ | |
| --volume "$(pwd)/target:/app/target" \ | |
| solidproject/conformance-test-harness \ | |
| --output=/reports \ | |
| --target=https://github.com/tuned-org-uk/solid-community-rs#server \ | |
| --skip-teardown | |
| - name: Upload CTH reports | |
| if: always() | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: cth-reports-ubuntu | |
| path: reports/ | |
| if-no-files-found: warn | |
| - name: Stop server | |
| if: always() | |
| shell: bash | |
| run: kill "$SERVER_PID" 2>/dev/null || true |