forked from denodrivers/mysql
-
Notifications
You must be signed in to change notification settings - Fork 0
69 lines (66 loc) · 2.04 KB
/
ci.yml
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: ci
on: [push, pull_request]
jobs:
fmt:
runs-on: ubuntu-latest
continue-on-error: true
steps:
- uses: actions/checkout@v1
- name: Install Deno 1.x
uses: denoland/setup-deno@v1
with:
deno-version: v1.x
- name: Check fmt
run: deno fmt --check
test:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
DENO_VERSION:
- v1.x
DB_VERSION:
- mysql:5.5
- mysql:5.6
- mysql:5.7
- mysql:8
- mysql:latest
- mariadb:5.5
- mariadb:10.0
- mariadb:10.1
- mariadb:10.2
- mariadb:10.3
- mariadb:10.4
# - mariadb:latest
steps:
- uses: actions/checkout@v1
- name: Install Deno ${{ matrix.DENO_VERSION }}
uses: denoland/setup-deno@v1
with:
deno-version: ${{ matrix.DENO_VERSION }}
- name: Show Deno version
run: deno --version
- name: Start ${{ matrix.DB_VERSION }}
run: |
sudo mkdir -p /var/run/mysqld/tmp
sudo chmod -R 777 /var/run/mysqld
docker container run --name mysql --rm -d -p 3306:3306 \
-v /var/run/mysqld:/var/run/mysqld \
-v /var/run/mysqld/tmp:/tmp \
-e MYSQL_ROOT_PASSWORD=root \
${{ matrix.DB_VERSION }}
./.github/workflows/wait-for-mysql.sh
- name: Run tests (TCP)
run: |
deno test --allow-env --allow-net=127.0.0.1:3306 ./test.ts
- name: Run tests (--unstable) (UNIX domain socket)
run: |
SOCKPATH=/var/run/mysqld/mysqld.sock
if [[ "${{ matrix.DB_VERSION }}" == "mysql:5.5" ]]; then
SOCKPATH=/var/run/mysqld/tmp/mysql.sock
fi
echo "DROP USER 'root'@'localhost';" | docker exec -i mysql mysql -proot
DB_SOCKPATH=$SOCKPATH TEST_METHODS=unix \
deno test --unstable --allow-env \
--allow-read=/var/run/mysqld/ --allow-write=/var/run/mysqld/ \
./test.ts