Skip to content

Commit

Permalink
Add windows and macos to CI build matrix
Browse files Browse the repository at this point in the history
  • Loading branch information
sehrope committed Jan 5, 2024
1 parent f1b4b2f commit a3c3c5f
Show file tree
Hide file tree
Showing 3 changed files with 29 additions and 14 deletions.
29 changes: 22 additions & 7 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,9 @@ on:
paths-ignore:
- 'docs/**'
- '**/*.md'
defaults:
run:
shell: bash -euo pipefail {0}

jobs:
lint:
Expand All @@ -18,32 +21,44 @@ 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
uses: actions/setup-node@v4
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
env:
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
Expand Down
12 changes: 6 additions & 6 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
2 changes: 1 addition & 1 deletion bin/postgres-server
Original file line number Diff line number Diff line change
Expand Up @@ -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
}

Expand Down

0 comments on commit a3c3c5f

Please sign in to comment.