Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
88 changes: 82 additions & 6 deletions .github/workflows/nodejs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,13 @@ name: CI
on:
push:
branches:
- "**"
schedule:
- cron: '0 0 * * *'
- master
pull_request:
types: [opened, synchronize, reopened]
workflow_dispatch:

jobs:
build:
test:

runs-on: ubuntu-latest

Expand All @@ -19,12 +20,87 @@ jobs:
steps:
- uses: actions/checkout@v2
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v1
uses: actions/setup-node@v2
with:
node-version: ${{ matrix.node-version }}

- name: yarn install
run: |
yarn install --frozen-lockfile --verbose
env:
CI: true

- name: Run test
run: |
yarn test
env:
CI: true

test-with-cache-dir:

runs-on: ubuntu-latest

strategy:
matrix:
node-version: [12.x, 14.x]

steps:
- uses: actions/checkout@v2
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v2
with:
node-version: ${{ matrix.node-version }}

- name: Get yarn cache directory path
id: yarn-cache-dir-path
run: echo "::set-output name=dir::$(yarn cache dir)"

- uses: actions/cache@v2
id: yarn-cache # use this to check for `cache-hit` (`steps.yarn-cache.outputs.cache-hit != 'true'`)
with:
path: ${{ steps.yarn-cache-dir-path.outputs.dir }}
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
restore-keys: |
${{ runner.os }}-yarn-

- name: yarn install
run: |
yarn install --frozen-lockfile --verbose
env:
CI: true

- name: Run test
run: |
yarn test
env:
CI: true

test-with-cache:

runs-on: ubuntu-latest

strategy:
matrix:
node-version: [12.x, 14.x]

steps:
- uses: actions/checkout@v2
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v2
with:
node-version: ${{ matrix.node-version }}

- name: cache node_modules
id: node_modules_cache_id
uses: actions/cache@v2
with:
path: |
node_modules
key: node-v${{ matrix.node-version }}-deps-${{ hashFiles(format('{0}{1}', github.workspace, '/yarn.lock')) }}

- name: yarn install
run: |
yarn install --frozen-lockfile
yarn install --frozen-lockfile --verbose
env:
CI: true
- name: Run test
Expand Down