Skip to content

Commit

Permalink
Swap from Travis to GH Action
Browse files Browse the repository at this point in the history
  • Loading branch information
digitalBush committed Mar 20, 2023
1 parent 49fce30 commit 0c2975d
Show file tree
Hide file tree
Showing 6 changed files with 64 additions and 38 deletions.
45 changes: 45 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
name: CI

on:
push:
branches:
- master
pull_request:

jobs:
test:
name: Test
runs-on: ubuntu-latest
env:
DB_PASSWORD: P@ssw0rd
services:
mssql:
image: mcr.microsoft.com/mssql/server
env:
ACCEPT_EULA: Y
MSSQL_SA_PASSWORD: ${{ env.DB_PASSWORD }}
MSSQL_PID: Developer
ports:
- 1434:1433
options: >-
--health-cmd "/opt/mssql-tools/bin/sqlcmd -U sa -P $MSSQL_SA_PASSWORD -Q 'select 1' -b -o /dev/null"
--health-interval 10s
--health-timeout 3s
--health-start-period 10s
--health-retries 10
steps:
- uses: actions/checkout@v3

- uses: actions/setup-node@v3
with:
node-version: "lts/*"
cache: 'npm'

- name: Install
run: npm ci --prefer-offline --no-audit

- name: Test
run: npm test

- name: Coveralls
uses: coverallsapp/github-action@v1
23 changes: 0 additions & 23 deletions .travis.yml

This file was deleted.

2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Skwell
[![Build Status](https://travis-ci.org/digitalBush/skwell.svg?branch=master)](https://travis-ci.org/digitalBush/skwell)
[![Build Status](https://github.com/digitalbush/skwell/actions/workflows/test.yml/badge.svg?branch=master)](https://github.com/digitalBush/skwell/actions/workflows/test.yml?query=branch%3Amaster)
[![Coverage Status](https://coveralls.io/repos/github/digitalBush/skwell/badge.svg)](https://coveralls.io/github/digitalBush/skwell)

A promised based SQL Server client with connection pooling.
Expand Down
9 changes: 4 additions & 5 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,10 @@
"url": "https://github.com/digitalBush/skwell.git"
},
"scripts": {
"test": "nyc -r text-summary mocha -r spec/init -R spec 'spec/**/*.spec.js'",
"test:watch": "nodemon --exec \"mocha -r spec/init -R spec 'spec/**/*.spec.js' || true\" -e js,json,sql",
"cover:show": "nyc report --reporter=html && open coverage/index.html",
"sql:start": "docker-compose -f spec/setup/docker-compose.yml up -d",
"sql:wait": "docker exec -it skwell /opt/mssql-tools/bin/sqlcmd -S localhost -U sa -P P@ssw0rd -l 60 -Q \"SELECT 1\" > /dev/null",
"test": "nyc -r text-summary -r lcov mocha -r spec/init -R spec 'spec/**/*.spec.js'",
"test:watch": "nodemon --exec \"mocha -r spec/init -R spec 'spec/**/*.spec.js' || true\" -e js,json,sql",
"cover:show": "open coverage/lcov-report/index.html",
"sql:start": "docker-compose -f spec/setup/docker-compose.yml up --wait",
"sql:stop": "docker-compose -f spec/setup/docker-compose.yml down"
},
"author": "",
Expand Down
5 changes: 3 additions & 2 deletions spec/init/config.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,13 @@ const defaults = {
username: "sa",
password: "P@ssw0rd",
server: "localhost",
database: "master"
database: "master",
port: 1434
};

let localConfig = {};
try {
localConfig = require( "../config.local" );
} catch ( e ) { }
} catch ( e ) { /* noop*/ }

module.exports = Object.assign( defaults, localConfig );
18 changes: 11 additions & 7 deletions spec/setup/docker-compose.yml
Original file line number Diff line number Diff line change
@@ -1,13 +1,17 @@
version: '2'
version: '3'
services:
mssql:
image: mcr.microsoft.com/mssql/server
container_name: skwell
ports:
- "1433:1433"
- "1434:1433"
environment:
- ACCEPT_EULA=Y
- MSSQL_SA_PASSWORD=P@ssw0rd
- MSSQL_PID=Developer
cap_add:
- SYS_PTRACE
ACCEPT_EULA: Y
MSSQL_SA_PASSWORD: P@ssw0rd
MSSQL_PID: Developer
healthcheck:
test: /opt/mssql-tools/bin/sqlcmd -S localhost -U sa -P "$${MSSQL_SA_PASSWORD}" -Q "SELECT 1" -b -o /dev/null
interval: 10s
timeout: 3s
retries: 10
start_period: 10s

0 comments on commit 0c2975d

Please sign in to comment.