Ci/caching #306
1 changed files with 57 additions and 9 deletions
66
.github/workflows/nodejs.yml
vendored
66
.github/workflows/nodejs.yml
vendored
|
@ -6,19 +6,50 @@ on:
|
||||||
branches: [master]
|
branches: [master]
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
lint:
|
dependencies:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
|
|
||||||
|
strategy:
|
||||||
|
matrix:
|
||||||
|
node-version: [14, 16, 18]
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v3
|
- uses: actions/checkout@v3
|
||||||
- name: Use Node.js 12.x
|
- uses: actions/setup-node@v3
|
||||||
uses: actions/setup-node@v3
|
with:
|
||||||
|
node-version: ${{ matrix.node-version }}
|
||||||
|
- uses: actions/cache@v3
|
||||||
|
id: dependencies-cache
|
||||||
|
env:
|
||||||
|
cache-name: dependencies-cache
|
||||||
|
with:
|
||||||
|
path: .yarn
|
||||||
|
key: ${{ runner.os }}-build-${{env.cache-name}}-${{ hashFiles('**/yarn.lock') }}-node-${{ matrix.node-version }}
|
||||||
|
- if: ${{ steps.cache-npm.outputs.cache-hit != 'true' }}
|
||||||
|
run: yarn
|
||||||
|
|
||||||
|
lint:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
needs: dependencies
|
||||||
|
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v3
|
||||||
|
- uses: actions/setup-node@v3
|
||||||
with:
|
with:
|
||||||
node-version: 18
|
node-version: 18
|
||||||
- run: yarn
|
- uses: actions/cache@v3
|
||||||
- run: yarn lint
|
id: dependencies-cache
|
||||||
|
env:
|
||||||
|
cache-name: dependencies-cache
|
||||||
|
with:
|
||||||
|
path: .yarn
|
||||||
|
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/yarn.lock') }}-node-18
|
||||||
|
- run: |
|
||||||
|
yarn
|
||||||
|
yarn lint
|
||||||
test:
|
test:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
|
needs: dependencies
|
||||||
|
|
||||||
strategy:
|
strategy:
|
||||||
matrix:
|
matrix:
|
||||||
|
@ -30,8 +61,16 @@ jobs:
|
||||||
uses: actions/setup-node@v3
|
uses: actions/setup-node@v3
|
||||||
with:
|
with:
|
||||||
node-version: ${{ matrix.node-version }}
|
node-version: ${{ matrix.node-version }}
|
||||||
- run: yarn
|
- uses: actions/cache@v3
|
||||||
- run: yarn test:coverage
|
id: dependencies-cache
|
||||||
|
env:
|
||||||
|
cache-name: dependencies-cache
|
||||||
|
with:
|
||||||
|
path: .yarn
|
||||||
|
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/yarn.lock') }}-node-${{ matrix.node-version }}
|
||||||
|
- run: |
|
||||||
|
yarn
|
||||||
|
yarn test:coverage
|
||||||
- name: Coverage
|
- name: Coverage
|
||||||
uses: codecov/codecov-action@v1
|
uses: codecov/codecov-action@v1
|
||||||
with:
|
with:
|
||||||
|
@ -40,6 +79,7 @@ jobs:
|
||||||
|
|
||||||
build:
|
build:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
|
needs: dependencies
|
||||||
strategy:
|
strategy:
|
||||||
matrix:
|
matrix:
|
||||||
node-version: [14, 16, 18]
|
node-version: [14, 16, 18]
|
||||||
|
@ -50,5 +90,13 @@ jobs:
|
||||||
uses: actions/setup-node@v3
|
uses: actions/setup-node@v3
|
||||||
with:
|
with:
|
||||||
node-version: ${{ matrix.node-version }}
|
node-version: ${{ matrix.node-version }}
|
||||||
- run: yarn --immutable
|
- uses: actions/cache@v3
|
||||||
- run: yarn build
|
id: dependencies-cache
|
||||||
|
env:
|
||||||
|
cache-name: dependencies-cache
|
||||||
|
with:
|
||||||
|
path: .yarn
|
||||||
|
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/yarn.lock') }}-node-${{ matrix.node-version }}
|
||||||
|
- run: |
|
||||||
|
yarn
|
||||||
|
yarn build
|
||||||
|
|
Reference in a new issue