generated from PrivateAIM/python-template
-
Notifications
You must be signed in to change notification settings - Fork 0
70 lines (66 loc) · 2.43 KB
/
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
name: Integration test
env:
MINIO_ROOT_USER: admin
MINIO_ROOT_PASSWORD: s3cr3t_p4ssw0rd
MINIO_LOCAL_BUCKET_NAME: flame
MINIO_REMOTE_BUCKET_NAME: upload
# Point these to the new dev instance of the FLAME Hub
HUB_CORE_BASE_URL: https://core.privateaim.dev
HUB_STORAGE_BASE_URL: https://storage.privateaim.dev
HUB_AUTH_BASE_URL: https://auth.privateaim.dev
on:
push:
branches:
- main
pull_request:
branches:
- main
jobs:
test:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Install Python
uses: actions/setup-python@v5
with:
python-version: 3.11
- name: Install Poetry
run: python -m pip install poetry
- name: Install dependencies
run: poetry install
- name: Copy environment variables
run: cp .env.example .env.test
- name: Create local bucket
run: poetry run flame-result migrate --no-verify "$MINIO_ROOT_USER" "$MINIO_ROOT_PASSWORD" "$MINIO_LOCAL_BUCKET_NAME"
- name: Run tests
run: poetry run pytest
env:
MINIO__ACCESS_KEY: ${{env.MINIO_ROOT_USER}}
MINIO__SECRET_KEY: ${{env.MINIO_ROOT_PASSWORD}}
MINIO__BUCKET: ${{env.MINIO_LOCAL_BUCKET_NAME}}
MINIO__ENDPOINT: localhost:9000
HUB__AUTH_METHOD: robot
HUB__ROBOT_AUTH__ID: ${{secrets.HUB_ROBOT_ID}}
HUB__ROBOT_AUTH__SECRET: ${{secrets.HUB_ROBOT_SECRET}}
# No tests against live infra are run here but these envs are set anyway to future-proof in case
# we ever end up testing against live infra. python-dotenv will not override existing envs so the prod
# URLs in the .env.example file shouldn't carry over here.
HUB__AUTH_BASE_URL: ${{env.HUB_AUTH_BASE_URL}}
HUB__CORE_BASE_URL: ${{env.HUB_CORE_BASE_URL}}
HUB__STORAGE_BASE_URL: ${{env.HUB_STORAGE_BASE_URL}}
services:
minio:
# not possible to use official minio image since it requires commands to start up
# which gh doesn't support :(
image: bitnami/minio:2024.1.16
env:
MINIO_ROOT_USER: ${{env.MINIO_ROOT_USER}}
MINIO_ROOT_PASSWORD: ${{env.MINIO_ROOT_PASSWORD}}
ports:
- 9000:9000
options: >-
--health-cmd "curl -I http://localhost:9000/minio/health/live"
--health-interval 2s
--health-timeout 5s
--health-retries 5