Skip to content

Commit

Permalink
Update nodejs.yml (#23)
Browse files Browse the repository at this point in the history
  • Loading branch information
sam bacha authored Feb 13, 2021
1 parent d0290b8 commit f1deccd
Showing 1 changed file with 46 additions and 0 deletions.
46 changes: 46 additions & 0 deletions .github/workflows/nodejs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
# GitHub Nodejs CI
name: nodejs

on: [pull_request]

env:
CI: true
FORCE_COLOR: 2


jobs:
run:
name: Node ${{ matrix.node }} on ${{ matrix.os }}
runs-on: ${{ matrix.os }}

strategy:
fail-fast: false
matrix:
node: ["12.x", "14.x"]
os: ["ubuntu-latest"]

steps:
- uses: actions/checkout@v2.3.4
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v2.1.4
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)"

# Cache Optimization

- uses: actions/cache@v2.1.4
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, build, and test
run: |
yarn install
env:
CI: true

0 comments on commit f1deccd

Please sign in to comment.