3
3
push :
4
4
branches :
5
5
- master
6
+ tags :
7
+ - ' *'
6
8
pull_request_target :
7
9
branches :
8
10
- master
9
11
env :
10
12
NODE_VERSION : 18
11
13
YARN_VERSION : 1.22.22
14
+ REDASH_COOKIE_SECRET : " 2H9gNG9obnAQ9qnR9BDTQUph6CbXKCzF"
15
+ COMPOSE_DOCKER_CLI_BUILD : 1
16
+ DOCKER_BUILDKIT : 1
17
+ FRONTEND_BUILD_MODE : 1
18
+ INSTALL_GROUPS : main,all_ds,dev
19
+ SERVER_MOUNT : /ignore
20
+ PERCY_BRANCH : ${{github.head_ref || github.ref_name}}
21
+ PERCY_COMMIT : ${{github.sha}}
22
+ PERCY_PULL_REQUEST : ${{github.event.number}}
23
+ COMMIT_INFO_BRANCH : ${{github.head_ref || github.ref_name}}
24
+ COMMIT_INFO_MESSAGE : ${{github.event.head_commit.message}}
25
+ COMMIT_INFO_AUTHOR : ${{github.event.pull_request.user.login}}
26
+ COMMIT_INFO_SHA : ${{github.sha}}
27
+ COMMIT_INFO_REMOTE : ${{github.server_url}}/${{github.repository}}
12
28
jobs :
13
29
backend-lint :
14
30
runs-on : ubuntu-22.04
@@ -23,18 +39,15 @@ jobs:
23
39
- uses : actions/setup-python@v5
24
40
with :
25
41
python-version : ' 3.8'
26
- - run : sudo pip install black==23.1.0 ruff==0.0.287
42
+ - run : sudo pip install black==23.12.1 ruff==0.1.9
27
43
- run : ruff check .
28
44
- run : black --check .
29
45
30
46
backend-unit-tests :
31
47
runs-on : ubuntu-22.04
32
48
needs : backend-lint
33
49
env :
34
- COMPOSE_FILE : .ci/compose.ci.yaml
35
- COMPOSE_PROJECT_NAME : redash
36
- COMPOSE_DOCKER_CLI_BUILD : 1
37
- DOCKER_BUILDKIT : 1
50
+ FRONTEND_BUILD_MODE : 0
38
51
steps :
39
52
- if : github.event.pull_request.mergeable == 'false'
40
53
name : Exit if PR is not mergeable
@@ -46,31 +59,31 @@ jobs:
46
59
- name : Build Docker Images
47
60
run : |
48
61
set -x
49
- docker compose build --build-arg install_groups="main,all_ds,dev" --build-arg skip_frontend_build=true
62
+ docker compose build
50
63
docker compose up -d
51
64
sleep 10
52
65
- name : Create Test Database
53
- run : docker compose -p redash run --rm postgres psql -h postgres -U postgres -c "create database tests;"
66
+ run : docker compose run --rm postgres psql -h postgres -U postgres -c "create database tests;"
54
67
- name : List Enabled Query Runners
55
- run : docker compose -p redash run --rm redash manage ds list_types
68
+ run : docker compose run --rm server manage ds list_types
56
69
- name : Run Tests
57
- run : docker compose -p redash run --name tests redash tests --junitxml=junit.xml --cov-report=xml --cov=redash --cov-config=.coveragerc tests/
70
+ run : docker compose run --name tests server tests --junitxml=junit.xml --cov-report=xml --cov=redash --cov-config=.coveragerc tests/
58
71
- name : Copy Test Results
59
72
run : |
60
73
mkdir -p /tmp/test-results/unit-tests
61
74
docker cp tests:/app/coverage.xml ./coverage.xml
62
75
docker cp tests:/app/junit.xml /tmp/test-results/unit-tests/results.xml
63
76
- name : Upload coverage reports to Codecov
64
- uses : codecov/codecov-action@v3
77
+ uses : codecov/codecov-action@v4
65
78
- name : Store Test Results
66
- uses : actions/upload-artifact@v3
79
+ uses : actions/upload-artifact@v4
67
80
with :
68
- name : test-results
81
+ name : backend- test-results
69
82
path : /tmp/test-results
70
83
- name : Store Coverage Results
71
- uses : actions/upload-artifact@v3
84
+ uses : actions/upload-artifact@v4
72
85
with :
73
- name : coverage
86
+ name : backend- coverage
74
87
path : coverage.xml
75
88
76
89
frontend-lint :
@@ -90,13 +103,14 @@ jobs:
90
103
- name : Install Dependencies
91
104
run : |
92
105
npm install --global --force yarn@$YARN_VERSION
93
- yarn cache clean && yarn --frozen-lockfile --network-concurrency 1
106
+ yarn cache clean
107
+ yarn --frozen-lockfile --network-concurrency 1
94
108
- name : Run Lint
95
109
run : yarn lint:ci
96
110
- name : Store Test Results
97
- uses : actions/upload-artifact@v3
111
+ uses : actions/upload-artifact@v4
98
112
with :
99
- name : test-results
113
+ name : frontend- test-results
100
114
path : /tmp/test-results
101
115
102
116
frontend-unit-tests :
@@ -117,24 +131,25 @@ jobs:
117
131
- name : Install Dependencies
118
132
run : |
119
133
npm install --global --force yarn@$YARN_VERSION
120
- yarn cache clean && yarn --frozen-lockfile --network-concurrency 1
134
+ yarn cache clean
135
+ yarn --frozen-lockfile --network-concurrency 1
121
136
- name : Run App Tests
122
137
run : yarn test
123
138
- name : Run Visualizations Tests
124
- run : cd viz-lib && yarn test
139
+ run : |
140
+ cd viz-lib
141
+ yarn test
125
142
- run : yarn lint
126
143
127
144
frontend-e2e-tests :
128
145
runs-on : ubuntu-22.04
129
146
needs : frontend-lint
130
147
env :
131
- COMPOSE_FILE : .ci/compose.cypress.yaml
132
- COMPOSE_PROJECT_NAME : cypress
133
148
CYPRESS_INSTALL_BINARY : 0
134
149
PUPPETEER_SKIP_CHROMIUM_DOWNLOAD : 1
135
- PERCY_TOKEN : ${{ secrets.PERCY_TOKEN }}
136
- CYPRESS_PROJECT_ID : ${{ secrets.CYPRESS_PROJECT_ID }}
137
- CYPRESS_RECORD_KEY : ${{ secrets.CYPRESS_RECORD_KEY }}
150
+ INSTALL_GROUPS : main
151
+ COMPOSE_PROFILES : e2e
152
+ REDASH_PRODUCTION : " true "
138
153
steps :
139
154
- if : github.event.pull_request.mergeable == 'false'
140
155
name : Exit if PR is not mergeable
@@ -154,10 +169,12 @@ jobs:
154
169
- name : Install Dependencies
155
170
run : |
156
171
npm install --global --force yarn@$YARN_VERSION
157
- yarn cache clean && yarn --frozen-lockfile --network-concurrency 1
172
+ yarn cache clean
173
+ yarn --frozen-lockfile --network-concurrency 1
158
174
- name : Setup Redash Server
159
175
run : |
160
176
set -x
177
+ yarn build
161
178
yarn cypress build
162
179
yarn cypress start -- --skip-db-seed
163
180
docker compose run cypress yarn cypress db-seed
@@ -169,7 +186,12 @@ jobs:
169
186
- name : Copy Code Coverage Results
170
187
run : docker cp cypress:/usr/src/app/coverage ./coverage || true
171
188
- name : Store Coverage Results
172
- uses : actions/upload-artifact@v3
189
+ uses : actions/upload-artifact@v4
173
190
with :
174
- name : coverage
191
+ name : frontend- coverage
175
192
path : coverage
193
+ - uses : actions/upload-artifact@v4
194
+ with :
195
+ name : frontend
196
+ path : client/dist
197
+ retention-days : 1
0 commit comments