Skip to content

fix: close file

fix: close file #1444

Workflow file for this run

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