增加在SQL审核阶段自动识别并合并相同表的alter table语句的功能 #598
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Go | |
on: | |
push: | |
branches: | |
- master | |
- release/* | |
pull_request: | |
types: [opened, synchronize, reopened] | |
jobs: | |
build: | |
name: Build | |
runs-on: ubuntu-20.04 | |
steps: | |
- name: Stop default MySQL | |
run: | | |
sudo systemctl stop mysql | |
- uses: actions/checkout@v3 | |
with: | |
# Disabling shallow clone is recommended for improving relevancy of reporting | |
fetch-depth: 0 | |
- name: Install MySQL Service | |
uses: shogo82148/actions-setup-mysql@v1 | |
with: | |
mysql-version: "5.7" | |
root-password: "root" | |
my-cnf: | | |
[mysqld] | |
innodb_log_file_size=256MB | |
innodb_buffer_pool_size=512MB | |
max_allowed_packet=16MB | |
max_connections=500 | |
log-bin=1 | |
server_id=222 | |
innodb-large-prefix=1 | |
character_set_server=utf8mb4 | |
lower_case_table_names=1 | |
binlog-format = row | |
gtid-mode = ON | |
enforce_gtid_consistency = ON | |
- run: mysql -uroot -p'root' -e 'SELECT version()' | |
- name: Show MySQL Variables | |
run: mysql -uroot -p'root' -e "show variables where Variable_name in ('server_id','log_bin','lower_case_table_names','version');" | |
- name: Init MySQL Database and User | |
run: | | |
export MYSQL_PWD=root | |
mysql -uroot -e "create database if not exists test DEFAULT CHARACTER SET utf8;create database if not exists test_inc DEFAULT CHARACTER SET utf8;create user test@'127.0.0.1' identified by 'test';" | |
mysql -uroot -e "grant all on *.* to test@'127.0.0.1';FLUSH PRIVILEGES;" | |
mysql -uroot -p'root' -e "show databases;show variables like 'explicit_defaults_for_timestamp';" | |
- name: Waiting for MySQL to be ready | |
run: | | |
sleep 2 | |
for i in `seq 1 10`; | |
do | |
nc -z 127.0.0.1 3306 && echo Success && exit 0 | |
echo -n . | |
sleep 2 | |
done | |
echo Failed waiting for MySQL && exit 1 | |
- name: Set up Go | |
uses: actions/setup-go@v2 | |
with: | |
go-version: 1.22.1 | |
id: go | |
- name: Check out code | |
uses: actions/checkout@v2 | |
- name: Install pt-online-schema-change | |
run: | | |
sudo cp ./bin/pt-online-schema-change /usr/local/bin/pt-online-schema-change | |
sudo chmod +x /usr/local/bin/pt-online-schema-change | |
sudo apt-get install libdbi-perl libdbd-mysql-perl | |
- name: Install gh-ost | |
run: | | |
sudo wget -O gh-ost.tar.gz https://github.com/github/gh-ost/releases/download/v1.1.0/gh-ost-binary-linux-20200828140552.tar.gz | |
sudo tar -zxvf gh-ost.tar.gz -C /usr/local/bin/ | |
sudo chmod +x /usr/local/bin/gh-ost | |
- name: "Build & Test" | |
run: | | |
# rm -f go.sum | |
sudo chmod +x cmd/explaintest/run-tests.sh | |
make checklist gotest | |
# - name: Analyze with SonarCloud | |
# uses: sonarsource/sonarcloud-github-action@master | |
# env: | |
# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
# SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} | |
# - name: Send coverage | |
# env: | |
# TRAVIS_COVERAGE: 1 | |
# GOVERALLS_SERVICE: 1 | |
# COVERALLS_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
# run: make dev upload-coverage |