Jena 6 ont-api (#316) #9308
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: HTTP-tests | |
| on: push | |
| jobs: | |
| http-tests: | |
| name: Build Docker image and run HTTP test suite against it | |
| runs-on: ubuntu-latest | |
| env: | |
| ASF_ARCHIVE: https://archive.apache.org/dist/ | |
| JENA_VERSION: 6.1.0 | |
| BASE_URI: https://localhost:4443/ | |
| steps: | |
| - name: Install Linux packages | |
| run: sudo apt-get update && sudo apt-get install -qq raptor2-utils && sudo apt-get install curl | |
| - name: Set up Java 21 | |
| uses: actions/setup-java@v4 | |
| with: | |
| distribution: 'temurin' | |
| java-version: '21' | |
| - name: Download Jena | |
| run: curl -sS --fail "${{ env.ASF_ARCHIVE }}jena/binaries/apache-jena-${{ env.JENA_VERSION }}.tar.gz" -o "${{ runner.temp }}/jena.tar.gz" | |
| - name: Unpack Jena | |
| run: tar -zxf jena.tar.gz | |
| working-directory: ${{ runner.temp }} | |
| - name: Set JENA_HOME and update PATH | |
| run: | | |
| echo "${{ runner.temp }}/apache-jena-${{ env.JENA_VERSION }}/bin" >> $GITHUB_PATH | |
| - name: Checkout code | |
| uses: actions/checkout@v3 | |
| - name: Add bin/ and its subdirectories to PATH | |
| run: | | |
| find "$GITHUB_WORKSPACE/bin" -type d >> "$GITHUB_PATH" | |
| - name: Generating server certificate | |
| run: | | |
| server-cert-gen.sh .env nginx ssl | |
| working-directory: http-tests | |
| - name: Writing secrets to files | |
| run: | | |
| mkdir -p ./secrets | |
| printf "%s" "${{ secrets.HTTP_TEST_OWNER_CERT_PASSWORD }}" > ./secrets/owner_cert_password.txt | |
| printf "%s" "${{ secrets.HTTP_TEST_SECRETARY_CERT_PASSWORD }}" > ./secrets/secretary_cert_password.txt | |
| printf "%s" "${{ secrets.HTTP_TEST_SECRETARY_CERT_PASSWORD }}" > ./secrets/client_truststore_password.txt | |
| shell: bash | |
| - name: Build Docker image & Run Docker containers | |
| run: docker compose -f docker-compose.yml -f ./http-tests/docker-compose.http-tests.yml --env-file ./http-tests/.env up --build -d | |
| - name: Wait for the server to start... | |
| 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) | |
| - name: Fix certificate permissions on the host | |
| run: | | |
| sudo chmod 644 ./ssl/owner/cert.pem ./ssl/secretary/cert.pem | |
| working-directory: http-tests | |
| - name: Run HTTP test scripts | |
| 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 }}" | |
| shell: bash | |
| working-directory: http-tests | |
| - name: Generate test summary | |
| if: always() | |
| run: python3 scripts/generate_test_summary.py http-tests/out http-tests/out/report.md | |
| - name: Write job summary | |
| if: always() && hashFiles('http-tests/out/report.md') != '' | |
| run: cat http-tests/out/report.md >> "$GITHUB_STEP_SUMMARY" | |
| - name: Upload test results | |
| if: always() && hashFiles('http-tests/out/**') != '' | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: test-results | |
| path: http-tests/out/ | |
| if-no-files-found: ignore | |
| - name: Dump container logs on failure | |
| if: failure() | |
| run: docker compose --env-file ./http-tests/.env logs --no-color | |
| - name: Dump Tomcat logs from linkeddatahub container on failure | |
| if: failure() | |
| run: docker compose --env-file ./http-tests/.env exec -T linkeddatahub sh -c 'for f in /usr/local/tomcat/logs/*; do echo "=== $f ==="; cat "$f"; done' || true | |
| - name: Stop Docker containers and remove volumes | |
| run: docker compose --env-file ./http-tests/.env down -v | |
| - name: Remove Docker containers | |
| run: docker compose --env-file ./http-tests/.env rm -f |