Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
36 changes: 0 additions & 36 deletions .drone.yml

This file was deleted.

40 changes: 40 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
name: ci
on:
pull_request:
push:
branches:
- main
permissions:
contents: read
env:
GO_VERSION: 1.23
jobs:
tests:
runs-on: ubuntu-latest
services:
mysql:
image: mysql:8.0
env:
MYSQL_ALLOW_EMPTY_PASSWORD: yes
MYSQL_DATABASE: mysql
MYSQL_USER: mysql
MYSQL_PASSWORD: mysql
MYSQL_HOST: 127.0.0.1
ports:
- 3306:3306
options: --health-cmd="mysqladmin ping" --health-interval=10s --health-timeout=5s --health-retries=3
steps:
- name: checkout
uses: actions/checkout@v4
- name: setup Go environment
uses: actions/setup-go@v5
with:
go-version: ${{ env.GO_VERSION }}
cache-dependency-path: "**/*.sum"
- name: Test
run: go test -v ./...
- name: Integration tests
run: go test -v ./...
env:
INTEGRATION_TESTS: "true"
MYSQL_URL: "mysql:mysql@tcp(127.0.0.1:3306)/mysql"
3 changes: 1 addition & 2 deletions query_integration_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ import (
"context"
"database/sql"
"errors"
"log"
"os"
"strings"
"testing"
Expand Down Expand Up @@ -55,7 +54,7 @@ func TestQuery_MySQL(t *testing.T) {
// 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.
limit := 10
for i := 0; i < limit; i++ {
log.Println("Attempting mysql connection...")
t.Log("Attempting mysql connection...")
d, err := sql.Open("mysql", args.MySQLURL)
if err == nil {
if err := d.Ping(); err == nil {
Expand Down