-
Notifications
You must be signed in to change notification settings - Fork 3
78 lines (67 loc) · 2.2 KB
/
Copy pathintegration.yml
File metadata and controls
78 lines (67 loc) · 2.2 KB
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
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
name: Integration Tests
on:
pull_request:
branches: [main, develop]
push:
branches: [main, develop]
workflow_dispatch:
permissions:
contents: read
concurrency:
group: integration-${{ github.ref }}
cancel-in-progress: true
jobs:
integration:
name: Integration Tests
runs-on: ubuntu-latest
services:
# Pinned deliberately: on `latest`, an upstream Comlink release lands in CI with no
# commit of ours, so a red suite carries no information about the change under test.
# Bump this tag on purpose, and keep both services on the same tag.
# 4.4.2 fixes the /data fetch that 4.4.0 and 4.4.1 could not complete.
comlink:
image: ghcr.io/swgoh-utils/swgoh-comlink:4.5.0
env:
APP_NAME: comlink-python-integration-tests
ports:
- 3000:3000
comlink-hmac:
image: ghcr.io/swgoh-utils/swgoh-comlink:4.5.0
env:
APP_NAME: comlink-python-hmac-integration-tests
ACCESS_KEY: ${{ secrets.COMLINK_ACCESS_KEY }}
SECRET_KEY: ${{ secrets.COMLINK_SECRET_KEY }}
ports:
- 3001:3000
steps:
- name: Wait for Comlink services
run: |
for port in 3000 3001; do
echo "Waiting for service on port $port..."
for i in $(seq 1 30); do
if curl -sf http://localhost:$port/readyz > /dev/null 2>&1; then
echo "Service on port $port is ready."
break
fi
if [ $i -eq 30 ]; then
echo "Service on port $port failed to become ready."
exit 1
fi
sleep 2
done
done
- uses: actions/checkout@v7
- name: Install uv
uses: astral-sh/setup-uv@v7
- name: Set up Python
uses: actions/setup-python@v7
with:
python-version: "3.12"
- name: Install dependencies
run: uv sync --group test
- name: Run integration tests
env:
RUN_INTEGRATION_TESTS: "1"
HMAC_ACCESS_KEY: ${{ secrets.COMLINK_ACCESS_KEY }}
HMAC_SECRET_KEY: ${{ secrets.COMLINK_SECRET_KEY }}
run: uv run python -m pytest tests/integration/ -v