-
Notifications
You must be signed in to change notification settings - Fork 346
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'WikiRik/Node-16-18' into main
- Loading branch information
Showing
56 changed files
with
5,145 additions
and
277 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,124 +1,73 @@ | ||
name: CI | ||
on: [pull_request] | ||
on: | ||
pull_request: | ||
|
||
env: | ||
SEQ_DB: sequelize_test | ||
SEQ_USER: sequelize_test | ||
SEQ_PW: sequelize_test | ||
# This configuration cancels previous runs if a new run is started on the same PR. Only one run at a time per PR. | ||
# from https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#example-using-a-fallback-value | ||
concurrency: | ||
group: ${{ github.head_ref || github.run_id }} | ||
cancel-in-progress: true | ||
|
||
jobs: | ||
test-sqlite: | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
# node 10 is the minimum supported version for Sequelize 6 | ||
# node 14 is the minimum supported version for Sequelize 7 | ||
# node 16 is latest LTS (to keep updated) | ||
node: [10, 14, 16] | ||
name: SQLite (sequelize 6 & 7, node ${{ matrix.node }}) | ||
node-version: [10, 18, 20] | ||
name: sqlite (Node ${{ matrix.node-version }}) | ||
runs-on: ubuntu-latest | ||
env: | ||
DIALECT: sqlite | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- uses: actions/setup-node@v1 | ||
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1 | ||
- uses: actions/setup-node@60edb5dd545a775178f52524783378180af0d1f8 # v4.0.2 | ||
with: | ||
node-version: 14.x | ||
- run: /bin/bash ./setup/prepare-ci.sh | ||
node-version: ${{ matrix.node-version }} | ||
cache: yarn | ||
- run: /bin/bash ./dev/prepare-ci.sh | ||
- name: Execute SSCCE | ||
run: npm run _test | ||
run: yarn run _test | ||
test-postgres: | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
postgres-version: [9.5, 10] # Does not work with 12 | ||
node-version: [10, 18, 20] | ||
postgres-version: [oldest, latest] | ||
minify-aliases: [true, false] | ||
native: [true, false] | ||
node: [10, 14, 16] | ||
name: Postgres ${{ matrix.postgres-version }}${{ matrix.native && ' (native)' || '' }} (sequelize 6 & 7, node ${{ matrix.node }}) | ||
name: postgres ${{ matrix.postgres-version }}${{ matrix.native && ' (native)' || '' }} (Node ${{ matrix.node-version }})${{ matrix.minify-aliases && ' (minified aliases)' || '' }} | ||
runs-on: ubuntu-latest | ||
services: | ||
postgres: | ||
image: sushantdhiman/postgres:${{ matrix.postgres-version }} | ||
env: | ||
POSTGRES_USER: sequelize_test | ||
POSTGRES_DB: sequelize_test | ||
POSTGRES_PASSWORD: sequelize_test | ||
ports: | ||
- 5432:5432 | ||
options: --health-cmd pg_isready --health-interval 10s --health-timeout 5s --health-retries 5 | ||
env: | ||
DIALECT: ${{ matrix.native && 'postgres-native' || 'postgres' }} | ||
SEQ_PG_MINIFY_ALIASES: ${{ matrix.minify-aliases && '1' || '' }} | ||
steps: | ||
- run: PGPASSWORD=sequelize_test psql -h localhost -p 5432 -U sequelize_test sequelize_test -c '\l' | ||
- uses: actions/checkout@v2 | ||
- uses: actions/setup-node@v3 | ||
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1 | ||
- uses: actions/setup-node@60edb5dd545a775178f52524783378180af0d1f8 # v4.0.2 | ||
with: | ||
node-version: ${{ matrix.node }} | ||
- run: /bin/bash ./setup/prepare-ci.sh | ||
node-version: ${{ matrix.node-version }} | ||
cache: yarn | ||
- run: /bin/bash ./dev/prepare-ci.sh | ||
- run: yarn start-postgres-${{ matrix.postgres-version }} | ||
- name: Execute SSCCE | ||
run: npm run _test | ||
test-mysql-mariadb: | ||
run: yarn run _test | ||
test-oldest-latest: | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
node: [10, 14, 16] | ||
db: | ||
- '{ name: "MySQL 5.7", image: "mysql:5.7", dialect: "mysql" }' | ||
- '{ name: "MariaDB 10.3", image: "mariadb:10.3", dialect: "mariadb" }' | ||
name: ${{ fromJson(matrix.db).name }} (node ${{ matrix.node }}) | ||
node-version: [10, 18, 20] | ||
database-version: [oldest, latest] | ||
dialect: [mysql, mariadb, mssql] | ||
name: ${{ matrix.dialect }} ${{ matrix.database-version }} (Node ${{ matrix.node-version }}) | ||
runs-on: ubuntu-latest | ||
services: | ||
mysql: | ||
image: ${{ fromJson(matrix.db).image }} | ||
env: | ||
MYSQL_DATABASE: sequelize_test | ||
MYSQL_USER: sequelize_test | ||
MYSQL_PASSWORD: sequelize_test | ||
MYSQL_ROOT_PASSWORD: sequelize_test | ||
ports: | ||
- 3306:3306 | ||
options: --health-cmd="mysqladmin -usequelize_test -psequelize_test status" --health-interval 10s --health-timeout 5s --health-retries 5 --tmpfs /var/lib/mysql:rw | ||
env: | ||
DIALECT: ${{ fromJson(matrix.db).dialect }} | ||
DIALECT: ${{ matrix.dialect }} | ||
steps: | ||
- run: mysql --host 127.0.0.1 --port 3306 -uroot -psequelize_test -e "GRANT ALL ON *.* TO 'sequelize_test'@'%' with grant option; FLUSH PRIVILEGES;" | ||
- uses: actions/checkout@v2 | ||
- uses: actions/setup-node@v3 | ||
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1 | ||
- uses: actions/setup-node@60edb5dd545a775178f52524783378180af0d1f8 # v4.0.2 | ||
with: | ||
node-version: ${{ matrix.node }} | ||
- run: /bin/bash ./setup/prepare-ci.sh | ||
node-version: ${{ matrix.node-version }} | ||
cache: yarn | ||
- run: /bin/bash ./dev/prepare-ci.sh | ||
- run: yarn start-${{ matrix.dialect }}-${{ matrix.database-version }} | ||
- name: Execute SSCCE | ||
run: npm run _test | ||
test-mssql: | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
node: [10, 14, 16] | ||
mssql-version: [2017, 2019] | ||
name: MSSQL ${{ matrix.mssql-version }} (sequelize 6 & 7, node ${{ matrix.node }}) | ||
runs-on: ubuntu-latest | ||
services: | ||
mssql: | ||
image: mcr.microsoft.com/mssql/server:${{ matrix.mssql-version }}-latest | ||
env: | ||
ACCEPT_EULA: Y | ||
SA_PASSWORD: Password12! | ||
ports: | ||
- 1433:1433 | ||
options: >- | ||
--health-cmd="/opt/mssql-tools/bin/sqlcmd -S localhost -U SA -P "Password12!" -l 30 -Q \"SELECT 1\" || exit 1" | ||
--health-start-period 10s | ||
--health-interval 10s | ||
--health-timeout 5s | ||
--health-retries 10 | ||
env: | ||
DIALECT: mssql | ||
steps: | ||
- run: /opt/mssql-tools/bin/sqlcmd -S localhost -U SA -P "Password12!" -Q "CREATE DATABASE sequelize_test; ALTER DATABASE sequelize_test SET READ_COMMITTED_SNAPSHOT ON;" | ||
- uses: actions/checkout@v2 | ||
- uses: actions/setup-node@v3 | ||
with: | ||
node-version: ${{ matrix.node }} | ||
- run: /bin/bash ./setup/prepare-ci.sh | ||
- name: Execute SSCCE | ||
run: npm run _test | ||
run: yarn run _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 |
---|---|---|
@@ -1,4 +1,28 @@ | ||
node_modules | ||
npm-debug.log | ||
yarn.lock | ||
*.swp | ||
.idea | ||
.DS_STORE | ||
npm-debug.log* | ||
*~ | ||
test.sqlite | ||
test.sqlite2 | ||
*.sublime* | ||
package-lock.json | ||
pnpm-lock.yaml | ||
|
||
.nyc_output | ||
coverage-* | ||
coverage | ||
tmp | ||
.vscode/ | ||
.typedoc-build | ||
node_modules | ||
*.log | ||
/.nx | ||
|
||
.pnp.* | ||
.yarn/* | ||
!.yarn/patches | ||
!.yarn/plugins | ||
!.yarn/releases | ||
!.yarn/sdks | ||
!.yarn/versions |
This file was deleted.
Oops, something went wrong.
File renamed without changes.
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,72 @@ | ||
const { env } = process; | ||
|
||
export const CiDbConfigs = { | ||
mssql: { | ||
host: env.SEQ_MSSQL_HOST || env.SEQ_HOST || 'localhost', | ||
username: env.SEQ_MSSQL_USER || env.SEQ_USER || 'SA', | ||
password: env.SEQ_MSSQL_PW || env.SEQ_PW || 'Password12!', | ||
port: env.SEQ_MSSQL_PORT || env.SEQ_PORT || 22_019, | ||
database: env.SEQ_MSSQL_DB || env.SEQ_DB || 'sequelize_test', | ||
dialectOptions: { | ||
options: { | ||
encrypt: false, | ||
requestTimeout: 25_000, | ||
}, | ||
}, | ||
pool: { | ||
max: Number(env.SEQ_MSSQL_POOL_MAX || env.SEQ_POOL_MAX || 5), | ||
idle: Number(env.SEQ_MSSQL_POOL_IDLE || env.SEQ_POOL_IDLE || 3000), | ||
}, | ||
}, | ||
|
||
mysql: { | ||
database: env.SEQ_MYSQL_DB || env.SEQ_DB || 'sequelize_test', | ||
username: env.SEQ_MYSQL_USER || env.SEQ_USER || 'sequelize_test', | ||
password: env.SEQ_MYSQL_PW || env.SEQ_PW || 'sequelize_test', | ||
host: env.MYSQL_PORT_3306_TCP_ADDR || env.SEQ_MYSQL_HOST || env.SEQ_HOST || '127.0.0.1', | ||
port: env.MYSQL_PORT_3306_TCP_PORT || env.SEQ_MYSQL_PORT || env.SEQ_PORT || 20_057, | ||
pool: { | ||
max: Number(env.SEQ_MYSQL_POOL_MAX || env.SEQ_POOL_MAX || 5), | ||
idle: Number(env.SEQ_MYSQL_POOL_IDLE || env.SEQ_POOL_IDLE || 3000), | ||
}, | ||
}, | ||
|
||
snowflake: { | ||
username: env.SEQ_SNOWFLAKE_USER || env.SEQ_USER || 'root', | ||
password: env.SEQ_SNOWFLAKE_PW || env.SEQ_PW || '', | ||
database: env.SEQ_SNOWFLAKE_DB || env.SEQ_DB || 'sequelize_test', | ||
dialectOptions: { | ||
account: env.SEQ_SNOWFLAKE_ACCOUNT || env.SEQ_ACCOUNT || 'sequelize_test', | ||
role: env.SEQ_SNOWFLAKE_ROLE || env.SEQ_ROLE || 'role', | ||
warehouse: env.SEQ_SNOWFLAKE_WH || env.SEQ_WH || 'warehouse', | ||
schema: env.SEQ_SNOWFLAKE_SCHEMA || env.SEQ_SCHEMA || '', | ||
}, | ||
}, | ||
|
||
mariadb: { | ||
database: env.SEQ_MARIADB_DB || env.SEQ_DB || 'sequelize_test', | ||
username: env.SEQ_MARIADB_USER || env.SEQ_USER || 'sequelize_test', | ||
password: env.SEQ_MARIADB_PW || env.SEQ_PW || 'sequelize_test', | ||
host: env.MARIADB_PORT_3306_TCP_ADDR || env.SEQ_MARIADB_HOST || env.SEQ_HOST || '127.0.0.1', | ||
port: env.MARIADB_PORT_3306_TCP_PORT || env.SEQ_MARIADB_PORT || env.SEQ_PORT || 21_103, | ||
pool: { | ||
max: Number(env.SEQ_MARIADB_POOL_MAX || env.SEQ_POOL_MAX || 5), | ||
idle: Number(env.SEQ_MARIADB_POOL_IDLE || env.SEQ_POOL_IDLE || 3000), | ||
}, | ||
}, | ||
|
||
sqlite: {}, | ||
|
||
postgres: { | ||
database: env.SEQ_PG_DB || env.SEQ_DB || 'sequelize_test', | ||
username: env.SEQ_PG_USER || env.SEQ_USER || 'sequelize_test', | ||
password: env.SEQ_PG_PW || env.SEQ_PW || 'sequelize_test', | ||
host: env.POSTGRES_PORT_5432_TCP_ADDR || env.SEQ_PG_HOST || env.SEQ_HOST || '127.0.0.1', | ||
port: env.POSTGRES_PORT_5432_TCP_PORT || env.SEQ_PG_PORT || env.SEQ_PORT || 23_010, | ||
pool: { | ||
max: Number(env.SEQ_PG_POOL_MAX || env.SEQ_POOL_MAX || 5), | ||
idle: Number(env.SEQ_PG_POOL_IDLE || env.SEQ_POOL_IDLE || 3000), | ||
}, | ||
minifyAliases: Boolean(env.SEQ_PG_MINIFY_ALIASES), | ||
}, | ||
}; |
File renamed without changes.
File renamed without changes.
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
File renamed without changes.
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,26 @@ | ||
services: | ||
mariadb-latest: | ||
container_name: sequelize-mariadb-latest | ||
image: mariadb:11.2.2 | ||
environment: | ||
MYSQL_DATABASE: sequelize_test | ||
MYSQL_USER: sequelize_test | ||
MYSQL_PASSWORD: sequelize_test | ||
MYSQL_ROOT_PASSWORD: sequelize_test | ||
ports: | ||
- 21103:3306 | ||
volumes: | ||
- mariadb-latest:/var/lib/mysql | ||
healthcheck: | ||
test: ["CMD", "mariadb-admin", "-usequelize_test", "-psequelize_test", "status"] | ||
interval: 3s | ||
timeout: 1s | ||
retries: 10 | ||
|
||
networks: | ||
default: | ||
name: sequelize-mariadb-latest-network | ||
|
||
volumes: | ||
mariadb-latest: | ||
name: sequelize-mariadb-latest-volume |
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
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,13 @@ | ||
#!/usr/bin/env bash | ||
set -Eeuxo pipefail # https://vaneyckt.io/posts/safer_bash_scripts_with_set_euxo_pipefail/ | ||
cd -P -- "$(dirname -- "${BASH_SOURCE[0]}")" # https://stackoverflow.com/a/17744637 | ||
|
||
docker compose -p sequelize-mariadb-latest down --remove-orphans | ||
docker compose -p sequelize-mariadb-latest up -d | ||
|
||
./../../wait-until-healthy.sh sequelize-mariadb-latest | ||
|
||
docker exec sequelize-mariadb-latest \ | ||
mariadb --host 127.0.0.1 --port 3306 -uroot -psequelize_test -e "GRANT ALL ON *.* TO 'sequelize_test'@'%' with grant option; FLUSH PRIVILEGES;" | ||
|
||
DIALECT=mariadb ts-node ../../check-connection.ts |
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,7 @@ | ||
#!/usr/bin/env bash | ||
set -Eeuxo pipefail # https://vaneyckt.io/posts/safer_bash_scripts_with_set_euxo_pipefail/ | ||
cd -P -- "$(dirname -- "${BASH_SOURCE[0]}")" # https://stackoverflow.com/a/17744637 | ||
|
||
docker compose -p sequelize-mariadb-latest down --remove-orphans | ||
|
||
echo "Local latest supported MariaDB instance stopped (if it was running)." |
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,26 @@ | ||
services: | ||
mariadb-oldest: | ||
container_name: sequelize-mariadb-oldest | ||
image: mariadb:10.4.30 | ||
environment: | ||
MYSQL_DATABASE: sequelize_test | ||
MYSQL_USER: sequelize_test | ||
MYSQL_PASSWORD: sequelize_test | ||
MYSQL_ROOT_PASSWORD: sequelize_test | ||
ports: | ||
- 21103:3306 | ||
volumes: | ||
- mariadb-oldest:/var/lib/mysql | ||
healthcheck: | ||
test: ["CMD", "mariadb-admin", "-usequelize_test", "-psequelize_test", "status"] | ||
interval: 3s | ||
timeout: 1s | ||
retries: 10 | ||
|
||
networks: | ||
default: | ||
name: sequelize-mariadb-oldest-network | ||
|
||
volumes: | ||
mariadb-oldest: | ||
name: sequelize-mariadb-oldest-volume |
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
Oops, something went wrong.