Skip to content

Commit

Permalink
add .github/workflows/
Browse files Browse the repository at this point in the history
  • Loading branch information
dankogai committed May 25, 2022
1 parent f32b44a commit 36c530e
Showing 1 changed file with 33 additions and 0 deletions.
33 changes: 33 additions & 0 deletions .github/workflows/node.js.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
# cf.
# https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-nodejs#starting-with-the-nodejs-workflow-template
# https://dev.classmethod.jp/articles/caching-dependencies-in-workflow-execution-on-github-actions/
name: CI via GitHub Actions

on:
push:
branches: [ main ]
pull_request:
branches: [ main ]

jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [16]
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}
- uses: actions/cache@v3
id: node_modules_cache_id
env:
cache-name: cache-node-modules
with:
path: '**/node_modules'
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/package-lock.json') }}
- run: echo '${{ toJSON(steps.node_modules_cache_id.outputs) }}'
- if: ${{ steps.node_modules_cache_id.outputs.cache-hit != 'true' }}
run: npm install
- run: npm test

0 comments on commit 36c530e

Please sign in to comment.