mirror of
https://github.com/svg/svgo.git
synced 2026-01-27 07:02:06 +03:00
Update CI config (#1397)
* separate lint step to a new job and run it only once * add caching
This commit is contained in:
30
.github/workflows/main.yml
vendored
30
.github/workflows/main.yml
vendored
@@ -1,6 +1,7 @@
|
||||
name: CI
|
||||
env:
|
||||
FORCE_COLOR: 2
|
||||
NODE: 14
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
@@ -9,6 +10,25 @@ on:
|
||||
branches:
|
||||
- master
|
||||
jobs:
|
||||
lint:
|
||||
name: Lint
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- uses: actions/setup-node@v2
|
||||
with:
|
||||
node-version: ${{ env.NODE }}
|
||||
- name: Set up npm cache
|
||||
uses: actions/cache@v2
|
||||
with:
|
||||
path: |
|
||||
~/.npm
|
||||
~/.cache/ms-playwright
|
||||
key: ${{ runner.os }}-node-${{ env.NODE }}-${{ hashFiles('package-lock.json') }}
|
||||
restore-keys: |
|
||||
${{ runner.os }}-node-${{ env.NODE }}-${{ hashFiles('package-lock.json') }}
|
||||
- run: npm ci
|
||||
- run: npm run lint
|
||||
test:
|
||||
name: Node.js ${{ matrix.node-version }}
|
||||
runs-on: ubuntu-latest
|
||||
@@ -25,7 +45,15 @@ jobs:
|
||||
- uses: actions/setup-node@v2
|
||||
with:
|
||||
node-version: ${{ matrix.node-version }}
|
||||
- name: Set up npm cache
|
||||
uses: actions/cache@v2
|
||||
with:
|
||||
path: |
|
||||
~/.npm
|
||||
~/.cache/ms-playwright
|
||||
key: ${{ runner.os }}-node-${{ matrix.node-version }}-${{ hashFiles('package-lock.json') }}
|
||||
restore-keys: |
|
||||
${{ runner.os }}-node-${{ matrix.node-version }}-${{ hashFiles('package-lock.json') }}
|
||||
- run: npm ci
|
||||
- run: npm test
|
||||
- run: npm run test-browser
|
||||
- run: npm run lint
|
||||
|
||||
Reference in New Issue
Block a user