Skip to content

Commit

Permalink
Update GitHub workflows
Browse files Browse the repository at this point in the history
  • Loading branch information
iaincollins committed Sep 3, 2020
1 parent 4305964 commit 4937047
Show file tree
Hide file tree
Showing 4 changed files with 35 additions and 34 deletions.
6 changes: 2 additions & 4 deletions .github/workflows/npm-publish.yml
@@ -1,9 +1,6 @@
# Publishes module to registry when a new release is created.
#
# The following secrets need to be configured for this workflow:
#
# * NPM_TOKEN - Auth token from npmjs.com

name: Publish to NPM

on:
Expand All @@ -19,7 +16,8 @@ jobs:
with:
node-version: 12
- run: npm ci
- run: npm test
- run: npm run build
- run: npm run lint

publish-npm:
needs: build
Expand Down
21 changes: 11 additions & 10 deletions .github/workflows/test-build.yml
@@ -1,4 +1,6 @@
name: Test Build
# Simple check that the build is valid and no linting errors.
# Currently is run as a seperate workflow as it's fast to fail.
name: Test build and linting

on:
push:
Expand All @@ -8,19 +10,18 @@ on:

jobs:
build:

runs-on: ubuntu-latest

strategy:
matrix:
node-version: [10.x, 12.x, 14.x]

steps:
- uses: actions/checkout@v2
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v1
with:
node-version: ${{ matrix.node-version }}
- run: npm ci
- run: npm run build
- run: npm test
- uses: actions/checkout@v2
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v1
with:
node-version: ${{ matrix.node-version }}
- run: npm ci
- run: npm run build
- run: npm run lint
40 changes: 21 additions & 19 deletions .github/workflows/test-integration.yml
@@ -1,4 +1,4 @@
name: Integration Test
name: Integration test

on:
push:
Expand All @@ -7,29 +7,31 @@ on:
branches: [ main ]

jobs:
build:

test:
runs-on: ubuntu-latest

strategy:
matrix:
node-version: [10.x]
node-version: [12.x]

steps:
- uses: actions/checkout@v2
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v1
with:
node-version: ${{ matrix.node-version }}
- run: npm ci
- run: npm run build
- run: npm test
- run: npm run test:app:start
- uses: actions/checkout@v2
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v1
with:
node-version: ${{ matrix.node-version }}

# Install packages, build library, start test app in Docker container
- run: npm ci
- run: npm run build
- run: npm run test:app:start

# https://www.cypress.io/blog/2019/11/20/drastically-simplify-your-testing-with-cypress-github-action/
- name: Cypress run
uses: cypress-io/github-action@v1
with:
start: npm run test:e2e:run
# Run end-to-end integration tests using Cypress
# https://www.cypress.io/blog/2019/11/20/drastically-simplify-your-testing-with-cypress-github-action/
- name: Cypress tests
uses: cypress-io/github-action@v1
with:
start: npm run test:e2e:run

- run: npm run test:app:stop
# Stop test app in Docker container
- run: npm run test:app:stop
2 changes: 1 addition & 1 deletion package.json
Expand Up @@ -16,7 +16,7 @@
"test:app:start": "docker-compose -f test/docker/app.yml up -d",
"test:app:rebuild": "docker-compose -f test/docker/app.yml up -d --build",
"test:app:stop": "docker-compose -f test/docker/app.yml down",
"test": "npm run lint",
"test": "npm run lint && npm run build && npm run test:app:rebuild && npm run test:e2e:run && npm run test:app:stop",
"test:db": "npm run test:db:mysql && npm run test:db:postgres && npm run test:db:mongodb && npm run test:db:mssql",
"test:db:mysql": "node test/mysql.js",
"test:db:postgres": "node test/postgres.js",
Expand Down

1 comment on commit 4937047

@vercel
Copy link

@vercel vercel bot commented on 4937047 Sep 3, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.