Skip to content

Commit

Permalink
Update CI
Browse files Browse the repository at this point in the history
  • Loading branch information
myrotvorets-team committed Dec 13, 2021
1 parent 709576c commit c46246a
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 57 deletions.
7 changes: 3 additions & 4 deletions .github/workflows/build-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,8 @@ jobs:
if: ${{ !startsWith(github.ref, 'refs/heads/') || !needs.prepare.outputs.head_tag }}
strategy:
matrix:
node_version: ['14']
node_version:
- 'lts/*'

steps:
- name: Checkout
Expand All @@ -45,9 +46,7 @@ jobs:
with:
node-version: ${{ matrix.node_version }}
registry-url: https://npm.pkg.github.com

- name: Update npm
run: npm i -g npm@latest
cache: npm

- name: Install dependencies
run: npm ci --ignore-scripts
Expand Down
58 changes: 6 additions & 52 deletions .github/workflows/package-audit.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,74 +2,28 @@ name: Package Audit

on:
push:
branches:
- master
paths:
- package.json
- package-lock.json
pull_request:
branches:
- '**:**'
paths:
- package.json
- package-lock.json
workflow_dispatch:

jobs:
audit-npm:
name: NPM Audit
runs-on: ubuntu-latest

strategy:
matrix:
node_version: ["14"]

steps:
- name: Checkout
uses: actions/checkout@v2.4.0

- name: Setup Node.js environment
uses: actions/setup-node@v2.5.0
with:
node-version: ${{ matrix.node_version }}

- name: Run audit
run: npm audit --production
- name: Audit with NPM
uses: myrotvorets/composite-actions/node-package-audit@master

audit-retire:
name: RetireJS Check
runs-on: ubuntu-latest

strategy:
matrix:
node_version: ["14"]

steps:
- name: Checkout
uses: actions/checkout@v2.4.0

- name: Setup Node.js environment
uses: actions/setup-node@v2.5.0
with:
node-version: ${{ matrix.node_version }}
registry-url: https://npm.pkg.github.com

- name: Cache node modules
uses: actions/cache@v2.1.7
env:
cache-name: cache-node-modules
with:
path: ~/.npm
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ matrix.node_version }}-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.os }}-build-${{ env.cache-name }}-${{ matrix.node_version }}-
${{ runner.os }}-build-${{ env.cache-name }}-
- name: Install dependencies
run: npm ci --ignore-scripts
env:
NODE_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- name: Install retire.js
run: npm i -g retire

- name: Run audit
run: retire -n
- name: Audit with Retire.js
uses: myrotvorets/composite-actions/node-package-audit-retirejs@master
2 changes: 1 addition & 1 deletion test/wpapi.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import type { PostData } from '../src/lib/types';

jest.mock('fetch-h2');

const mockedFetch = f.fetch as jest.MockedFunction<typeof f.fetch>;
const mockedFetch = f.fetch as jest.MockedFunction<typeof f.fetch>; // NOSONAR
const { Response } = jest.requireActual<typeof f>('fetch-h2');

describe('getPosts', () => {
Expand Down

0 comments on commit c46246a

Please sign in to comment.