forked from rilldata/rill
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.travis.yml
155 lines (131 loc) · 3.93 KB
/
.travis.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
language: node_js
dist: focal
node_js:
- 16
os: linux
branches:
only:
- /^main$/
- /^v\d+\.\d+(\.\d+)?$/
cache:
directories:
- "$HOME/.npm"
- "$HOME/.cache"
- "$TRAVIS_BUILD_DIR/data"
- "node_modules"
addons:
apt:
packages:
- maven
jobs:
include:
# Run tests always
- stage: Test
name: "Verify build"
if: tag IS NOT present
# in order to achieve npm ci (clean install) delete the travis cache.
install: &npm-install
- echo "NPM Install can take up to 15 mins"
- npm i
- echo "Disabling telmetry"
- cat <<< "$(jq -c -M '.sendTelemetryData |= false' ~/.rill/local.json)" > ~/.rill/local.json
script:
- set -e
- echo "Running npm install"
- npm install
- echo "Check that prettier has been applied"
- npx prettier --check "**/*"
- echo "Install browser for UI tests"
- npx playwright install
- echo "Build the entire application"
- npm run build
- echo "Verify lint of the repo"
- npm run lint -w web-local -- --quiet
- echo "Run all tests"
- npm run test
# Run SQL lib tests
- stage: Test
language: java
jdk: openjdk17
name: "Run SQL lib tests"
if: tag IS NOT present
install:
- PROTOC_ZIP=protoc-21.5-linux-x86_64.zip
- curl -OL https://github.com/protocolbuffers/protobuf/releases/download/v21.5/$PROTOC_ZIP
- sudo unzip -o $PROTOC_ZIP -d /usr/local bin/protoc
- sudo unzip -o $PROTOC_ZIP -d /usr/local 'include/*'
- rm -f $PROTOC_ZIP
script:
- echo "Testing SQL library"
- mvn -f sql/ clean test
# Publish binaries on the release
- stage: Release
name: "Build & Publish Mac os binary"
if: tag IS present OR type IN (cron)
os: osx
osx_image: xcode13.4
addons:
homebrew:
casks:
- google-cloud-sdk
packages:
- jq
env:
PLAYWRIGHT_SKIP_BROWSER_DOWNLOAD=true
before_install:
- ./scripts/check_nightly.sh
install: *npm-install
script: &build-vercel-pkg
- echo "Build the entire application"
- npm run build
- echo "Cleaning dev dependencies"
- npm prune --production
- echo "Building vercel/pkg binary"
- npm run to-commonjs && npm run build-vercel-pkg
- ./scripts/upload.sh
deploy: &deploy-vercel-pkg
provider: releases
api_key: ${GITHUB_TOKEN}
# explicitly mention all types of binaries
# travis doesnt support folder upload as of now
file:
- rilldata/rill-macos-x64
- rilldata/rill-linux-x64
- rilldata/rill-win-x64.exe
cleanup: false
on:
tags: true
- stage: Release
name: "Build & Publish Linux binary"
if: tag IS present OR type IN (cron)
env:
PLAYWRIGHT_SKIP_BROWSER_DOWNLOAD=true
before_install: &python-setup
- echo "Installing python 3.7.0 needed during npm install"
- pyenv install 3.7.0
- pyenv global 3.7.0
- ./scripts/check_nightly.sh
install: *npm-install
script: *build-vercel-pkg
deploy: *deploy-vercel-pkg
- stage: Tag
name: "Cut a new Release"
if: tag IS NOT present AND type IN (api)
install: *npm-install
addons:
snaps:
- name: gh
channel: latest/stable
script:
- set -e
- git remote remove origin
- git remote add origin https://${GITHUB_TOKEN}@github.com/rilldata/rill-developer
- git fetch
- git checkout main
- git branch --set-upstream-to=origin/main main
- gh pr status
- if [[ -z ${BUMP_TYPE} ]]; then
echo "Please specify the BUMP_TYPE from (major/minor/patch)";
exit 1;
fi
- npm run bump-version -w web-local -- ${BUMP_TYPE}