From a3c3c5f0a2ac2091d9f112cf93d5a7c4e346a20d Mon Sep 17 00:00:00 2001 From: Sehrope Sarkuni Date: Fri, 5 Jan 2024 11:57:55 -0500 Subject: [PATCH] Add windows and macos to CI build matrix --- .github/workflows/ci.yml | 29 ++++++++++++++++++++++------- Makefile | 12 ++++++------ bin/postgres-server | 2 +- 3 files changed, 29 insertions(+), 14 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 9747861..2c819ab 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -7,6 +7,9 @@ on: paths-ignore: - 'docs/**' - '**/*.md' +defaults: + run: + shell: bash -euo pipefail {0} jobs: lint: @@ -18,17 +21,19 @@ jobs: run: make clean deps lint test: - name: Test - Node v${{ matrix.node_version }} - runs-on: ubuntu-latest + name: Test - ${{ matrix.os }} x Node v${{ matrix.node_version }} strategy: fail-fast: false matrix: node_version: - - '16' - - '18' + # Temp to speed up CI fix + #- '16' + #- '18' - '20' - - 'lts/*' - - 'latest' + #- 'lts/*' + #- 'latest' + os: [ubuntu-latest, windows-latest, macos-latest] + runs-on: ${{ matrix.os }} steps: - uses: actions/checkout@v4 - name: Setup Node @@ -36,6 +41,16 @@ jobs: with: node-version: ${{ matrix.node_version }} cache: npm + - name: Setup docker (MacOS) + if: runner.os == 'macos' + run: | + brew install docker + colima start + - name: Show env + run: | + node --version + uname -a + docker --version - name: Compile run: make clean deps compile - name: Setup Postgres @@ -43,7 +58,7 @@ jobs: DOCKER_OPTS: '--detach' run: | bin/postgres-server - for i in {1..10} + for i in {1..30} do if pg_isready -h 127.0.0.1 then diff --git a/Makefile b/Makefile index ffbc1c5..dc12236 100644 --- a/Makefile +++ b/Makefile @@ -9,28 +9,28 @@ clean: rm -rf lib node_modules coverage compile: - node_modules/.bin/tsc --declaration + ./node_modules/.bin/tsc --declaration watch: - node_modules/.bin/tsc --watch --declaration + ./node_modules/.bin/tsc --watch --declaration test: - node_modules/.bin/ts-mocha test/suite.ts --exit $(TEST_ARGS) + ./node_modules/.bin/ts-mocha test/suite.ts --exit $(TEST_ARGS) clean-cov: rm -rf coverage test-cov: - node_modules/.bin/c8 \ + ./node_modules/.bin/c8 \ --require source-map-support/register \ --require ts-node/register \ --reporter=html \ --reporter=lcov \ --extension .ts \ - node_modules/.bin/ts-mocha --exit test/suite.ts + ./node_modules/.bin/ts-mocha --exit test/suite.ts lint: - node_modules/.bin/eslint src + ./node_modules/.bin/eslint src package: clean deps compile diff --git a/bin/postgres-server b/bin/postgres-server index 849a579..e185f93 100755 --- a/bin/postgres-server +++ b/bin/postgres-server @@ -7,7 +7,7 @@ main () { --rm \ --env POSTGRES_PASSWORD=dbpass \ --env POSTGRES_HOST_AUTH_METHOD=md5 \ - --publish 5432:5432 \ + --publish 127.0.0.1:5432:5432 \ postgres }