Skip to content

Scripts moved to bin and added to PATH #8325

Scripts moved to bin and added to PATH

Scripts moved to bin and added to PATH #8325

Workflow file for this run

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 }}
- 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 all subdirectories in bin/ to PATH
run: |
for d in "bin"/*/; do
echo "$d" >> "$GITHUB_PATH"
done
- name: Generating server certificate
run: ../scripts/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: 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