mirror of
https://github.com/shivammathur/setup-php.git
synced 2025-07-31 10:47:27 +07:00
Improve workflow and lint the code
This commit is contained in:
35
.github/workflows/workflow.yml
vendored
35
.github/workflows/workflow.yml
vendored
@ -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
|
||||
|
Reference in New Issue
Block a user