Skip to content

Commit

Permalink
ci: bring into line with reusable workflow (#79)
Browse files Browse the repository at this point in the history
* ci(ci): run automerge only in pull-requests by dependabot

* ci(ci): add dependency review job

* ci(ci): remove git credentials after checkout

* style(ci): add names and whitespace to improve readability

* docs(readme): remove snyk badge

* ci(ci): remove invalid input

* ci(ci): set permissions for `test` job
  • Loading branch information
Fdawgs authored May 24, 2022
1 parent 40f4009 commit 4f28d71
Show file tree
Hide file tree
Showing 2 changed files with 41 additions and 13 deletions.
53 changes: 41 additions & 12 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -1,16 +1,35 @@
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]
Expand All @@ -22,24 +41,34 @@ jobs:
env:
discovery.type: single-node
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 --ignore-scripts
- name: Run Tests
run: |
npm test

- name: Install dependencies
run: npm i --ignore-scripts

- name: Run tests
run: npm test

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
1 change: 0 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@

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

Fastify plugin for [Elasticsearch](https://www.elastic.co/elasticsearch/) for sharing the same ES client in every part of your server.
Expand Down

0 comments on commit 4f28d71

Please sign in to comment.