11# yaml-language-server: $schema=https://json.schemastore.org/github-workflow.json
22#
3- # Interoperability smoke tests.
4- # Spins up a Mastodon instance via Docker Compose and verifies that Fedify
5- # can correctly exchange ActivityPub messages with it .
3+ # Interoperability smoke tests (HTTPS + HTTP signature verification) .
4+ # Uses a standalone Docker Compose file with Caddy TLS proxies to verify that
5+ # Fedify correctly signs and verifies requests over HTTPS .
66# See: https://github.com/fedify-dev/fedify/issues/481
77name : smoke-mastodon
88
99on :
10- push :
11- branches :
12- - main
13- - next
14- - " *.*-maintenance"
10+ schedule :
11+ - cron : " 0 6 * * *"
1512 workflow_dispatch :
1613
1714concurrency :
@@ -23,11 +20,26 @@ jobs:
2320 runs-on : ubuntu-latest
2421 timeout-minutes : 25
2522
23+ env :
24+ COMPOSE : >-
25+ docker compose
26+ -f test/smoke/mastodon/docker-compose.yml
27+
2628 steps :
2729 - uses : actions/checkout@v4
2830
2931 - uses : ./.github/actions/setup-mise
3032
33+ - name : Generate TLS certificates
34+ run : bash test/smoke/mastodon/generate-certs.sh test/smoke/mastodon/.certs
35+
36+ - name : Verify certificates
37+ run : |
38+ openssl verify -CAfile test/smoke/mastodon/.certs/ca.crt \
39+ test/smoke/mastodon/.certs/fedify-harness.crt
40+ openssl verify -CAfile test/smoke/mastodon/.certs/ca.crt \
41+ test/smoke/mastodon/.certs/mastodon.crt
42+
3143 - name : Generate Mastodon secrets
3244 run : |
3345 IMAGE=ghcr.io/mastodon/mastodon:v4.3.9
@@ -47,33 +59,33 @@ jobs:
4759
4860 - name : Start database and redis
4961 run : |
50- docker compose -f test/smoke/mastodon/docker-compose.yml up -d db redis
51- docker compose -f test/smoke/mastodon/docker-compose.yml exec -T db \
62+ $COMPOSE up -d db redis
63+ $COMPOSE exec -T db \
5264 sh -c 'until pg_isready -U mastodon; do sleep 1; done'
5365
5466 - name : Run DB setup and migrations
5567 run : |
56- docker compose -f test/smoke/mastodon/docker-compose.yml run --rm -T \
57- mastodon-web bundle exec rails db:setup
68+ $COMPOSE run --rm -T \
69+ mastodon-web-backend bundle exec rails db:setup
5870 timeout-minutes : 5
5971
6072 - name : Start Mastodon stack
61- run : docker compose -f test/smoke/mastodon/docker-compose.yml up --wait
73+ run : $COMPOSE up --wait
6274 timeout-minutes : 12
6375
6476 - name : Provision Mastodon
6577 run : bash test/smoke/mastodon/provision.sh
6678
6779 - name : Verify connectivity
6880 run : |
69- echo "=== Harness health (from mastodon-web) ==="
70- docker compose -f test/smoke/mastodon/docker-compose.yml exec -T mastodon-web \
71- curl -sf http ://fedify-harness:3001 /_test/health
81+ echo "=== Harness health (from mastodon-web-backend, via Caddy TLS ) ==="
82+ $COMPOSE exec -T mastodon-web-backend \
83+ curl -sf https ://fedify-harness/_test/health
7284 echo " OK"
7385
74- echo "=== Harness health (from mastodon-sidekiq) ==="
75- docker compose -f test/smoke/mastodon/docker-compose.yml exec -T mastodon-sidekiq \
76- curl -sf http ://fedify-harness:3001 /_test/health
86+ echo "=== Harness health (from mastodon-sidekiq, via Caddy TLS ) ==="
87+ $COMPOSE exec -T mastodon-sidekiq \
88+ curl -sf https ://fedify-harness/_test/health
7789 echo " OK"
7890
7991 - name : Run smoke tests
8698 if : failure()
8799 run : |
88100 echo "=== Docker Compose logs ==="
89- docker compose -f test/smoke/mastodon/docker-compose.yml logs --tail=500
101+ $COMPOSE logs --tail=500
90102
91103 - name : Teardown
92104 if : always()
93- run : docker compose -f test/smoke/mastodon/docker-compose.yml down -v
105+ run : $COMPOSE down -v
0 commit comments