-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
f6c3439
commit b44c124
Showing
1 changed file
with
31 additions
and
20 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 |
---|---|---|
@@ -1,35 +1,46 @@ | ||
name: test | ||
|
||
on: | ||
push: {branches: master} | ||
pull_request: {branches: master} | ||
push: | ||
branches: | ||
- "+([0-9])?(.{+([0-9]),x}).x" | ||
- "master" | ||
- "next" | ||
- "next-major" | ||
- "beta" | ||
- "alpha" | ||
- "!all-contributors/**" | ||
pull_request: {} | ||
|
||
jobs: | ||
test: | ||
# ignore all-contributors PRs | ||
if: ${{ !contains(github.head_ref, 'all-contributors') }} | ||
|
||
name: Test | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: Checkout code | ||
uses: actions/checkout@v1 | ||
- name: 🛑 Cancel Previous Runs | ||
uses: styfle/[email protected] | ||
with: | ||
access_token: ${{ secrets.GITHUB_TOKEN }} | ||
|
||
- name: ⬇️ Checkout repo | ||
uses: actions/checkout@v2 | ||
|
||
- name: Setup Node | ||
- name: ⎔ Setup node | ||
uses: actions/setup-node@v1 | ||
with: | ||
node-version: 10.13.0 | ||
node-version: 14 | ||
|
||
- name: Cache NPM dependencies | ||
uses: actions/cache@v2 | ||
- name: 📥 Download deps | ||
uses: bahmutov/npm-install@v1 | ||
with: | ||
path: ~/.npm | ||
key: ${{ runner.os }}-npm-${{ hashFiles('**/package-lock.json') }} | ||
restore-keys: | | ||
${{ runner.os }}-npm- | ||
- name: Install NPM dependencies | ||
run: npm ci | ||
|
||
- name: Run tests | ||
run: | | ||
npm run build | ||
npm run test | ||
useLockFile: false | ||
|
||
- name: 🏗 Run build script | ||
run: npm run build | ||
|
||
- name: ▶️ Run test script | ||
run: npm run test |