77jobs :
88 test :
99 strategy :
10- fail-fast : false
10+ fail-fast : true
1111 matrix :
1212 go-version : [ '1.13', '1.14', '1.15', '1.16', '1.17', '1.18', '1.19', '1.20']
1313 runs-on : ubuntu-latest
4242 - name : go mod tidy
4343 run : go mod tidy
4444 - name : check for any changes
45- run : >
45+ run : |
4646 [[ $(git status --porcelain) == "" ]] || (echo "changes detected" && exit 1)
47+ integration :
48+ needs :
49+ - test
50+ - lint
51+ runs-on : ubuntu-latest
52+ strategy :
53+ fail-fast : true
54+ matrix :
55+ go-version : [ '1.13', '1.14', '1.15', '1.16', '1.17', '1.18', '1.19', '1.20']
56+ services :
57+ mysql :
58+ image : mysql:8.0
59+ env :
60+ MYSQL_ALLOW_EMPTY_PASSWORD : ' 1'
61+ MYSQL_ROOT_PASSWORD : ' '
62+ MYSQL_DATABASE : ' test'
63+ ports :
64+ - 3306:3306
65+ options : >-
66+ --health-cmd="mysqladmin ping"
67+ --health-interval=10s
68+ --health-timeout=5s
69+ --health-retries=3
70+ postgres :
71+ image : postgres:15
72+ env :
73+ POSTGRES_PASSWORD : ' password'
74+ ports :
75+ - 5432:5432
76+ options : >-
77+ --health-cmd pg_isready
78+ --health-interval 10s
79+ --health-timeout 5s
80+ --health-retries 5
81+ env :
82+ MYSQL_HOST : ' 127.0.0.1'
83+ PGHOST : ' 127.0.0.1'
84+ PGUSER : ' postgres'
85+ PGPASSWORD : ' password'
86+ steps :
87+ - name : checkout
88+ uses : actions/checkout@v3
89+ - name : setup-go
90+ uses : actions/setup-go@v4
91+ with :
92+ go-version : ${{ matrix.go-version }}
93+ cache : true
94+ cache-dependency-path : go.sum
95+ - name : setup databases
96+ run : |
97+ mysql --user=root -e 'CREATE DATABASE IF NOT EXISTS test;'
98+ mysql --user=root -e 'CREATE DATABASE IF NOT EXISTS test_env;'
99+ psql -U postgres -c 'CREATE DATABASE test;'
100+ - name : install sql-migrate
101+ run : go install ./...
102+ - name : postgres
103+ run : bash ./test-integration/postgres.sh
104+ - name : mysql
105+ run : bash ./test-integration/mysql.sh
106+ - name : mysql-flag
107+ run : bash ./test-integration/mysql-flag.sh
108+ - name : mysql-env
109+ run : bash ./test-integration/mysql-env.sh
110+ - name : sqlite
111+ run : bash ./test-integration/sqlite.sh
0 commit comments