| 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465 |
- name: Node CI
- on:
- push:
- branches-ignore:
- - tmp/**
- jobs:
- test:
- runs-on: ubuntu-latest
- strategy:
- matrix:
- node-version: [10.x, 12.x, 14.x]
- steps:
- - uses: actions/checkout@v2
- - name: Use Node.js ${{ matrix.node-version }}
- uses: actions/setup-node@v1
- with:
- node-version: ${{ matrix.node-version }}
- - name: Cache/Restore node_modules
- id: cache-dependencies
- uses: actions/cache@v1
- with:
- path: node_modules
- key: ${{ runner.OS }}-node_modules-${{ matrix.node-version }}-${{ hashFiles('**/yarn.lock') }}
- - name: Get yarn cache dir
- if: steps.cache-dependencies.outputs.cache-hit != 'true'
- id: cache-yarn
- run: echo "::set-output name=dir::$(yarn cache dir)"
- - name: Cache/Restore yarn cache
- if: steps.cache-dependencies.outputs.cache-hit != 'true'
- uses: actions/cache@v1
- with:
- path: ${{ steps.cache-yarn.outputs.dir }}
- key: ${{ runner.os }}-yarn-${{ matrix.node-version }}-${{ hashFiles('**/yarn.lock') }}
- restore-keys: |
- ${{ runner.os }}-yarn-${{ matrix.node-version }}-
- - name: Install dependencies
- if: steps.cache-dependencies.outputs.cache-hit != 'true'
- run: |
- yarn
- - name: Print dependencies
- run: |
- echo -n "node " && node -v
- echo -n "npm " && npm -v
- yarn list --depth=0
- - name: yarn lint
- run: |
- yarn lint
- - name: yarn test
- run: |
- yarn test
- - name: Slack Notification
- uses: weseek/ghaction-slack-notification@master
- if: failure()
- with:
- type: ${{ job.status }}
- job_name: '*test (${{ matrix.node-version }})*'
- channel: '#ci'
- isCompactMode: true
- url: ${{ secrets.SLACK_WEBHOOK_URL }}
|