-
Notifications
You must be signed in to change notification settings - Fork 705
196 lines (195 loc) · 6.93 KB
/
main.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
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
name: CI
# Controls when the action will run. Triggers the workflow on push or pull request
# events but only for the master branch
on:
push:
branches: [ develop ]
pull_request:
branches: [ develop ]
jobs:
test-mysql:
runs-on: ubuntu-latest
env:
SQLFLOW_PARSER_SERVER_PORT: 12300
SQLFLOW_PARSER_SERVER_LOADING_PATH: "${{ github.workspace }}/build"
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
services:
mysql:
image: sqlflow/sqlflow:mysql
ports:
- 13306:3306
steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v3
with:
python-version: '3.8'
- uses: actions/setup-java@v3
with:
distribution: 'zulu' # See 'Supported distributions' for available options
java-version: '8'
cache: 'maven'
- uses: arduino/setup-protoc@v1
with:
version: '3.7.1'
- name: setup-env
run: |
set -e
bash -x scripts/test/code-style-deps.sh
bash -x scripts/test/prepare.sh
- name: pre-commit
run: |
export TRAVIS_BUILD_DIR=${{ github.workspace }}
go generate ./...
go install ./...
pre-commit run -a --show-diff-on-failure
# - name: build mysql image
# run: docker build -t sqlflow:mysql -f docker/mysql/Dockerfile .
- name: mysql unit test
run: |
set -e
SQLFLOW_TEST_DB_MYSQL_ADDR="127.0.0.1:13306" PYTHONPATH=${{ github.workspace }}/python scripts/test/mysql.sh
- name: java unit test
run: |
set -e
bash scripts/test/java.sh
# TODO(typhoonzero): add back hive tests
test-hive-java:
runs-on: ubuntu-latest
steps:
- name: hive unit test
run: |
echo "skip hive test"
test-workflow:
runs-on: ubuntu-latest
steps:
- name: workflow unit test
run: |
echo "skip workflow test"
# env:
# SQLFLOW_PARSER_SERVER_PORT: 12300
# SQLFLOW_PARSER_SERVER_LOADING_PATH: "/usr/local/sqlflow/java"
# CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
# steps:
# - uses: actions/checkout@v1
# - name: hive unit test
# run: |
# set -e
# bash scripts/test/prepare.sh
# source build/env/bin/activate
# docker pull sqlflow/gohive:dev
# docker stop hive || true
# docker rm hive || true
# docker run --rm -d --name=hive --net=host sqlflow/gohive:dev python3 -m http.server 8899
# PYTHONPATH=${{ github.workspace }}/python scripts/test/hive.sh
# bash <(curl -s https://codecov.io/bash)
# FIXME(typhoonzero): maxcompute test often fails because connection timeout, we can add a
# maxcompute service close to the CI server and add this test back.
# - name: maxcompute unit test
# env:
# SQLFLOW_TEST_DB_MAXCOMPUTE_AK: ${{ secrets.MAXCOMPUTE_AK }}
# SQLFLOW_TEST_DB_MAXCOMPUTE_SK: ${{ secrets.MAXCOMPUTE_SK }}
# run: |
# set -e
# source build/env/bin/activate
# PYTHONPATH=${{ github.workspace }}/python bash scripts/test/maxcompute.sh
# # bash scripts/travis/upload_codecov.sh
# test-workflow:
# runs-on: [self-hosted, linux]
# env:
# SQLFLOW_PARSER_SERVER_PORT: 12300
# SQLFLOW_PARSER_SERVER_LOADING_PATH: "/usr/local/sqlflow/java"
# CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
# steps:
# - uses: actions/checkout@v1
# - name: build mysql image
# run: docker build -t sqlflow:mysql -f docker/mysql/Dockerfile .
# - name: workflow mode ci
# run: |
# set -e
# bash scripts/test/prepare.sh
# source build/env/bin/activate
# # build sqlflow binaries under build/
# bash docker/dev/build.sh
# docker pull sqlflow/sqlflow:step
# docker build --cache-from sqlflow/sqlflow:step -t sqlflow/sqlflow:step --build-arg FIND_FASTED_MIRROR="false" -f docker/step/Dockerfile .
# bash scripts/test/workflow.sh
# bash <(curl -s https://codecov.io/bash)
# push-images:
# runs-on: [self-hosted, linux]
# needs: [test-mysql, test-hive-java, test-workflow]
# steps:
# - uses: actions/checkout@v1
# - uses: olegtarasov/get-tag@v2
# id: tagName
# - name: push server images
# env:
# DOCKER_USERNAME: "typhoon1986"
# DOCKER_PASSWORD: ${{ secrets.DOCKER_PASSWORD }}
# ALIYUN_DOCKER_USERNAME: "[email protected]"
# ALIYUN_DOCKER_PASSWORD: ${{ secrets.ALIYUN_DOCKER_PASSWORD }}
# run: |
# set -e
# source scripts/travis/actions_env2_travis.sh
# export TRAVIS_TAG=${{ steps.tagName.outputs.tag }}
# export TRAVIS_PULL_REQUEST=${{ github.event.number }}
# export TRAVIS_BUILD_DIR=${{ github.workspace }}
# export FIND_FASTED_MIRROR=false
# export TRAVIS_BUILD_STAGE_NAME=Deploy
# bash scripts/travis/deploy_docker.sh || docker run --rm -v "$TRAVIS_BUILD_DIR":/work sqlflow:ci rm -rf /work/build /work/java /work/python
linux-client:
runs-on: ubuntu-latest
needs: [test-mysql]
steps:
- uses: actions/checkout@v2
- uses: olegtarasov/get-tag@v2
id: tagName
- name: release latest linux client binary
env:
TRAVIS_OS_NAME: linux
QINIU_AK: ${{ secrets.QINIU_AK }}
QINIU_SK: ${{ secrets.QINIU_SK }}
run: |
source scripts/travis/actions_env2_travis.sh
export TRAVIS_BUILD_DIR=${{ github.workspace }}
export TRAVIS_TAG=${{ steps.tagName.outputs.tag }}
export TRAVIS_PULL_REQUEST=${{ github.event.number }}
bash scripts/travis/deploy_client.sh
bash scripts/travis/deploy_tutorials.sh
# TODO(typhoonzero): remove travis envs when we have moved to github actions completely
macos-client:
runs-on: macos-latest
needs: [test-mysql]
steps:
- uses: actions/checkout@v2
- uses: olegtarasov/get-tag@v2
id: tagName
- name: relase latest macos client binary
env:
TRAVIS_OS_NAME: osx
QINIU_AK: ${{ secrets.QINIU_AK }}
QINIU_SK: ${{ secrets.QINIU_SK }}
run: |
source scripts/travis/actions_env2_travis.sh
export TRAVIS_BUILD_DIR=${{ github.workspace }}
export TRAVIS_TAG=${{ steps.tagName.outputs.tag }}
export TRAVIS_PULL_REQUEST=${{ github.event.number }}
bash scripts/travis/deploy_client.sh
windows-client:
runs-on: windows-latest
needs: [test-mysql]
steps:
- uses: actions/checkout@v2
- uses: olegtarasov/get-tag@v2
id: tagName
- name: relase latest windows client binary
shell: bash
env:
TRAVIS_OS_NAME: windows
QINIU_AK: ${{ secrets.QINIU_AK }}
QINIU_SK: ${{ secrets.QINIU_SK }}
run: |
source scripts/travis/actions_env2_travis.sh
export TRAVIS_BUILD_DIR="${{ github.workspace }}"
export TRAVIS_TAG="${{ steps.tagName.outputs.tag }}"
export TRAVIS_PULL_REQUEST="${{ github.event.number }}"
scripts/travis/deploy_client.sh