Skip to content

Commit

Permalink
Coveralls (#2)
Browse files Browse the repository at this point in the history
* coveralls

* add docker to workflow

* stuff

* try copying testcontainers workflow

* comment out docker root socket removal

* evert "comment out docker root socket removal"

This reverts commit c48c5e0.

* start docker

* ⚗️ increasing timeout

* ✨ Uncommented coveralls

* badge

---------

Co-authored-by: Arman Khan <work.armankhan@gmail.com>
  • Loading branch information
brietsparks and iarmankhan committed Aug 4, 2023
1 parent 74db8ba commit ff83ac2
Show file tree
Hide file tree
Showing 6 changed files with 266 additions and 14 deletions.
11 changes: 9 additions & 2 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
@@ -1,14 +1,15 @@
name: CI
on: [push]

jobs:
build:
name: Build, lint, and test on Node ${{ matrix.node }} and ${{ matrix.os }}

runs-on: ${{ matrix.os }}
strategy:
matrix:
node: ['14.x', '16.x']
os: [ubuntu-latest, windows-latest, macOS-latest]
node: ['16.x']
os: [ubuntu-latest]

steps:
- name: Checkout repo
Expand All @@ -19,6 +20,9 @@ jobs:
with:
node-version: ${{ matrix.node }}

- name: Print Docker status
run: systemctl status docker

- name: Install deps and build (with cache)
uses: bahmutov/npm-install@v1

Expand All @@ -28,5 +32,8 @@ jobs:
- name: Test
run: yarn test --ci --coverage --maxWorkers=2

- name: Coveralls GitHub Action
uses: coverallsapp/github-action@v2

- name: Build
run: yarn build
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
# Knex Relay Cursor Pagination

[![Coverage Status](https://coveralls.io/repos/github/brietsparks/knex-relay-cursor-pagination/badge.svg?branch=coveralls)](https://coveralls.io/github/brietsparks/knex-relay-cursor-pagination?branch=coveralls)

Easily implement [relay cursor pagination](https://relay.dev/graphql/connections.htm) in your Knex data layer.

## Install
Expand Down
5 changes: 4 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,9 @@
"prepare": "dts build",
"size": "size-limit",
"start": "dts watch",
"test": "dts test"
"test": "dts test",
"test:coverage": "dts test --coverage",
"test:coveralls": "dts test --coverage && coveralls < coverage/lcov.info"
},
"husky": {
"hooks": {
Expand Down Expand Up @@ -50,6 +52,7 @@
"devDependencies": {
"@size-limit/preset-small-lib": "^8.2.6",
"@tsconfig/recommended": "^1.0.2",
"coveralls": "^3.1.1",
"dts-cli": "^2.0.3",
"husky": "^8.0.3",
"knex": "^2.5.1",
Expand Down
2 changes: 1 addition & 1 deletion test/knex-relay-cursor-pagination.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ describe('createPagination', () => {
},
});
await db.migrate.up();
});
}, 120000);

afterAll(async () => {
await db.destroy();
Expand Down
1 change: 1 addition & 0 deletions test/setup.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ export async function createPgTestcontainer(): Promise<CreatePgTestcontainerResu
.withEnv('POSTGRES_PASSWORD', containerParams.password)
.withEnv('POSTGRES_USER', containerParams.user)
.withEnv('POSTGRES_DB', containerParams.database)
.withStartupTimeout(120000)
.start();

const connectionParams = {
Expand Down

0 comments on commit ff83ac2

Please sign in to comment.