Skip to content

Commit f2dcaa2

Browse files
authored
drone to github actions migration (#143)
* base migration * enable verbose log
1 parent 8c88d65 commit f2dcaa2

File tree

3 files changed

+41
-38
lines changed

3 files changed

+41
-38
lines changed

.drone.yml

Lines changed: 0 additions & 36 deletions
This file was deleted.

.github/workflows/ci.yml

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
name: ci
2+
on:
3+
pull_request:
4+
push:
5+
branches:
6+
- main
7+
permissions:
8+
contents: read
9+
env:
10+
GO_VERSION: 1.23
11+
jobs:
12+
tests:
13+
runs-on: ubuntu-latest
14+
services:
15+
mysql:
16+
image: mysql:8.0
17+
env:
18+
MYSQL_ALLOW_EMPTY_PASSWORD: yes
19+
MYSQL_DATABASE: mysql
20+
MYSQL_USER: mysql
21+
MYSQL_PASSWORD: mysql
22+
MYSQL_HOST: 127.0.0.1
23+
ports:
24+
- 3306:3306
25+
options: --health-cmd="mysqladmin ping" --health-interval=10s --health-timeout=5s --health-retries=3
26+
steps:
27+
- name: checkout
28+
uses: actions/checkout@v4
29+
- name: setup Go environment
30+
uses: actions/setup-go@v5
31+
with:
32+
go-version: ${{ env.GO_VERSION }}
33+
cache-dependency-path: "**/*.sum"
34+
- name: Test
35+
run: go test -v ./...
36+
- name: Integration tests
37+
run: go test -v ./...
38+
env:
39+
INTEGRATION_TESTS: "true"
40+
MYSQL_URL: "mysql:mysql@tcp(127.0.0.1:3306)/mysql"

query_integration_test.go

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@ import (
44
"context"
55
"database/sql"
66
"errors"
7-
"log"
87
"os"
98
"strings"
109
"testing"
@@ -55,7 +54,7 @@ func TestQuery_MySQL(t *testing.T) {
5554
// Attempt to connect multiple times because these tests are ran in Drone, where the mysql server may not be immediately available when this test is ran.
5655
limit := 10
5756
for i := 0; i < limit; i++ {
58-
log.Println("Attempting mysql connection...")
57+
t.Log("Attempting mysql connection...")
5958
d, err := sql.Open("mysql", args.MySQLURL)
6059
if err == nil {
6160
if err := d.Ping(); err == nil {

0 commit comments

Comments
 (0)