-
Notifications
You must be signed in to change notification settings - Fork 13
104 lines (86 loc) · 3.26 KB
/
test.migration.yaml
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
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
name: "Test - Migration"
on:
pull_request:
branches: [rc, main]
push:
branches: [rc]
workflow_dispatch:
permissions:
contents: write
packages: write
jobs:
setup:
runs-on: ubuntu-latest
outputs:
changed: ${{ steps.filter.outputs.changed }}
steps:
- name: Checkout Repository
uses: actions/checkout@v3
- name: Diff Changes
uses: dorny/paths-filter@v3
id: filter
with:
filters: |
changed:
- "client/**"
- "freighter/py/**"
- "synnax/**"
- "cesium/**"
- "aspen/**"
- "x/**"
- "freighter/**"
- ".github/workflows/test.client.yaml"
test-on-both-servers:
runs-on: ubuntu-latest
steps:
- name: Checkout Repository
uses: actions/checkout@v3
# Test with Main Server
- name: Start Main Server
run: docker run -d --name synnax-main -p 9090:9090 -v data:/usr/local/synnax/data -e SYNNAX_DATA=/usr/local/synnax/data -e SYNNAX_LISTEN=0.0.0.0:9090 -e SYNNAX_VERBOSE=true -e SYNNAX_INSECURE=true -e SYNNAX_MEM=false -e SYNNAX_LICENSE_KEY=${{ secrets.SYNNAX_LICENSE_KEY }} ghcr.io/synnaxlabs/synnax:latest
- name: Checkout Main Branch for Tests
uses: actions/checkout@v3
with:
ref: main
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: "3.12"
- name: Install Poetry
run: |
pip install poetry
poetry config virtualenvs.create false
poetry install
working-directory: ./client/py
- name: Python Test with Main Server
run: pytest --cov=freighter --cov-report xml:coverage.xml
working-directory: ./client/py
- name: Stop Main Server
run: docker stop synnax-main && docker rm synnax-main
# Build and Test with Current Server
- name: Checkout Current Branch
uses: actions/checkout@v3
- name: Login to Github Container Registry
uses: docker/login-action@v2
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Download Latest Earthly
uses: earthly/actions-setup@v1
- name: Build Current Server Image
run: earthly --push +docker -tag=${GITHUB_SHA} -driver=false
working-directory: ./synnax
- name: Push Current Server Image to Github Container Registry
run: docker push ghcr.io/synnaxlabs/synnax:${GITHUB_SHA}
- name: Start Current Server
run: docker run -d --name synnax-current -p 9090:9090 -v data:/usr/local/synnax/data -e SYNNAX_DATA=/usr/local/synnax/data -e SYNNAX_LISTEN=0.0.0.0:9090 -e SYNNAX_VERBOSE=true -e SYNNAX_INSECURE=true -e SYNNAX_MEM=false -e SYNNAX_LICENSE_KEY=${{ secrets.SYNNAX_LICENSE_KEY }} ghcr.io/synnaxlabs/synnax:${GITHUB_SHA}
- name: Checkout Main Branch for Tests (Again)
uses: actions/checkout@v3
with:
ref: main
- name: Python Test with Current Server
run: pytest --cov=freighter --cov-report xml:coverage.xml
working-directory: ./client/py
- name: Stop Current Server
run: docker stop synnax-current && docker rm synnax-current