Skip to content

Commit

Permalink
Merge branch 'master' into snyk-upgrade-a0d3a9fe148efb24a121f570b3401e93
Browse files Browse the repository at this point in the history
  • Loading branch information
kobik committed Jun 26, 2022
2 parents 95c5343 + 1e8a43f commit a087727
Show file tree
Hide file tree
Showing 4 changed files with 126 additions and 64 deletions.
60 changes: 16 additions & 44 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@ name: CI

on: [ push, pull_request ]

env:
NODE_VERSION: 16

jobs:
lockfile-lint:
name: Lockfile lint
Expand All @@ -10,7 +13,7 @@ jobs:
- uses: actions/checkout@v2
- uses: actions/setup-node@v2
with:
node-version: '14'
node-version: ${{ env.NODE_VERSION }}
- name: lint lock file
run: npx lockfile-lint --path package-lock.json --allowed-hosts npm --validate-https

Expand All @@ -22,7 +25,7 @@ jobs:
- uses: actions/checkout@v2
- uses: actions/setup-node@v2
with:
node-version: '14'
node-version: ${{ env.NODE_VERSION }}
- name: install dependencies
run: npm ci
- name: types check
Expand All @@ -33,20 +36,19 @@ jobs:
test:
strategy:
matrix:
platform: [ ubuntu-latest ]
node: [ '10', '12', '14', '16' ]
needs: [ 'quality-checks' ]
name: Node v.${{ matrix.node }} Tests (${{ matrix.platform }})
runs-on: ${{ matrix.platform }}
NODE_VERSION: [ '10', '12', '14', '16' ]
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 }}
node-version: ${{ matrix.NODE_VERSION }}
- uses: actions/cache@v2
with:
path: '**/node_modules'
key: ${{ matrix.node }}-node-${{ hashFiles('**/package-lock.json') }}
key: ${{ matrix.NODE_VERSION }}-node-${{ hashFiles('**/package-lock.json') }}
- name: install dependencies
if: steps.cache.outputs.cache-hit != 'true'
run: npm ci
Expand All @@ -56,55 +58,25 @@ jobs:
run: npm run integration-tests
- name: coveralls
uses: coverallsapp/github-action@master
if: ${{ matrix.node == '14' }}
if: ${{ matrix.NODE_VERSION == env.NODE_VERSION }}
with:
github-token: ${{ secrets.GITHUB_TOKEN }}

prom-client-test:
needs: [ 'lockfile-lint' ]
strategy:
matrix:
node: [ '12', '14' ]
prom-client: [ '12' ]
needs: [ 'lockfile-lint', 'quality-checks' ]
name: Prom Client v.${{ matrix.prom-client }} Tests (node ${{ matrix.node }})
prom-client: [ '12', '13', '14' ]
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: ${{ matrix.node }}
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

release:
permissions:
actions: write
checks: write
contents: write
deployments: write
issues: write
packages: write
pull-requests: write
repository-projects: write
security-events: write
statuses: write
name: release
needs: [ test, prom-client-test, lockfile-lint ]
runs-on: ubuntu-latest
if: github.event_name == 'push' && github.ref == 'refs/heads/master'
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v2
with:
node-version: '14'
- name: install dependencies
run: npm ci --ignore-scripts
- name: release
run: npx semantic-release
env:
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}
NPM_TOKEN: ${{secrets.NPM_TOKEN}}
32 changes: 32 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
name: Release

on: [ workflow_dispatch ]

jobs:
release:
permissions:
actions: write
checks: write
contents: write
deployments: write
issues: write
packages: write
pull-requests: write
repository-projects: write
security-events: write
statuses: write
name: release
runs-on: ubuntu-latest
if: github.ref == 'refs/heads/master'
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v2
with:
node-version: '16'
- name: install dependencies
run: npm ci --ignore-scripts
- name: release
run: npx semantic-release
env:
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}
NPM_TOKEN: ${{secrets.NPM_TOKEN}}
96 changes: 77 additions & 19 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@
"pkginfo": "^0.4.1"
},
"peerDependencies": {
"prom-client": ">=12 <14"
"prom-client": ">=12 <15"
},
"devDependencies": {
"@nestjs/common": "^7.4.4",
Expand Down

0 comments on commit a087727

Please sign in to comment.