-
Notifications
You must be signed in to change notification settings - Fork 26
120 lines (103 loc) · 3.53 KB
/
ci.yml
File metadata and controls
120 lines (103 loc) · 3.53 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
116
117
118
119
120
name: CI
on:
push:
branches:
- main
pull_request:
branches:
- main
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Setup Node.js environment
uses: actions/setup-node@v4.3.0
with:
node-version: "14.x"
cache: 'yarn'
- name: Install dependencies
run: yarn install --frozen-lockfile
- name: Build and test frontend
run: yarn build
- name: Setup Go environment
uses: actions/setup-go@v5
with:
go-version: "1.22"
- name: Test backend
uses: magefile/mage-action@v3
with:
version: latest
args: coverage
- name: Build backend
uses: magefile/mage-action@v3
with:
version: latest
args: buildAll
- name: Setup services (Trino, Grafana, PostgreSQL, Keycloak)
run: |
docker network create trino
echo "Starting PostgreSQL..."
docker run --rm --detach \
--name postgres \
--net trino \
--env POSTGRES_USER=keycloak \
--env POSTGRES_PASSWORD=keycloak \
--env POSTGRES_DB=keycloak \
postgres:17.4
echo "Starting Keycloak..."
docker run --rm --detach \
--name keycloak \
--net trino \
--publish 18080:8080 \
--env KC_BOOTSTRAP_ADMIN_USERNAME=admin \
--env KC_BOOTSTRAP_ADMIN_PASSWORD=admin \
--env KC_DB=postgres \
--env KC_DB_URL_HOST=postgres \
--env KC_DB_URL_DATABASE=keycloak \
--env KC_DB_USERNAME=keycloak \
--env KC_DB_PASSWORD=keycloak \
--volume "$(pwd)/test-data/test-keycloak-realm.json:/opt/keycloak/data/import/realm.json" \
quay.io/keycloak/keycloak:26.1.4 \
start-dev --import-realm
echo "Waiting for Keycloak to be ready..."
while true; do
if curl -s http://localhost:18080/realms/master | grep -q "realm"; then
echo "Keycloak is ready!"
break
fi
echo "Waiting for Keycloak..."
sleep 5
done
echo "Starting Trino..."
docker run --rm --detach \
--name trino \
--net trino \
--volume "$(pwd)/test-data/trino/test-trino-config.properties:/etc/trino/config.properties" \
--volume "$(pwd)/test-data/trino/catalog/hive.properties:/etc/trino/catalog/hive.properties" \
trinodb/trino:468
echo "Starting Grafana..."
docker run --rm --detach \
--name grafana \
--net trino \
--publish 3000:3000 \
--volume "$(pwd):/var/lib/grafana/plugins/trino" \
--env "GF_PLUGINS_ALLOW_LOADING_UNSIGNED_PLUGINS=trino-datasource" \
grafana/grafana:11.4.0
echo "Waiting for Trino to be ready..."
while true; do
if docker logs trino 2>&1 | grep -q '======== SERVER STARTED ========'; then
echo "Trino is ready!"
break
fi
echo "Waiting for Trino..."
sleep 5
done
echo "Preconfiguring trino..."
docker exec trino trino --user admin --execute "GRANT admin TO USER grafana IN hive;"
echo "Done."
- name: End to end test
run: |
npx tsc -p tsconfig.json --noEmit
npx playwright install
npx playwright test