Attempt to fix the http-tests workflow using secrets #8287
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: 4.7.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: 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}} | ||
| - run: echo "$JENA_HOME/bin" >> $GITHUB_PATH | ||
| env: | ||
| JENA_HOME: "${{runner.temp}}/apache-jena-${{env.JENA_VERSION}}" | ||
| - name: Checkout code | ||
| uses: actions/checkout@v3 | ||
| shell: bash | ||
| working-directory: http-tests | ||
| - name: Writing secrets to files | ||
| run: | | ||
| mkdir -p ./secrets | ||
| echo "${{ secrets.HTTP_TEST_OWNER_CERT_PASSWORD }}" > ./secrets/owner_cert_password.txt | ||
| echo "${{ secrets.HTTP_TEST_SECRETARY_CERT_PASSWORD }}" > ./secrets/secretary_cert_password.txt | ||
| echo "${{ secrets.HTTP_TEST_SECRETARY_CERT_PASSWORD }}" > ./secrets/client_truststore_password.txt | ||
| - 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: 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: Stop Docker containers | ||
| run: docker compose --env-file ./http-tests/.env down | ||
| - name: Remove Docker containers | ||
| run: docker compose --env-file ./http-tests/.env rm -f | ||