-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore(template): update .github/workflows/test.yml
- Loading branch information
Ahmad Nassri
committed
Feb 4, 2021
1 parent
5cd316f
commit 98ee11c
Showing
1 changed file
with
53 additions
and
0 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
name: test | ||
|
||
on: [ push, pull_request ] | ||
|
||
defaults: | ||
run: | ||
working-directory: action | ||
|
||
jobs: | ||
deduplicate: | ||
timeout-minutes: 5 | ||
|
||
runs-on: ubuntu-latest | ||
|
||
# run on external PRs, but on internal PRs as they'll be run by the push to the branch. | ||
if: github.event_name == 'push' || github.event.pull_request.head.repo.full_name != github.repository | ||
|
||
steps: | ||
- run: echo ::warning ::skipped duplicate run | ||
working-directory: . | ||
|
||
audit: | ||
timeout-minutes: 5 | ||
|
||
needs: deduplicate | ||
|
||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- uses: actions/checkout@v2 | ||
- uses: actions/[email protected] | ||
- run: npm audit --audit-level=critical | ||
|
||
test: | ||
timeout-minutes: 5 | ||
|
||
needs: audit | ||
|
||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- uses: actions/checkout@v2 | ||
- uses: actions/[email protected] | ||
with: | ||
node-version: 14 | ||
|
||
- uses: actions/cache@v2 | ||
with: | ||
path: ~/.npm | ||
key: ${{ hashFiles('**/package-lock.json') }} | ||
|
||
- run: npm ci | ||
- run: npm run test:ci |