|
1 | 1 | name: CI |
2 | | -on: [pull_request] |
| 2 | +on: |
| 3 | + pull_request: |
3 | 4 |
|
4 | | -env: |
5 | | - SEQ_DB: sequelize_test |
6 | | - SEQ_USER: sequelize_test |
7 | | - SEQ_PW: sequelize_test |
| 5 | +# This configuration cancels previous runs if a new run is started on the same PR. Only one run at a time per PR. |
| 6 | +# from https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#example-using-a-fallback-value |
| 7 | +concurrency: |
| 8 | + group: ${{ github.head_ref || github.run_id }} |
| 9 | + cancel-in-progress: true |
8 | 10 |
|
9 | 11 | jobs: |
10 | 12 | test-sqlite: |
11 | 13 | strategy: |
12 | 14 | fail-fast: false |
13 | 15 | matrix: |
14 | | - # node 10 is the minimum supported version for Sequelize 6 |
15 | | - # node 14 is the minimum supported version for Sequelize 7 |
16 | | - # node 16 is latest LTS (to keep updated) |
17 | | - node: [10, 14, 16] |
18 | | - name: SQLite (sequelize 6 & 7, node ${{ matrix.node }}) |
| 16 | + node-version: [10, 18, 20] |
| 17 | + name: sqlite (Node ${{ matrix.node-version }}) |
19 | 18 | runs-on: ubuntu-latest |
20 | 19 | env: |
21 | 20 | DIALECT: sqlite |
22 | 21 | steps: |
23 | | - - uses: actions/checkout@v2 |
24 | | - - uses: actions/setup-node@v1 |
| 22 | + - uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1 |
| 23 | + - uses: actions/setup-node@60edb5dd545a775178f52524783378180af0d1f8 # v4.0.2 |
25 | 24 | with: |
26 | | - node-version: 14.x |
27 | | - - run: /bin/bash ./setup/prepare-ci.sh |
| 25 | + node-version: ${{ matrix.node-version }} |
| 26 | + cache: yarn |
| 27 | + - run: /bin/bash ./dev/prepare-ci.sh |
28 | 28 | - name: Execute SSCCE |
29 | | - run: npm run _test |
| 29 | + run: yarn run _test |
30 | 30 | test-postgres: |
31 | 31 | strategy: |
32 | 32 | fail-fast: false |
33 | 33 | matrix: |
34 | | - postgres-version: [9.5, 10] # Does not work with 12 |
| 34 | + node-version: [10, 18, 20] |
| 35 | + postgres-version: [oldest, latest] |
| 36 | + minify-aliases: [true, false] |
35 | 37 | native: [true, false] |
36 | | - node: [10, 14, 16] |
37 | | - name: Postgres ${{ matrix.postgres-version }}${{ matrix.native && ' (native)' || '' }} (sequelize 6 & 7, node ${{ matrix.node }}) |
| 38 | + name: postgres ${{ matrix.postgres-version }}${{ matrix.native && ' (native)' || '' }} (Node ${{ matrix.node-version }})${{ matrix.minify-aliases && ' (minified aliases)' || '' }} |
38 | 39 | runs-on: ubuntu-latest |
39 | | - services: |
40 | | - postgres: |
41 | | - image: sushantdhiman/postgres:${{ matrix.postgres-version }} |
42 | | - env: |
43 | | - POSTGRES_USER: sequelize_test |
44 | | - POSTGRES_DB: sequelize_test |
45 | | - POSTGRES_PASSWORD: sequelize_test |
46 | | - ports: |
47 | | - - 5432:5432 |
48 | | - options: --health-cmd pg_isready --health-interval 10s --health-timeout 5s --health-retries 5 |
49 | 40 | env: |
50 | 41 | DIALECT: ${{ matrix.native && 'postgres-native' || 'postgres' }} |
| 42 | + SEQ_PG_MINIFY_ALIASES: ${{ matrix.minify-aliases && '1' || '' }} |
51 | 43 | steps: |
52 | | - - run: PGPASSWORD=sequelize_test psql -h localhost -p 5432 -U sequelize_test sequelize_test -c '\l' |
53 | | - - uses: actions/checkout@v2 |
54 | | - - uses: actions/setup-node@v3 |
| 44 | + - uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1 |
| 45 | + - uses: actions/setup-node@60edb5dd545a775178f52524783378180af0d1f8 # v4.0.2 |
55 | 46 | with: |
56 | | - node-version: ${{ matrix.node }} |
57 | | - - run: /bin/bash ./setup/prepare-ci.sh |
| 47 | + node-version: ${{ matrix.node-version }} |
| 48 | + cache: yarn |
| 49 | + - run: /bin/bash ./dev/prepare-ci.sh |
| 50 | + - run: yarn start-postgres-${{ matrix.postgres-version }} |
58 | 51 | - name: Execute SSCCE |
59 | | - run: npm run _test |
60 | | - test-mysql-mariadb: |
| 52 | + run: yarn run _test |
| 53 | + test-oldest-latest: |
61 | 54 | strategy: |
62 | 55 | fail-fast: false |
63 | 56 | matrix: |
64 | | - node: [10, 14, 16] |
65 | | - db: |
66 | | - - '{ name: "MySQL 5.7", image: "mysql:5.7", dialect: "mysql" }' |
67 | | - - '{ name: "MariaDB 10.3", image: "mariadb:10.3", dialect: "mariadb" }' |
68 | | - name: ${{ fromJson(matrix.db).name }} (node ${{ matrix.node }}) |
| 57 | + node-version: [10, 18, 20] |
| 58 | + database-version: [oldest, latest] |
| 59 | + dialect: [mysql, mariadb, mssql] |
| 60 | + name: ${{ matrix.dialect }} ${{ matrix.database-version }} (Node ${{ matrix.node-version }}) |
69 | 61 | runs-on: ubuntu-latest |
70 | | - services: |
71 | | - mysql: |
72 | | - image: ${{ fromJson(matrix.db).image }} |
73 | | - env: |
74 | | - MYSQL_DATABASE: sequelize_test |
75 | | - MYSQL_USER: sequelize_test |
76 | | - MYSQL_PASSWORD: sequelize_test |
77 | | - MYSQL_ROOT_PASSWORD: sequelize_test |
78 | | - ports: |
79 | | - - 3306:3306 |
80 | | - options: --health-cmd="mysqladmin -usequelize_test -psequelize_test status" --health-interval 10s --health-timeout 5s --health-retries 5 --tmpfs /var/lib/mysql:rw |
81 | 62 | env: |
82 | | - DIALECT: ${{ fromJson(matrix.db).dialect }} |
| 63 | + DIALECT: ${{ matrix.dialect }} |
83 | 64 | steps: |
84 | | - - run: mysql --host 127.0.0.1 --port 3306 -uroot -psequelize_test -e "GRANT ALL ON *.* TO 'sequelize_test'@'%' with grant option; FLUSH PRIVILEGES;" |
85 | | - - uses: actions/checkout@v2 |
86 | | - - uses: actions/setup-node@v3 |
| 65 | + - uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1 |
| 66 | + - uses: actions/setup-node@60edb5dd545a775178f52524783378180af0d1f8 # v4.0.2 |
87 | 67 | with: |
88 | | - node-version: ${{ matrix.node }} |
89 | | - - run: /bin/bash ./setup/prepare-ci.sh |
| 68 | + node-version: ${{ matrix.node-version }} |
| 69 | + cache: yarn |
| 70 | + - run: /bin/bash ./dev/prepare-ci.sh |
| 71 | + - run: yarn start-${{ matrix.dialect }}-${{ matrix.database-version }} |
90 | 72 | - name: Execute SSCCE |
91 | | - run: npm run _test |
92 | | - test-mssql: |
93 | | - strategy: |
94 | | - fail-fast: false |
95 | | - matrix: |
96 | | - node: [10, 14, 16] |
97 | | - mssql-version: [2017, 2019] |
98 | | - name: MSSQL ${{ matrix.mssql-version }} (sequelize 6 & 7, node ${{ matrix.node }}) |
99 | | - runs-on: ubuntu-latest |
100 | | - services: |
101 | | - mssql: |
102 | | - image: mcr.microsoft.com/mssql/server:${{ matrix.mssql-version }}-latest |
103 | | - env: |
104 | | - ACCEPT_EULA: Y |
105 | | - SA_PASSWORD: Password12! |
106 | | - ports: |
107 | | - - 1433:1433 |
108 | | - options: >- |
109 | | - --health-cmd="/opt/mssql-tools/bin/sqlcmd -S localhost -U SA -P "Password12!" -l 30 -Q \"SELECT 1\" || exit 1" |
110 | | - --health-start-period 10s |
111 | | - --health-interval 10s |
112 | | - --health-timeout 5s |
113 | | - --health-retries 10 |
114 | | - env: |
115 | | - DIALECT: mssql |
116 | | - steps: |
117 | | - - 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;" |
118 | | - - uses: actions/checkout@v2 |
119 | | - - uses: actions/setup-node@v3 |
120 | | - with: |
121 | | - node-version: ${{ matrix.node }} |
122 | | - - run: /bin/bash ./setup/prepare-ci.sh |
123 | | - - name: Execute SSCCE |
124 | | - run: npm run _test |
| 73 | + run: yarn run _test |
0 commit comments