Skip to content

Commit

Permalink
ci: bring into line with reusable workflow (#133)
Browse files Browse the repository at this point in the history
  • Loading branch information
Fdawgs authored May 24, 2022
1 parent 2161260 commit fe3f5be
Show file tree
Hide file tree
Showing 2 changed files with 41 additions and 33 deletions.
72 changes: 41 additions & 31 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -1,22 +1,38 @@
name: CI
'on':

on:
push:
paths-ignore:
- docs/**
- 'docs/**'
- '*.md'
pull_request:
paths-ignore:
- docs/**
- 'docs/**'
- '*.md'

jobs:
dependency-review:
name: Dependency Review
if: github.event_name == 'pull_request'
runs-on: ubuntu-latest
permissions:
contents: read
steps:
- name: Check out repo
uses: actions/checkout@v3
with:
persist-credentials: false

- name: Dependency review
uses: actions/dependency-review-action@v1

test:
runs-on: ubuntu-latest
permissions:
contents: read
strategy:
matrix:
node-version:
- 14
- 16
- 18
node-version: [14, 16, 18]
services:
postgres:
image: postgres:11-alpine
Expand All @@ -30,14 +46,19 @@ jobs:
--health-cmd pg_isready --health-interval 10s --health-timeout 5s
--health-retries 5
steps:
- uses: actions/checkout@v3
- name: Use Node.js
- name: Check out repo
uses: actions/checkout@v3
with:
persist-credentials: false

- name: Setup Node ${{ matrix.node-version }}
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}
- name: Install Dependencies
run: |
npm install

- name: Install dependencies
run: npm i

- name: CI environment setup
run: >
npm i node-gyp
Expand All @@ -50,34 +71,23 @@ jobs:
job.services.postgres.ports[5432] }} -d postgres -c 'CREATE TABLE
users(id serial PRIMARY KEY, username VARCHAR (50) NOT NULL);' -U
postgres
- name: Check licenses
run: |
npm run license-checker --if-present
- name: Run tests
run: |
npm run test:ci
- name: Coveralls Parallel
uses: coverallsapp/github-action@1.1.3
with:
github-token: ${{ secrets.github_token }}
parallel: true
flag-name: run-${{ matrix.node-version }}-${{ matrix.os }}
coverage:
needs: test
runs-on: ubuntu-latest
steps:
- name: Coveralls Finished
uses: coverallsapp/github-action@1.1.3
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
parallel-finished: true
automerge:
name: Automerge Dependabot PRs
if: >
github.event_name == 'pull_request' &&
github.event.pull_request.user.login == 'dependabot[bot]'
needs: test
runs-on: ubuntu-latest
permissions:
pull-requests: write
contents: write
runs-on: ubuntu-latest
steps:
- uses: fastify/github-action-merge-dependabot@v3
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
target: major
2 changes: 0 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@

![CI](https://github.com/fastify/fastify-postgres/workflows/CI/badge.svg)
[![NPM version](https://img.shields.io/npm/v/@fastify/postgres.svg?style=flat)](https://www.npmjs.com/package/@fastify/postgres)
[![Known Vulnerabilities](https://snyk.io/test/github/fastify/fastify-postgres/badge.svg)](https://snyk.io/test/github/fastify/fastify-postgres)
[![Coverage Status](https://coveralls.io/repos/github/fastify/fastify-postgres/badge.svg?branch=master)](https://coveralls.io/github/fastify/fastify-postgres?branch=master)
[![js-standard-style](https://img.shields.io/badge/code%20style-standard-brightgreen.svg?style=flat)](https://standardjs.com/)

Fastify PostgreSQL connection plugin; with this, you can share the same PostgreSQL connection pool in every part of your server.
Expand Down

0 comments on commit fe3f5be

Please sign in to comment.