Skip to content

Commit

Permalink
chore(template): update .github/workflows/test.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
Ahmad Nassri committed Feb 4, 2021
1 parent 5cd316f commit 98ee11c
Showing 1 changed file with 53 additions and 0 deletions.
53 changes: 53 additions & 0 deletions .github/workflows/test.yml
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

0 comments on commit 98ee11c

Please sign in to comment.