Skip to content

Commit 659df54

Browse files
committed
Check again
1 parent 28940fc commit 659df54

1 file changed

Lines changed: 13 additions & 7 deletions

File tree

.github/workflows/test.yml

Lines changed: 13 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,9 @@ on:
66
pull_request:
77
branches: [main]
88

9+
env:
10+
DOMAIN: sslproxy.stackpop.com
11+
912
jobs:
1013
test:
1114
runs-on: ubuntu-latest
@@ -20,9 +23,12 @@ jobs:
2023
2124
- name: Create .env
2225
run: |
23-
echo "DOMAIN=localhost" > .env
26+
echo "DOMAIN=${{ env.DOMAIN }}" > .env
2427
echo "UPSTREAM_URL=http://host.docker.internal:3000" >> .env
2528
29+
- name: Add test domain to hosts
30+
run: echo "127.0.0.1 ${{ env.DOMAIN }}" | sudo tee -a /etc/hosts
31+
2632
- name: Build images
2733
run: docker compose build
2834

@@ -31,9 +37,9 @@ jobs:
3137

3238
- name: Verify certificates exist
3339
run: |
34-
test -f certs/localhost.pem
35-
test -f certs/localhost.key.pem
36-
test -f certs/localhost.rootCA.pem
40+
test -f certs/${{ env.DOMAIN }}.pem
41+
test -f certs/${{ env.DOMAIN }}.key.pem
42+
test -f certs/${{ env.DOMAIN }}.rootCA.pem
3743
3844
- name: Start proxy
3945
run: docker compose up -d
@@ -42,15 +48,15 @@ jobs:
4248
run: sleep 3
4349

4450
- name: Check Caddy is running
45-
run: docker compose ps --format json | jq -e '.[] | select(.Name == "ssl-proxy") | .State == "running"'
51+
run: docker compose ps --status running --services | grep -q '^caddy$'
4652

4753
- name: Test HTTP redirect
4854
run: |
49-
curl -s -o /dev/null -w "%{http_code}" http://localhost:8080 | grep -q "301\|308"
55+
curl -s -o /dev/null -w "%{http_code}" http://${{ env.DOMAIN }}:8080 | grep -q "301\|308"
5056
5157
- name: Test HTTPS proxies to upstream
5258
run: |
53-
curl -s --cacert certs/localhost.rootCA.pem https://localhost:8443 | grep -q "nginx"
59+
curl -s --cacert certs/${{ env.DOMAIN }}.rootCA.pem https://${{ env.DOMAIN }}:8443 | grep -q "nginx"
5460
5561
- name: Show logs on failure
5662
if: failure()

0 commit comments

Comments
 (0)