forked from go-mysql-org/go-mysql
-
Notifications
You must be signed in to change notification settings - Fork 0
45 lines (41 loc) · 1.46 KB
/
ci.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
name: runTestsAndLinters
on: [push, pull_request]
jobs:
test:
strategy:
matrix:
go: [ 1.18, 1.17, 1.16, 1.15 ]
name: Tests Go ${{ matrix.go }}
runs-on: ubuntu-18.04
steps:
- name: Setup MySQL
run: |
echo -n "mysql -V: " ; mysql -V
echo -n "mysqldump -V: " ; mysqldump -V
echo -e '[mysqld]\nserver-id=1\nlog-bin=mysql\nbinlog-format=row\ngtid-mode=ON\nenforce_gtid_consistency=ON\n' | sudo tee /etc/mysql/conf.d/replication.cnf
sudo service mysql start
sudo mysql -h 127.0.0.1 -uroot -proot -e "use mysql; update user set authentication_string=PASSWORD('') where User='root'; update user set plugin='mysql_native_password'; FLUSH PRIVILEGES;"
# create ssl/rsa files for mysql ssl support
sudo mysql_ssl_rsa_setup --uid=mysql
mysql -e "CREATE DATABASE IF NOT EXISTS test;" -uroot
mysql -e "SHOW VARIABLES LIKE 'log_bin'" -uroot
- name: Prepare for Go
run: |
sudo apt-get install -y make gcc
- name: Install Go
uses: actions/setup-go@v2
with:
go-version: ${{ matrix.go }}
- name: Checkout code
uses: actions/checkout@v1
- name: Run tests
run: go test ./...
golangci:
name: golangci
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: golangci-lint
uses: golangci/golangci-lint-action@v2
with:
version: latest