-
Notifications
You must be signed in to change notification settings - Fork 3
122 lines (110 loc) · 2.79 KB
/
test.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
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
name: Test Workflow
on:
push:
branches:
- main
jobs:
test:
name: Run Tests
runs-on: ubuntu-22.04
steps:
- name: Checkout Code
uses: actions/checkout@v4
- name: Set Up Go
uses: actions/setup-go@v5
with:
go-version: 1.21
- name: Execute Tests
run: make test
lint:
name: Lint Code
runs-on: ubuntu-22.04
steps:
- name: Checkout Code
uses: actions/checkout@v4
- name: Set Up Go
uses: actions/setup-go@v5
with:
go-version: 1.21
- name: Run Linter
uses: golangci/golangci-lint-action@v6
with:
version: v1.56.1
build:
name: Build Docker Image - ${{ matrix.service }}
needs:
- test
- lint
runs-on: ubuntu-22.04
strategy:
matrix:
service:
- index
- library
- validation
- dataproxy
- nodecleaner
- revalidatenode
- schemaparser
- dataproxyupdater
- dataproxyrefresher
- maintenance
steps:
- name: Checkout Code
uses: actions/checkout@v4
- name: DockerHub Login
uses: docker/[email protected]
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Publish Docker Image
run: make docker-push-${{ matrix.service }} DEPLOY_ENV=staging
deploy:
name: Deploy Services
needs:
- test
- lint
- build
runs-on: ubuntu-22.04
env:
SERVER_IP: ${{ secrets.TEST_SERVER_IP }}
KUBECONFIG_PATH: ${{ secrets.KUBECONFIG_PATH }}
SSH_PRIVATE_KEY: ${{ secrets.SSH_PRIVATE_KEY }}
DEPLOY_ENV: staging
steps:
- name: Checkout Repository
uses: actions/checkout@v4
- name: Setup SSH and Deploy Services
run: ./scripts/deploy-services.sh
e2e_test:
name: E2E Test
needs:
- test
- lint
- build
- deploy
runs-on: ubuntu-22.04
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Set up Node.js
uses: actions/setup-node@v4
with:
node-version: "18"
- name: Install Newman
run: |
npm install -g newman
- name: Test Index
run: >
./scripts/wait_for_timeout.sh
https://test-index.murmurations.network/v2/ping 200 300
- name: Test Library
run: >
./scripts/wait_for_timeout.sh
https://test-library.murmurations.network/v2/ping 200 300
- name: Test Data Proxy
run: >
./scripts/wait_for_timeout.sh
https://test-data-proxy.murmurations.network/v1/ping 200 300
- name: Newman E2E Test
run: make newman-test DEPLOY_ENV=staging