-
Notifications
You must be signed in to change notification settings - Fork 128
57 lines (55 loc) · 2.72 KB
/
http-tests.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
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 bin/ and its subdirectories to PATH
run: |
echo "bin" >> "$GITHUB_PATH"
for d in "bin"/*/; do
echo "$d" >> "$GITHUB_PATH"
done
- 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: 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