diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 9ed29e79a..2f567fb2d 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -23,7 +23,6 @@ jobs: - uses: actions/setup-node@60edb5dd545a775178f52524783378180af0d1f8 # v4.0.2 with: node-version: ${{ matrix.node-version }} - cache: yarn - run: /bin/bash ./dev/prepare-ci.sh - name: Execute SSCCE run: yarn run _test @@ -45,7 +44,6 @@ jobs: - uses: actions/setup-node@60edb5dd545a775178f52524783378180af0d1f8 # v4.0.2 with: node-version: ${{ matrix.node-version }} - cache: yarn - run: /bin/bash ./dev/prepare-ci.sh - run: yarn start-postgres-${{ matrix.postgres-version }} - name: Execute SSCCE @@ -66,7 +64,6 @@ jobs: - uses: actions/setup-node@60edb5dd545a775178f52524783378180af0d1f8 # v4.0.2 with: 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 diff --git a/dev/create-sequelize-instance.ts b/dev/create-sequelize-instance.ts index 1ec6d6438..5011c99a1 100644 --- a/dev/create-sequelize-instance.ts +++ b/dev/create-sequelize-instance.ts @@ -7,7 +7,7 @@ export function createSequelize6Instance(options?: Sequelize6Options): Sequelize return new Sequelize6(wrapOptions(options)); } -export function createSequelize7Instance(options?: Sequelize7Options): Sequelize7 { +export function createSequelize7Instance(options?: Sequelize7Options): Sequelize7 { // not compatible with node 10 const { Sequelize: Sequelize7Constructor } = require('@sequelize/core'); // @ts-expect-error -- wrapOptions expect sequelize 6. diff --git a/dev/prepare-ci.sh b/dev/prepare-ci.sh index 303fcd571..0fc1b9850 100644 --- a/dev/prepare-ci.sh +++ b/dev/prepare-ci.sh @@ -3,15 +3,15 @@ yarn install --ignore-engines; if [ "$DIALECT" = "postgres" ]; then - yarn add pg@^8 pg-hstore@^2 pg-types@^2 --ignore-engines; + yarn add pg@^8 pg-hstore@^2 pg-types@^2 @sequelize/postgres --ignore-engines; elif [ "$DIALECT" = "postgres-native" ]; then - yarn add pg@^8 pg-hstore@^2 pg-types@^2 pg-native --ignore-engines; + yarn add pg@^8 pg-hstore@^2 pg-types@^2 pg-native @sequelize/postgres --ignore-engines; elif [ "$DIALECT" = "mysql" ]; then - yarn add mysql2@^2 --ignore-engines; + yarn add mysql2@^2 @sequelize/mysql --ignore-engines; elif [ "$DIALECT" = "mariadb" ]; then - yarn add mariadb@^2 --ignore-engines; + yarn add mariadb@^2 @sequelize/mariadb --ignore-engines; elif [ "$DIALECT" = "sqlite" ]; then - yarn add sqlite3@^5 --ignore-engines; + yarn add sqlite3@^5 @sequelize/sqlite --ignore-engines; elif [ "$DIALECT" = "mssql" ]; then - yarn add tedious@^8 --ignore-engines; + yarn add tedious@^8 @sequelize/mssql --ignore-engines; fi diff --git a/dev/runner.ts b/dev/runner.ts index 4d4f22e1e..c6348cef4 100644 --- a/dev/runner.ts +++ b/dev/runner.ts @@ -56,7 +56,7 @@ async function wrappedRun() { } try { - await run(); + await run(process.env.DIALECT); } catch (error) { logRed('Sequelize 7 test failed'); logRed(error); diff --git a/src/sscce-sequelize-7.ts b/src/sscce-sequelize-7.ts index 2fa777aa9..009d60b18 100644 --- a/src/sscce-sequelize-7.ts +++ b/src/sscce-sequelize-7.ts @@ -1,4 +1,4 @@ -import { CreationOptional, DataTypes, InferAttributes, InferCreationAttributes, Model } from '@sequelize/core'; +import { CreationOptional, DataTypes, DialectName, InferAttributes, InferCreationAttributes, Model } from '@sequelize/core'; import { Attribute, PrimaryKey } from '@sequelize/core/decorators-legacy'; import { createSequelize7Instance } from '../dev/create-sequelize-instance'; import { expect } from 'chai'; @@ -10,10 +10,11 @@ export const testingOnDialects = new Set(['mssql', 'sqlite', 'mysql', 'mariadb', // You can delete this file if you don't want your SSCCE to be tested against Sequelize 7 // Your SSCCE goes inside this function. -export async function run() { +export async function run(dialect: DialectName) { // This function should be used instead of `new Sequelize()`. // It applies the config for your SSCCE to work on CI. const sequelize = createSequelize7Instance({ + dialect, logQueryParameters: true, benchmark: true, define: {