forked from percona/percona-everest-frontend
-
Notifications
You must be signed in to change notification settings - Fork 2
190 lines (159 loc) · 5.27 KB
/
ci.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
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
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
---
name: CI
on:
schedule:
- cron: '0 12 * * 0'
push:
branches:
- main
tags:
- v[0-9]+.[0-9]+.[0-9]+*
pull_request:
permissions:
contents: write
packages: write
checks: write
pull-requests: write
repository-projects: read
jobs:
lint:
name: ESLint & format
runs-on: ubuntu-20.04
env:
BIT_TOKEN: ${{ secrets.BIT_TOKEN }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
strategy:
matrix:
node-version: [16.x]
steps:
- name: Checkout code
uses: actions/checkout@v3
- uses: pnpm/action-setup@v2
with:
version: 8
- name: Use Node
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}
cache: 'pnpm'
- name: Install Bit
run: make install-bit
- name: add bvm bin folder to path
run: echo "$HOME/bin" >> $GITHUB_PATH
- name: Set up bit config
run: bit config set user.token $BIT_TOKEN
- name: Install dependencies
run: make init
- name: Run linter
run: make lint
- name: Run formatter
run: make format
- uses: stefanzweifel/git-auto-commit-action@v4
with:
commit_message: 'chore: format files'
file_pattern: ':(exclude)pnpm-lock.yaml'
tests:
name: Tests
runs-on: ubuntu-20.04
env:
GOPRIVATE: github.com/percona,github.com/percona/percona-everest-backend,github.com/percona/percona-everest-cli,github.com/percona/everest-operator
BIT_TOKEN: ${{ secrets.BIT_TOKEN }}
strategy:
matrix:
node-version: [16.x]
go-version: [1.20.x]
steps:
- name: Checkout FE code
uses: actions/checkout@v3
with:
path: ./percona-everest-frontend
- name: Checkout CLI repo
uses: percona-platform/checkout@v3
with:
repository: percona/percona-everest-cli
ref: 'main'
path: percona-everest-cli
token: ${{ secrets.ROBOT_TOKEN }}
- name: Checkout backend repo
uses: percona-platform/checkout@v3
with:
repository: percona/percona-everest-backend
ref: 'main'
path: percona-everest-backend
token: ${{ secrets.ROBOT_TOKEN }}
- uses: pnpm/action-setup@v2
with:
version: 8
- name: Use Node
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}
cache: 'pnpm'
cache-dependency-path: '**/pnpm-lock.yaml'
- name: Configure git for private modules
env:
ROBOT_TOKEN: ${{ secrets.ROBOT_TOKEN }}
run: git config --global url."https://percona-platform-robot:${ROBOT_TOKEN}@github.com".insteadOf "https://github.com"
- name: Install Bit
run: |
cd ${GITHUB_WORKSPACE}/percona-everest-frontend
make install-bit
- name: add bvm bin folder to path
run: echo "$HOME/bin" >> $GITHUB_PATH
- name: Set up bit config
run: bit config set user.token $BIT_TOKEN
- name: Build Everest
run: |
cd ${GITHUB_WORKSPACE}/percona-everest-frontend
make init
cd apps/everest
make build
- name: Run Everest
run: |
cd ${GITHUB_WORKSPACE}/percona-everest-frontend/apps/everest
make run &
sleep 30s
- name: Set up Go release
uses: percona-platform/setup-go@v4
with:
go-version: ${{ matrix.go-version }}
- name: Set GO_VERSION environment variable
run: |
go version
echo "GO_VERSION=$(go version)" >> $GITHUB_ENV
- name: Enable Go modules cache
uses: percona-platform/cache@v3
with:
path: ~/go/pkg/mod
key: ${{ matrix.os }}-go-${{ matrix.go-version }}-modules-${{ hashFiles('**/go.sum') }}
restore-keys: |
${{ matrix.os }}-go-${{ matrix.go-version }}-modules-
- name: Enable Go build cache
uses: percona-platform/cache@v3
with:
path: ~/.cache/go-build
key: ${{ matrix.os }}-go-${{ matrix.go-version }}-build-${{ github.ref }}-${{ hashFiles('**') }}
restore-keys: |
${{ matrix.os }}-go-${{ matrix.go-version }}-build-${{ github.ref }}-
${{ matrix.os }}-go-${{ matrix.go-version }}-build-
- name: Run Everest backend
run: |
cd ${GITHUB_WORKSPACE}/percona-everest-backend
make init
make local-env-up
make build-debug
make run-debug &> everest-backend.log &
- name: Run debug commands on failure
if: ${{ failure() }}
run: |
cat everest-backend.log
- name: Create KIND cluster
uses: helm/[email protected]
- name: Run Provisioning
run: |
cd ${GITHUB_WORKSPACE}/percona-everest-cli
go run cmd/everest/main.go install operators --backup.enable=false --everest.endpoint=http://127.0.0.1:8080 --monitoring.enable=false --name=minikube --operator.mongodb=true --operator.postgresql=true --operator.xtradb-cluster=true --skip-wizard --namespace test-everest
- name: Run integration tests
run: |
cd ${GITHUB_WORKSPACE}/percona-everest-frontend/apps/everest
make test-ui