refactor: add compatibility for prom-client@15 #195
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: CI | |
on: [ push, pull_request ] | |
env: | |
NODE_VERSION: 16 | |
jobs: | |
lockfile-lint: | |
name: Lockfile lint | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v2 | |
- uses: actions/setup-node@v2 | |
with: | |
node-version: ${{ env.NODE_VERSION }} | |
- name: lint lock file | |
run: npx lockfile-lint --path package-lock.json --allowed-hosts npm --validate-https | |
quality-checks: | |
needs: [ 'lockfile-lint' ] | |
name: Quality checks | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v2 | |
- uses: actions/setup-node@v2 | |
with: | |
node-version: ${{ env.NODE_VERSION }} | |
- name: install dependencies | |
run: npm ci | |
- name: types check | |
run: npm run types-check | |
- name: lint check | |
run: npm run lint | |
test: | |
strategy: | |
matrix: | |
NODE_VERSION: [ '10', '12', '14', '16', '18', '20' ] | |
needs: [ 'lockfile-lint' ] | |
name: Node v.${{ matrix.NODE_VERSION }} Tests | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v2 | |
- uses: actions/setup-node@v2 | |
with: | |
node-version: ${{ matrix.NODE_VERSION }} | |
- uses: actions/cache@v2 | |
with: | |
path: '**/node_modules' | |
key: ${{ matrix.NODE_VERSION }}-node-${{ hashFiles('**/package-lock.json') }} | |
- name: install dependencies | |
if: steps.cache.outputs.cache-hit != 'true' | |
run: npm ci | |
- name: unit tests | |
run: npm run unit-tests | |
- name: integration tests | |
run: npm run integration-tests | |
- name: coveralls | |
uses: coverallsapp/github-action@master | |
if: ${{ matrix.NODE_VERSION == env.NODE_VERSION }} | |
with: | |
github-token: ${{ secrets.GITHUB_TOKEN }} | |
prom-client-test: | |
needs: [ 'lockfile-lint' ] | |
strategy: | |
matrix: | |
prom-client: [ '12', '13', '14', '15' ] | |
name: Prom Client v.${{ matrix.prom-client }} Tests (node ${{ matrix.NODE_VERSION }}) | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v2 | |
- uses: actions/setup-node@v2 | |
with: | |
node-version: ${{ env.NODE_VERSION }} | |
- name: install dependencies | |
run: npm ci | |
- name: install prom client | |
run: npm i prom-client@${{ matrix.prom-client }} | |
- name: run tests | |
run: npm test |