-
-
Notifications
You must be signed in to change notification settings - Fork 0
65 lines (61 loc) · 2.35 KB
/
Copy pathci.yml
File metadata and controls
65 lines (61 loc) · 2.35 KB
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
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
name: CI
on:
push:
branches: [main]
pull_request:
permissions:
contents: read
jobs:
lint:
name: Lint
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
- uses: actions/setup-go@v6
with:
go-version: stable
cache: true
- uses: golangci/golangci-lint-action@v9
with:
version: v2.12.2
test:
name: Test (${{ matrix.os }})
needs: lint
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v6
- uses: actions/setup-go@v6
with:
go-version: stable
cache: true
- name: go vet
run: go vet ./...
# `./...` skips underscore-prefixed dirs, so name the _mysqlcommon package
# explicitly by import path to run its unit tests. Use the import path (not
# a `_*` shell glob) so it works on PowerShell (Windows) as well as bash.
- name: go test
run: go test ./... github.com/nixrajput/siphon/internal/driver/_mysqlcommon
# Integration tests use testcontainers, which needs a Docker daemon.
# Only ubuntu-latest runners have Docker available by default, so the
# DB client install and integration suite are scoped to Ubuntu.
# macOS/Windows run unit tests only (the integration-tagged files that
# shell out to the client binaries are tagged out of the unit build).
- name: Install DB client tools (integration, Ubuntu only)
if: matrix.os == 'ubuntu-latest'
run: |
sudo apt-get update
# postgresql-client -> pg_dump/pg_restore ; mysql-client -> mysqldump/mysql
sudo apt-get install -y postgresql-client mysql-client
# Ubuntu's mariadb-client Conflicts with mysql-client-core, so it can't
# co-install. Pull mariadb-dump/mariadb from MariaDB's official APT repo
# (the repo's mariadb-client is built to coexist with MySQL's client).
curl -fsSL https://r.mariadb.com/downloads/mariadb_repo_setup | sudo bash
sudo apt-get update
sudo apt-get install -y mariadb-client
- name: Integration tests (Ubuntu only — needs Docker)
if: matrix.os == 'ubuntu-latest'
run: go test -tags=integration ./... github.com/nixrajput/siphon/internal/driver/_mysqlcommon