-
Notifications
You must be signed in to change notification settings - Fork 20
124 lines (107 loc) · 3.57 KB
/
integration-cube-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
name: Cube Integration CI
on:
pull_request:
paths:
- "grai-integrations/source-cube/**"
- "grai-client/**"
- "grai-server/**"
concurrency:
group: ${{ github.ref }}-integration-cube-ci
cancel-in-progress: true
env:
py_ver: "3.10"
poetry_ver: "1.3.1"
project_dir: "grai-integrations/source-cube"
jobs:
lint-integration-cube:
runs-on: ubuntu-latest
defaults:
run:
working-directory: ${{ env.project_dir }}
steps:
- name: Check out Git repository
uses: actions/checkout@v4
- name: Install Python
id: setup-python
uses: actions/setup-python@v5
with:
python-version: "${{ env.py_ver }}"
- run: pip install black isort
- run: |
black . --check
isort . --profile black --check
tests-integration-cube:
needs: lint-integration-cube
runs-on: ubuntu-latest
defaults:
run:
working-directory: ${{ env.project_dir }}
# services:
# grai-db:
# image: postgres:16
# env:
# POSTGRES_USER: grai
# POSTGRES_PASSWORD: grai
# POSTGRES_DB: grai
# ports:
# - 5433:5432
# # needed because the postgres container does not provide a healthcheck
# options: --health-cmd pg_isready --health-interval 2s --health-timeout 5s --health-retries 15
# db:
# image: postgres:16
# env:
# POSTGRES_USER: cube
# POSTGRES_PASSWORD: cube
# POSTGRES_DB: cube
# ports:
# - 5434:5432
# # needed because the postgres container does not provide a healthcheck
# options: --health-cmd pg_isready --health-interval 2s --health-timeout 5s --health-retries 15
# cubeapi:
# image: cubejs/cube:latest
# volumes:
# - ${{ github.workspace }}/grai-integrations/source-cube/data/cube:/cube/conf
# ports:
# - 4000:4000
# env:
# CUBEJS_DB_TYPE: postgres
# CUBEJS_DB_HOST: db
# CUBEJS_DB_NAME: cube
# CUBEJS_DB_USER: cube
# CUBEJS_DB_PASS: cube
# CUBEJS_API_SECRET: secret
# CUBEJS_DATASOURCES: default,grai
# CUBEJS_DS_GRAI_DB_TYPE: postgres
# CUBEJS_DS_GRAI_DB_HOST: grai-db
# CUBEJS_DS_GRAI_DB_PORT: "5432"
# CUBEJS_DS_GRAI_DB_NAME: grai
# CUBEJS_DS_GRAI_DB_USER: grai
# CUBEJS_DS_GRAI_DB_PASS: grai
# CUBEJS_DEV_MODE: true
steps:
- uses: actions/checkout@v4
- name: Start Cube Stack
run: |
docker compose up -d
- uses: actions/setup-python@v5
with:
python-version: "${{ env.py_ver }}"
- uses: abatilo/actions-poetry@v2
with:
poetry-version: "${{ env.poetry_ver }}"
# - name: Set up Postgres db
# working-directory: ${{ env.project_dir }}/data/dev-database
# env:
# POSTGRES_USER: grai
# POSTGRES_PASSWORD: grai
# POSTGRES_DB: grai
# PORT: 5433
# HOST: grai-db
# run: |
# bash init-db.sh
- run: poetry install
- name: Wait for Cube to start
run: |
docker run --network container:cubeapi curlimages/curl -s --retry 10 --retry-connrefused http://localhost:4000/readyz
- name: Run Cube Tests
run: poetry run pytest