diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 8fb49ee..9a21dca 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -5,7 +5,16 @@ on: pull_request jobs: build: runs-on: ubuntu-latest - container: node:14-alpine + container: node:${{ matrix.node }}-alpine + + strategy: + matrix: + node: + - 14 + - 16 + - 18 + - 19 + services: postgres: image: postgres @@ -15,9 +24,6 @@ jobs: steps: - uses: actions/checkout@v2 - - uses: actions/setup-node@v1 - with: - node-version: ${{ matrix.node }} - uses: actions/cache@v2 with: path: ~/.npm diff --git a/CHANGELOG.md b/CHANGELOG.md index fc7a663..a415686 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,6 +3,7 @@ ## [Unreleased][unreleased] - Add empty line separator in SQL create script +- Run CI for node.js 14, 16, 18, 19 with postgres ## [2.1.0][] - 2022-08-18 diff --git a/package.json b/package.json index 826300e..f1f0518 100644 --- a/package.json +++ b/package.json @@ -37,7 +37,7 @@ }, "homepage": "https://github.com/metarhia/metasql#readme", "engines": { - "node": "14 || 16 || 18" + "node": "14 || 16 || 18 || 19" }, "dependencies": { "metadomain": "^1.0.9", diff --git a/test/create.js b/test/create.js index 92a676c..2a7a899 100644 --- a/test/create.js +++ b/test/create.js @@ -9,14 +9,12 @@ metatests.test('Create structure', async (test) => { const dir = process.cwd(); const schemaPath = path.join(dir, 'node_modules/metadomain/schemas'); try { - await metasql.create(schemaPath, 'test/sql'); - const expect = await fsp.readFile('test/sql/expect.sql', { - encoding: 'utf8', - }); - const database = await fsp.readFile('test/sql/database.sql', { - encoding: 'utf8', - }); + await metasql.create(schemaPath, './'); + await fsp.unlink('./database.d.ts'); + const expect = await fsp.readFile('test/sql/expect.sql', 'utf8'); + const database = await fsp.readFile('./database.sql', 'utf8'); test.strictEqual(database, expect); + await fsp.unlink('./database.sql'); } catch (err) { test.error(err); }