-
-
Notifications
You must be signed in to change notification settings - Fork 65
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
4373502
commit b62724e
Showing
63 changed files
with
3,005 additions
and
1,955 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,69 +1,64 @@ | ||
name: ci | ||
|
||
on: [push, pull_request] | ||
on: | ||
push: | ||
branches: | ||
- master | ||
pull_request: | ||
branches: | ||
- master | ||
|
||
env: | ||
DENO_VERSION: vx.x.x | ||
|
||
jobs: | ||
fmt: | ||
check: | ||
name: Check format and lint | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: Clone repo | ||
uses: actions/checkout@v4 | ||
|
||
- name: Install deno | ||
uses: denoland/setup-deno@v1 | ||
with: | ||
deno-version: ${{env.DENO_VERSION}} | ||
|
||
- name: Check | ||
run: deno task check | ||
|
||
tests: | ||
name: Run tests | ||
runs-on: ubuntu-latest | ||
continue-on-error: true | ||
|
||
steps: | ||
- uses: actions/checkout@v1 | ||
- name: Install Deno 1.x | ||
- name: Clone repo | ||
uses: actions/checkout@v4 | ||
|
||
- name: Install deno | ||
uses: denoland/setup-deno@v1 | ||
with: | ||
deno-version: v1.x | ||
- name: Check fmt | ||
run: deno fmt --check | ||
test: | ||
deno-version: ${{env.DENO_VERSION}} | ||
|
||
- name: Test | ||
run: deno task test:ga | ||
|
||
publish: | ||
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 | ||
|
||
permissions: | ||
contents: read | ||
id-token: write | ||
|
||
steps: | ||
- uses: actions/checkout@v1 | ||
- name: Install Deno ${{ matrix.DENO_VERSION }} | ||
- name: Checkout | ||
uses: actions/checkout@v4 | ||
|
||
- name: Install deno | ||
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 | ||
deno-version: ${{env.DENO_VERSION}} | ||
|
||
- name: Publish (dry run) | ||
run: deno publish --dry-run |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
name: Publish | ||
|
||
on: | ||
release: | ||
types: [published] | ||
|
||
env: | ||
DENO_VERSION: vx.x.x | ||
|
||
jobs: | ||
publish: | ||
runs-on: ubuntu-latest | ||
|
||
permissions: | ||
contents: read | ||
id-token: write | ||
|
||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v4 | ||
|
||
- name: Set up Deno | ||
uses: denoland/setup-deno@v1 | ||
with: | ||
deno-version: ${{env.DENO_VERSION}} | ||
|
||
- name: Publish | ||
if: github.event_name == 'release' | ||
run: deno publish |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,4 +5,5 @@ mysql.log | |
docs | ||
.DS_Store | ||
.idea | ||
|
||
dbtmp | ||
tmp_test |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,86 @@ | ||
services: | ||
mysql: | ||
image: mysql:latest | ||
ports: | ||
- 3313:3306 | ||
pull_policy: always | ||
restart: always | ||
environment: | ||
MYSQL_ALLOW_EMPTY_PASSWORD: true | ||
MYSQL_DATABASE: testdb | ||
healthcheck: | ||
test: ["CMD", "mysqladmin", "ping", "-h", "localhost", "--user", "root"] | ||
interval: 3s | ||
timeout: 3s | ||
retries: 10 | ||
mysql5: | ||
image: mysql:5 | ||
platform: linux/amd64 | ||
ports: | ||
- 3311:3306 | ||
pull_policy: always | ||
restart: always | ||
environment: | ||
MYSQL_ALLOW_EMPTY_PASSWORD: true | ||
MYSQL_DATABASE: testdb | ||
healthcheck: | ||
test: ["CMD", "mysqladmin", "ping", "-h", "localhost", "--user", "root"] | ||
interval: 3s | ||
timeout: 3s | ||
retries: 10 | ||
mysql8: | ||
image: mysql:8 | ||
ports: | ||
- 3312:3306 | ||
pull_policy: always | ||
restart: always | ||
environment: | ||
MYSQL_ALLOW_EMPTY_PASSWORD: true | ||
MYSQL_DATABASE: testdb | ||
healthcheck: | ||
test: ["CMD", "mysqladmin", "ping", "-h", "localhost", "--user", "root"] | ||
interval: 3s | ||
timeout: 3s | ||
retries: 10 | ||
mariadb: | ||
image: mariadb:latest | ||
ports: | ||
- 3316:3306 | ||
pull_policy: always | ||
restart: always | ||
environment: | ||
MARIADB_ALLOW_EMPTY_ROOT_PASSWORD: true | ||
MARIADB_DATABASE: testdb | ||
healthcheck: | ||
test: ["CMD", "mariadb-admin", "ping", "-h", "127.0.0.1"] | ||
interval: 3s | ||
timeout: 3s | ||
retries: 10 | ||
mariadb10: | ||
image: mariadb:10 | ||
ports: | ||
- 3314:3306 | ||
pull_policy: always | ||
restart: always | ||
environment: | ||
MARIADB_ALLOW_EMPTY_ROOT_PASSWORD: true | ||
MARIADB_DATABASE: testdb | ||
healthcheck: | ||
test: ["CMD", "mariadb-admin", "ping", "-h", "127.0.0.1"] | ||
interval: 3s | ||
timeout: 3s | ||
retries: 10 | ||
mariadb11: | ||
image: mariadb:11 | ||
ports: | ||
- 3315:3306 | ||
pull_policy: always | ||
restart: always | ||
environment: | ||
MARIADB_ALLOW_EMPTY_ROOT_PASSWORD: true | ||
MARIADB_DATABASE: testdb | ||
healthcheck: | ||
test: ["CMD", "mariadb-admin", "ping", "-h", "127.0.0.1"] | ||
interval: 3s | ||
timeout: 3s | ||
retries: 10 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
{ | ||
"name": "@db/mysql", | ||
"version": "2.12.2", | ||
"exports": "./mod.ts", | ||
"lock": false, | ||
"tasks": { | ||
"check": "deno task format:check && deno task lint:check && deno task type:check", | ||
"lint:check": "deno lint", | ||
"format:check": "deno fmt --check", | ||
"type:check": "deno check mod.ts", | ||
"doc:check": "deno doc --lint src", | ||
"test": "deno task db:restart && deno test -A; deno task db:stop", | ||
"test:ga": "deno task db:start && deno test -A && deno task db:stop", | ||
"db:restart": "deno task db:stop && deno task db:start", | ||
"db:start": "docker compose up -d --remove-orphans --wait && sleep 2", | ||
"db:stop": "docker compose down --remove-orphans --volumes" | ||
}, | ||
"imports": { | ||
"@halvardm/sqlx": "jsr:@halvardm/sqlx@0.0.0-13", | ||
"@std/assert": "jsr:@std/assert@^0.221.0", | ||
"@std/async": "jsr:@std/async@^0.221.0", | ||
"@std/crypto": "jsr:@std/crypto@^0.221.0", | ||
"@std/encoding": "jsr:@std/encoding@^0.221.0", | ||
"@std/flags": "jsr:@std/flags@^0.221.0", | ||
"@std/fmt": "jsr:@std/fmt@^0.221.0", | ||
"@std/fs": "jsr:@std/fs@^0.222.1", | ||
"@std/log": "jsr:@std/log@^0.221.0", | ||
"@std/path": "jsr:@std/path@^0.222.1", | ||
"@std/semver": "jsr:@std/semver@^0.220.1", | ||
"@std/testing": "jsr:@std/testing@^0.221.0", | ||
"@std/text": "jsr:@std/text@^0.222.1", | ||
"@std/yaml": "jsr:@std/yaml@^0.223.0", | ||
"@stdext/encoding": "jsr:@stdext/encoding@^0.0.2" | ||
} | ||
} |
Oops, something went wrong.