-
Notifications
You must be signed in to change notification settings - Fork 547
69 lines (65 loc) · 2.38 KB
/
dest_mysql.yml
File metadata and controls
69 lines (65 loc) · 2.38 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
66
67
68
69
name: Destination Plugin MySQL Workflow
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
on:
pull_request:
paths:
- "plugins/destination/mysql/**"
- ".github/workflows/dest_mysql.yml"
push:
branches:
- main
paths:
- "plugins/destination/mysql/**"
- ".github/workflows/dest_mysql.yml"
permissions:
contents: read
jobs:
plugins-destination-mysql:
timeout-minutes: 30
name: "plugins/destination/mysql"
runs-on: ubuntu-latest
defaults:
run:
working-directory: ./plugins/destination/mysql
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6
with:
fetch-depth: 2
- name: Set up Go 1.x
id: setup-go
uses: actions/setup-go@4a3601121dd01d1626a1e23e37211e3254c1c06c # v6
with:
go-version-file: plugins/destination/mysql/go.mod
cache: false
- uses: actions/cache@668228422ae6a00e4ad889ee87cd7109ec5666a7 # v5
with:
path: |
~/.cache/go-build
~/go/pkg/mod
key: ${{ runner.os }}-go-${{ steps.setup-go.outputs.go-version }}-test-destination-mysql-${{ hashFiles('plugins/destination/mysql/go.sum') }}
restore-keys: |
${{ runner.os }}-go-${{ steps.setup-go.outputs.go-version }}-test-destination-mysql-
- name: golangci-lint
uses: golangci/golangci-lint-action@1e7e51e771db61008b38414a730f564565cf7c20 # v9
with:
version: v2.11.4
working-directory: plugins/destination/mysql
args: "--config ../../.golangci.yml"
- name: gen
if: github.event_name == 'pull_request'
run: make gen
- name: Fail if generation updated files
if: github.event_name == 'pull_request'
run: test "$(git status -s | wc -l)" -eq 0 || (git status -s; exit 1)
- name: Build
run: go build .
# We don't use services as we need to pass additional arguments to the container
- name: Spin up MySQL
run: |
docker run --platform linux/amd64 -p 3306:3306 --name mysql -e MYSQL_ROOT_PASSWORD=test -e MYSQL_DATABASE=cloudquery -d mysql:8.0 --innodb_log_file_size=512M --innodb_strict_mode=0
sudo apt update && sudo apt install wait-for-it -y
wait-for-it -h localhost -p 3306
- name: Test MySQL
run: make test