-
Notifications
You must be signed in to change notification settings - Fork 1.8k
130 lines (125 loc) Β· 4.38 KB
/
cloud.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
# CAUTION: This workflow exposes secrets. It is only supposed to be run on "merge into master" condition.
name: 'Cloud Tests'
on:
# push doesn't work for PRs, it's safe to use it
# only maintainers/core contributors are allowed to push directly to the main repository
push:
paths:
- '.github/actions/integration/athena.sh'
- '.github/actions/integration/bigquery.sh'
- '.github/actions/integration/snowflake.sh'
- '.github/workflows/cloud.yml'
- 'packages/cubejs-testing/**'
- 'packages/cubejs-testing-shared/**'
- 'packages/cubejs-backend-shared/**'
- 'packages/cubejs-base-driver/**'
- 'packages/cubejs-query-orchestrator/**'
- 'packages/cubejs-schema-compiler/**'
- 'packages/cubejs-backend-shared/**'
- 'packages/cubejs-server-core/**'
# drivers
- 'packages/cubejs-athena-driver/**'
- 'packages/cubejs-bigquery-driver/**'
- 'packages/cubejs-snowflake-driver/**'
- 'lerna.json'
- 'package.json'
- 'yarn.lock'
env:
CUBEJS_TESSERACT_ORCHESTRATOR: true
jobs:
latest-tag-sha:
runs-on: ubuntu-20.04
outputs:
sha: ${{ steps.get-tag.outputs.sha }}
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- id: git-log
run: git log HEAD~30..HEAD
- id: get-tag-test
run: echo "$SHA $(git rev-list -n 1 "$(git tag --contains "$SHA")")"
env:
SHA: ${{ github.sha }}
- id: get-tag
run: echo "sha=$(git rev-list -n 1 "$(git tag --contains "$SHA")")" >> "$GITHUB_OUTPUT"
env:
SHA: ${{ github.sha }}
- id: get-tag-out
run: echo "$OUT"
env:
OUT: ${{ steps.get-tag.outputs.sha }}
integration-cloud:
needs: latest-tag-sha
if: (needs['latest-tag-sha'].outputs.sha != github.sha)
runs-on: ubuntu-20.04
timeout-minutes: 60
strategy:
matrix:
node-version: [ 20.x ]
db: [ 'athena', 'bigquery', 'snowflake' ]
target: [ "x86_64-unknown-linux-gnu" ]
fail-fast: false
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Install Rust
uses: actions-rust-lang/setup-rust-toolchain@v1
with:
toolchain: nightly-2024-07-15
# override: true # this is by default on
rustflags: ""
components: rustfmt
target: ${{ matrix.target }}
- name: Install Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}
- name: Get yarn cache directory path
id: yarn-cache-dir-path
run: echo "dir=$(yarn cache dir)" >> "$GITHUB_OUTPUT"
shell: bash
- name: Restore yarn cache
uses: actions/cache@v4
with:
path: ${{ steps.yarn-cache-dir-path.outputs.dir }}
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
restore-keys: |
${{ runner.os }}-yarn-
- name: Set Yarn version
run: yarn policies set-version v1.22.22
- name: Yarn install
uses: nick-fields/retry@v3
env:
CUBESTORE_SKIP_POST_INSTALL: true
with:
max_attempts: 3
retry_on: error
retry_wait_seconds: 15
timeout_minutes: 20
command: yarn install --frozen-lockfile
- name: Build Core Client libraries
run: yarn build
- name: Build other packages
run: yarn lerna run --concurrency 1 build
env:
NODE_OPTIONS: --max_old_space_size=4096
- name: Lerna tsc
run: yarn tsc
- name: Build cubejs-backend-native (without Python)
run: yarn run native:build-release
working-directory: ./packages/cubejs-backend-native
- name: Run Integration tests for ${{ matrix.db }} matrix
uses: nick-fields/retry@v3
with:
max_attempts: 3
retry_on: error
retry_wait_seconds: 15
timeout_minutes: 30
command: ./.github/actions/integration/${{ matrix.db }}.sh
env:
CUBEJS_DB_BQ_CREDENTIALS: ${{ secrets.CUBEJS_DB_BQ_CREDENTIALS }}
CUBEJS_AWS_KEY: ${{ secrets.CUBEJS_AWS_KEY }}
CUBEJS_AWS_SECRET: ${{ secrets.CUBEJS_AWS_SECRET }}
CUBEJS_DB_USER: ${{ secrets.DRIVERS_TESTS_CUBEJS_DB_SNOWFLAKE_USER }}
CUBEJS_DB_PASS: ${{ secrets.DRIVERS_TESTS_CUBEJS_DB_SNOWFLAKE_PASS }}