-
Notifications
You must be signed in to change notification settings - Fork 13
79 lines (74 loc) · 2.49 KB
/
geo-integration-test.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
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
name: Synthetic Geo Monitoring SQS tests
on:
workflow_dispatch:
schedule:
- cron: "*/20 * * * *"
push:
branches:
- "main"
- "v[0-9]**"
jobs:
setup-matrix:
runs-on: ubuntu-latest
outputs:
matrix: ${{ steps.set-matrix.outputs.matrix }}
steps:
- id: set-matrix
run: |
echo "matrix={\"include\":[{ \"server\":\"138.68.112.16:8888\", \"env\": \"prod-fra1\"}, {\"server\":\"139.59.218.19:8888\", \"env\": \"prod-sgp1\"}]}" >> "$GITHUB_OUTPUT"
sqs-quote-tests:
timeout-minutes: 15
name: ${{ matrix.env }}-sqs-quote-tests
needs: setup-matrix
runs-on: buildjet-4vcpu-ubuntu-2204
strategy:
fail-fast: false
matrix: ${{fromJson(needs.setup-matrix.outputs.matrix)}}
steps:
- name: Echo IP
run: curl -L "https://ipinfo.io" -s
- name: Check out repository
uses: actions/checkout@v4
- name: Install dependencies
run: |
python -m pip install --upgrade pip
if [ -f tests/requirements.txt ]; then pip install -r tests/requirements.txt; fi
- name: Run Swap tests on ${{ matrix.env }}
env:
SQS_ENVIRONMENTS: "prod"
SQS_API_KEY: ${{ secrets.SQS_API_KEY }}
HTTP_PROXY: "http://${{secrets.TEST_PROXY_CRED}}@${{ matrix.server }}"
HTTPS_PROXY: "http://${{secrets.TEST_PROXY_CRED}}@${{ matrix.server }}"
run: |
pytest -s -n auto tests/test_synthetic_geo.py -v
delete-deployments:
runs-on: ubuntu-latest
if: always()
needs:
[sqs-quote-tests]
steps:
- name: Delete Previous deployments
uses: actions/github-script@v7
with:
debug: true
script: |
const deployments = await github.rest.repos.listDeployments({
owner: context.repo.owner,
repo: context.repo.repo,
sha: context.sha
});
await Promise.all(
deployments.data.map(async (deployment) => {
await github.rest.repos.createDeploymentStatus({
owner: context.repo.owner,
repo: context.repo.repo,
deployment_id: deployment.id,
state: 'inactive'
});
return github.rest.repos.deleteDeployment({
owner: context.repo.owner,
repo: context.repo.repo,
deployment_id: deployment.id
});
})
);