Improve workflow and lint the code

This commit is contained in:
Shivam Mathur
2019-11-24 02:04:12 +05:30
parent 2b938d931a
commit 3f6c88dec7
18 changed files with 1531 additions and 474 deletions

View File

@ -1,5 +1,19 @@
name: Main workflow
on: [push, pull_request]
on:
pull_request:
branches:
- master
- develop
- verbose
paths-ignore:
- '**.md'
push:
branches:
- master
- develop
- verbose
paths-ignore:
- '**.md'
jobs:
run:
name: Run
@ -20,11 +34,14 @@ jobs:
with:
node-version: 12.x
- name: Cache node modules
uses: actions/cache@preview
id: cache
- name: Get npm cache directory
id: npm-cache
run: echo "::set-output name=dir::$(npm config get cache)"
- name: Install dependencies
uses: actions/cache@v1
with:
path: node_modules
path: ${{ steps.npm-cache.outputs.dir }}
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.os }}-node-
@ -33,12 +50,18 @@ jobs:
if: steps.cache.outputs.cache-hit != 'true'
run: npm install
- name: Prettier Format Check
run: npm run format-check
- name: ESLint Check
run: npm run lint
- name: Run tests
run: npm test
- name: Send Coverage
continue-on-error: true
timeout-minutes: 2
timeout-minutes: 1
run: curl -s https://codecov.io/bash | bash -s -- -t ${{secrets.CODECOV_TOKEN}} -f coverage/clover.xml -n github-actions-codecov-${{ matrix.operating-system }}-php${{ matrix.php-versions }}
- name: Setup PHP with extensions and custom config