Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ci: bring into line with reusable workflow #241

Merged
merged 1 commit into from
May 24, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
58 changes: 42 additions & 16 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -1,47 +1,73 @@
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:
redis:
image: redis
ports:
- '6379:6379'
options: '--entrypoint redis-server'
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-rate-limit/workflows/CI/badge.svg)
[![NPM version](https://img.shields.io/npm/v/@fastify/rate-limit.svg?style=flat)](https://www.npmjs.com/package/@fastify/rate-limit)
[![Known Vulnerabilities](https://snyk.io/test/github/fastify/fastify-rate-limit/badge.svg)](https://snyk.io/test/github/fastify/fastify-rate-limit)
[![js-standard-style](https://img.shields.io/badge/code%20style-standard-brightgreen.svg?style=flat)](https://standardjs.com/)

A low overhead rate limiter for your routes. Supports Fastify `2.x - 3.x` semver range.
Expand Down