tweaks #4
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
name: CI | |
on: | |
push: | |
branches: | |
- v6 | |
pull_request: | |
env: | |
SEQ_DB: sequelize_test | |
SEQ_USER: sequelize_test | |
SEQ_PW: sequelize_test | |
jobs: | |
lint: | |
name: Lint code and docs | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- uses: actions/setup-node@v3 | |
with: | |
node-version: 18.x | |
- run: yarn global add node-gyp --ignore-engines | |
- run: yarn install --frozen-lockfile --ignore-engines | |
- run: yarn lint | |
- run: yarn lint-docs | |
docs: | |
name: Generate docs | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- uses: actions/setup-node@v3 | |
with: | |
node-version: 18.x | |
- run: yarn global add node-gyp --ignore-engines | |
- run: yarn install --frozen-lockfile --ignore-engines | |
- run: yarn docs | |
test-typings: | |
strategy: | |
fail-fast: false | |
matrix: | |
ts-version: ["4.1", "4.2", "4.3", "4.4", "4.5", "4.6", "4.7", "4.8", "4.9", "5.0", "5.1", "5.2"] | |
name: TS Typings (${{ matrix.ts-version }}) | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- uses: actions/setup-node@v3 | |
with: | |
node-version: 18.x | |
- run: yarn global add node-gyp --ignore-engines | |
- run: yarn install --frozen-lockfile --ignore-engines | |
- run: yarn add --dev typescript@~${{ matrix.ts-version }} --ignore-engines | |
- run: yarn test-typings | |
test-oracle: | |
strategy: | |
fail-fast: false | |
matrix: | |
oracle-version: [18, 21] | |
node-version: [10, 18] | |
name: Oracle DB ${{ matrix.oracle-version }} (Node ${{ matrix.node-version }}) | |
runs-on: ubuntu-latest | |
env: | |
DIALECT: oracle | |
SEQ_ORACLE_USER: sequelizetest | |
SEQ_ORACLE_PW: sequelizepassword | |
SEQ_ORACLE_DB: XEPDB1 | |
SEQ_ORACLE_HOST: localhost | |
SEQ_ORACLE_PORT: 1521 | |
LD_LIBRARY_PATH: ${{ github.workspace }}/.oracle/instantclient | |
UV_THREADPOOL_SIZE: 128 | |
steps: | |
- uses: actions/checkout@v3 | |
- uses: actions/setup-node@v3 | |
with: | |
node-version: ${{ matrix.node-version }} | |
- run: yarn global add node-gyp --ignore-engines | |
- run: yarn install --frozen-lockfile --ignore-engines | |
- if: matrix.oracle-version == '18' | |
name: Install Local Oracle DB 18 | |
run: yarn start-oracle-oldest | |
- if: matrix.oracle-version == '21' | |
name: Install Local Oracle DB 21 | |
run: yarn start-oracle-latest | |
- name: Unit Tests | |
run: yarn test-unit | |
- name: Integration Tests | |
run: yarn test-integration | |
test-db2: | |
strategy: | |
fail-fast: false | |
matrix: | |
node-version: [10, 18] | |
name: DB2 (Node ${{ matrix.node-version }}) | |
runs-on: ubuntu-latest | |
env: | |
DIALECT: db2 | |
SEQ_DB: testdb | |
SEQ_USER: db2inst1 | |
SEQ_PW: password | |
SEQ_TEST_CLEANUP_TIMEOUT: 1200000 | |
SEQ_PORT: 50000 | |
steps: | |
- uses: actions/checkout@v3 | |
- uses: actions/setup-node@v3 | |
with: | |
node-version: ${{ matrix.node-version }} | |
- run: yarn global add node-gyp --ignore-engines | |
- run: yarn install --frozen-lockfile --ignore-engines | |
- name: Install Local DB2 Copy | |
run: yarn start-db2 | |
- name: Unit Tests | |
run: yarn test-unit | |
continue-on-error: true | |
- name: Integration Tests | |
run: yarn test-integration | |
continue-on-error: true | |
test-sqlite: | |
strategy: | |
fail-fast: false | |
matrix: | |
node-version: [10, 18] | |
name: SQLite (Node ${{ matrix.node-version }}) | |
runs-on: ubuntu-latest | |
env: | |
DIALECT: sqlite | |
steps: | |
- uses: actions/checkout@v3 | |
- uses: actions/setup-node@v3 | |
with: | |
node-version: ${{ matrix.node-version }} | |
- run: yarn global add node-gyp --ignore-engines | |
- run: yarn install --frozen-lockfile --ignore-engines | |
- name: Unit Tests | |
run: yarn test-unit | |
- name: Integration Tests | |
run: yarn test-integration | |
test-postgres: | |
strategy: | |
fail-fast: false | |
matrix: | |
node-version: [10, 18] | |
postgres-version: [9.5, 10] # Does not work with 12 | |
minify-aliases: [true, false] | |
native: [true, false] | |
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: | |
SEQ_PORT: 5432 | |
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@v3 | |
- uses: actions/setup-node@v3 | |
with: | |
node-version: ${{ matrix.node-version }} | |
- run: yarn global add node-gyp --ignore-engines | |
- run: yarn install --frozen-lockfile --ignore-engines | |
- run: yarn add pg-native --ignore-engines | |
if: matrix.native | |
- name: Unit Tests | |
run: yarn test-unit | |
if: ${{ !matrix.minify-aliases }} | |
- name: Integration Tests | |
run: yarn test-integration | |
test-mysql-mariadb: | |
strategy: | |
fail-fast: false | |
matrix: | |
include: | |
- name: MySQL 5.7 | |
image: mysql:5.7 | |
dialect: mysql | |
node-version: 10 | |
- name: MySQL 5.7 | |
image: mysql:5.7 | |
dialect: mysql | |
node-version: 18 | |
- name: MySQL 8.0 | |
image: mysql:8.0 | |
dialect: mysql | |
node-version: 10 | |
- name: MySQL 8.0 | |
image: mysql:8.0 | |
dialect: mysql | |
node-version: 18 | |
- name: MariaDB 10.3 | |
image: mariadb:10.3 | |
dialect: mariadb | |
node-version: 10 | |
- name: MariaDB 10.3 | |
image: mariadb:10.3 | |
dialect: mariadb | |
node-version: 18 | |
- name: MariaDB 10.5 | |
image: mariadb:10.5 | |
dialect: mariadb | |
node-version: 10 | |
- name: MariaDB 10.5 | |
image: mariadb:10.5 | |
dialect: mariadb | |
node-version: 18 | |
name: ${{ matrix.name }} (Node ${{ matrix.node-version }}) | |
runs-on: ubuntu-latest | |
services: | |
mysql: | |
image: ${{ matrix.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: | |
SEQ_PORT: 3306 | |
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@v3 | |
- uses: actions/setup-node@v3 | |
with: | |
node-version: ${{ matrix.node-version }} | |
- run: yarn global add node-gyp --ignore-engines | |
- run: yarn install --frozen-lockfile --ignore-engines | |
- name: Unit Tests | |
run: yarn test-unit | |
- name: Integration Tests | |
run: yarn test-integration | |
test-mssql: | |
strategy: | |
fail-fast: false | |
matrix: | |
node-version: [10, 18] | |
mssql-version: [2017, 2019] | |
name: MSSQL ${{ matrix.mssql-version }} (Node ${{ matrix.node-version }}) | |
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\"" | |
--health-start-period 10s | |
--health-interval 10s | |
--health-timeout 5s | |
--health-retries 10 | |
env: | |
DIALECT: mssql | |
SEQ_USER: SA | |
SEQ_PW: Password12! | |
SEQ_PORT: 1433 | |
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@v3 | |
- uses: actions/setup-node@v3 | |
with: | |
node-version: ${{ matrix.node-version }} | |
- run: yarn global add node-gyp --ignore-engines | |
- run: yarn install --frozen-lockfile --ignore-engines | |
- name: Unit Tests | |
run: yarn test-unit | |
- name: Integration Tests | |
run: yarn test-integration | |
test-snowflake: | |
strategy: | |
fail-fast: false | |
matrix: | |
node-version: [10, 18] | |
name: SNOWFLAKE (Node ${{ matrix.node-version }}) | |
runs-on: ubuntu-latest | |
env: | |
DIALECT: snowflake | |
steps: | |
- uses: actions/checkout@v3 | |
- uses: actions/setup-node@v3 | |
with: | |
node-version: ${{ matrix.node-version }} | |
- run: yarn global add node-gyp --ignore-engines | |
- run: yarn install --frozen-lockfile --ignore-engines | |
- name: Unit Tests | |
run: yarn test-unit | |
# - name: Integration Tests | |
# run: yarn test-integration | |
release: | |
name: Release | |
runs-on: ubuntu-latest | |
needs: | |
[ | |
lint, | |
docs, | |
test-typings, | |
test-sqlite, | |
test-postgres, | |
test-mysql-mariadb, | |
test-mssql, | |
] | |
if: github.event_name == 'push' && (github.ref == 'refs/heads/v6' || github.ref == 'refs/heads/v6-beta') | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
NPM_TOKEN: ${{ secrets.NPM_TOKEN }} | |
steps: | |
- uses: actions/checkout@v2 | |
- uses: actions/setup-node@v3 | |
with: | |
node-version: 18.x | |
- run: yarn global add node-gyp --ignore-engines | |
- run: yarn install --frozen-lockfile --ignore-engines | |
- run: npx semantic-release | |
- id: sequelize | |
uses: sdepold/github-action-get-latest-release@master | |
with: | |
repository: sequelize/sequelize | |
- name: Notify channels | |
run: | | |
curl -XPOST -u "sdepold:${{ secrets.GH_TOKEN }}" -H "Accept: application/vnd.github.v3+json" -H "Content-Type: application/json" https://api.github.com/repos/sequelize/sequelize/dispatches --data '{"event_type":"Release notifier","client_payload":{"release-id": ${{ steps.sequelize.outputs.id }}}}' | |
- name: Notify docs repo | |
run: | | |
curl -XPOST -u "sdepold:${{ secrets.GH_TOKEN }}" -H "Accept: application/vnd.github.v3+json" -H "Content-Type: application/json" https://api.github.com/repos/sequelize/website/dispatches --data '{"event_type":"Build website"}' |