-
-
Notifications
You must be signed in to change notification settings - Fork 2
115 lines (89 loc) · 4.15 KB
/
Copy pathmissing-services-e2e-tests.yml
File metadata and controls
115 lines (89 loc) · 4.15 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
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
105
106
107
108
109
110
111
112
113
114
115
name: "Missing services E2E tests"
on:
workflow_dispatch: {}
jobs:
build:
name: Build
runs-on: ubuntu-latest
timeout-minutes: 20
env:
SERVAL_CLIENT_ID: ${{ secrets.SERVAL_CLIENT_ID }}
SERVAL_CLIENT_SECRET: ${{ secrets.SERVAL_CLIENT_SECRET }}
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
ClearML_AccessKey: ${{ secrets.ClearML_AccessKey }}
ClearML_SecretKey: ${{ secrets.ClearML_SecretKey }}
CLEARML_GPU_QUEUE: autoscaler
CLEARML_CPU_QUEUE: autoscaler.cpu_only
SERVAL_HOST_URL: http://localhost
SERVAL_AUTH_URL: https://sil-appbuilder.auth0.com
steps:
- uses: actions/checkout@v5
# get version of machine.py - MACHINE_PY_IMAGE will force the docker compose to use the proper version of machine.py
- name: Install regctl
uses: iarekylew00t/regctl-installer@v4.0.8
- name: Set proper version of Machine.py
run: |
export MACHINE_PY_IMAGE=ghcr.io/sillsdev/machine.py:$(regctl image config ghcr.io/sillsdev/machine.py | jq -r ".config.Labels[\"org.opencontainers.image.version\"]") && \
echo "MACHINE_PY_IMAGE=$MACHINE_PY_IMAGE" >> $GITHUB_ENV && \
echo "MACHINE_PY_CPU_IMAGE=$MACHINE_PY_IMAGE.cpu_only" >> $GITHUB_ENV
- name: Confirm proper version of Machine.py
run: |
echo $MACHINE_PY_IMAGE $MACHINE_PY_CPU_IMAGE
- name: Setup .NET
uses: actions/setup-dotnet@v5
with:
dotnet-version: 10.0.x
- name: Get Machine
run: cd .. && git clone https://github.com/sillsdev/machine.git && cd machine && dotnet build && cd ../serval && dotnet build
- name: Restore dotnet tools
run: dotnet tool restore
- name: Restore dependencies
run: dotnet restore
- name: Build
run: dotnet build --no-restore
- name: Start containers
run: docker compose -f "docker-compose.yml" up -d && sleep 20 #allow time for mongo to start up properly
- name: Debug network
run: docker ps -a && docker logs --since 10m serval_cntr && docker logs --since 10m serval-mongo-1
- name: Pre-Test
run: sudo mkdir -p /var/lib/serval && sudo chmod 777 /var/lib/serval
#Mongo
- name: Test Working Mongo
run: dotnet test --no-build --verbosity normal --filter "TestCategory=MongoWorking" --collect:"Xplat Code Coverage"
- name: Kill Mongo
run: docker stop serval-mongo-1
- name: Test Not Working Mongo
run: dotnet test --no-build --verbosity normal --filter "TestCategory=MongoNotWorking" --collect:"Xplat Code Coverage"
- name: Restart Mongo
run: docker start serval-mongo-1 && sleep 20
#ClearML
- name: Restart containers with new env
run: docker compose down && docker compose -f "docker-compose.yml" up -d && sleep 20 #allow time for mongo to start up properly
env:
ClearML_SecretKey: "not_the_right_key"
- name: Test Not Working ClearML
run: dotnet test --no-build --verbosity normal --filter "TestCategory=ClearMLNotWorking" --collect:"Xplat Code Coverage"
env:
ClearML_SecretKey: "not_the_right_key"
#AWS
- name: Restart containers with new env
run: docker compose down && docker compose -f "docker-compose.yml" up -d && sleep 20 #allow time for mongo to start up properly
env:
AWS_SECRET_ACCESS_KEY: "not_the_right_key"
- name: Test Not Working AWS
run: dotnet test --no-build --verbosity normal --filter "TestCategory=AWSNotWorking" --collect:"Xplat Code Coverage"
env:
AWS_SECRET_ACCESS_KEY: "not_the_right_key"
#Coverage export
- name: Upload coverage reports to Codecov
uses: codecov/codecov-action@v6
env:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
#Clean up
- name: Debug network (Post test)
if: ${{ failure() }}
run: docker ps -a && docker logs --since 10m serval_cntr && docker logs --since 10m serval-mongo-1
- name: Stop containers
if: ${{ success() || failure() }}
run: docker compose down