update npm globally at an earlier step of each job (#124)
* update npm globally at an earlier step of each job * execute `npm update` with sudo * seprate windows jobs from linux,mac jobs * upgrade npm to latest on windows * upgrade npm to latest on windows
This commit is contained in:
20
.github/workflows/daily.yml
vendored
20
.github/workflows/daily.yml
vendored
@@ -9,7 +9,7 @@ jobs:
|
|||||||
name: npm audit
|
name: npm audit
|
||||||
strategy:
|
strategy:
|
||||||
matrix:
|
matrix:
|
||||||
os: [ ubuntu-latest, windows-latest, macos-latest ]
|
os: [ ubuntu-latest, macos-latest ]
|
||||||
runs-on: ${{ matrix.os }}
|
runs-on: ${{ matrix.os }}
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v3
|
- uses: actions/checkout@v3
|
||||||
@@ -21,3 +21,21 @@ jobs:
|
|||||||
issue_assignees: oke-py
|
issue_assignees: oke-py
|
||||||
issue_labels: vulnerability
|
issue_labels: vulnerability
|
||||||
dedupe_issues: true
|
dedupe_issues: true
|
||||||
|
|
||||||
|
scan-on-windows:
|
||||||
|
name: npm audit
|
||||||
|
runs-on: windows-latest
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v3
|
||||||
|
# https://stackoverflow.com/questions/72401421/message-npm-warn-config-global-global-local-are-deprecated-use-loc
|
||||||
|
- run: |
|
||||||
|
npm install npm-windows-upgrade --location=global
|
||||||
|
npm-windows-upgrade --npm-version latest
|
||||||
|
- name: install dependencies
|
||||||
|
run: npm ci
|
||||||
|
- uses: oke-py/npm-audit-action@v2
|
||||||
|
with:
|
||||||
|
github_token: ${{ secrets.GITHUB_TOKEN }}
|
||||||
|
issue_assignees: oke-py
|
||||||
|
issue_labels: vulnerability
|
||||||
|
dedupe_issues: true
|
||||||
|
|||||||
37
.github/workflows/test.yml
vendored
37
.github/workflows/test.yml
vendored
@@ -10,7 +10,7 @@ jobs:
|
|||||||
build: # make sure build/ci work properly
|
build: # make sure build/ci work properly
|
||||||
strategy:
|
strategy:
|
||||||
matrix:
|
matrix:
|
||||||
os: [ ubuntu-latest, windows-latest, macos-latest ]
|
os: [ ubuntu-latest, macos-latest ]
|
||||||
runs-on: ${{ matrix.os }}
|
runs-on: ${{ matrix.os }}
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v3
|
- uses: actions/checkout@v3
|
||||||
@@ -21,10 +21,22 @@ jobs:
|
|||||||
with:
|
with:
|
||||||
github-token: ${{ secrets.GITHUB_TOKEN }}
|
github-token: ${{ secrets.GITHUB_TOKEN }}
|
||||||
|
|
||||||
|
build-on-windows:
|
||||||
|
runs-on: windows-latest
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v3
|
||||||
|
# https://stackoverflow.com/questions/72401421/message-npm-warn-config-global-global-local-are-deprecated-use-loc
|
||||||
|
- run: |
|
||||||
|
npm install npm-windows-upgrade --location=global
|
||||||
|
npm-windows-upgrade --npm-version latest
|
||||||
|
- run: |
|
||||||
|
npm ci
|
||||||
|
npm run all
|
||||||
|
|
||||||
test: # make sure the action works on a clean machine without building
|
test: # make sure the action works on a clean machine without building
|
||||||
strategy:
|
strategy:
|
||||||
matrix:
|
matrix:
|
||||||
os: [ ubuntu-latest, windows-latest, macos-latest ]
|
os: [ ubuntu-latest, macos-latest ]
|
||||||
runs-on: ${{ matrix.os }}
|
runs-on: ${{ matrix.os }}
|
||||||
steps:
|
steps:
|
||||||
- name: Dump GitHub context
|
- name: Dump GitHub context
|
||||||
@@ -40,3 +52,24 @@ jobs:
|
|||||||
with:
|
with:
|
||||||
github_token: ${{ secrets.GITHUB_TOKEN }}
|
github_token: ${{ secrets.GITHUB_TOKEN }}
|
||||||
working_directory: __tests__/testdata/workdir/
|
working_directory: __tests__/testdata/workdir/
|
||||||
|
|
||||||
|
test-on-windows:
|
||||||
|
runs-on: windows-latest
|
||||||
|
steps:
|
||||||
|
- name: Dump GitHub context
|
||||||
|
env:
|
||||||
|
GITHUB_CONTEXT: ${{ toJson(github) }}
|
||||||
|
run: echo "$GITHUB_CONTEXT"
|
||||||
|
- uses: actions/checkout@v3
|
||||||
|
# https://stackoverflow.com/questions/72401421/message-npm-warn-config-global-global-local-are-deprecated-use-loc
|
||||||
|
- run: |
|
||||||
|
npm install npm-windows-upgrade --location=global
|
||||||
|
npm-windows-upgrade --npm-version latest
|
||||||
|
- uses: ./
|
||||||
|
with:
|
||||||
|
github_token: ${{ secrets.GITHUB_TOKEN }}
|
||||||
|
issue_title: npm audit run by test job
|
||||||
|
- uses: ./
|
||||||
|
with:
|
||||||
|
github_token: ${{ secrets.GITHUB_TOKEN }}
|
||||||
|
working_directory: __tests__/testdata/workdir/
|
||||||
|
|||||||
Reference in New Issue
Block a user