Skip to content

Commit

Permalink
chore: Improved workflow with caching
Browse files Browse the repository at this point in the history
  • Loading branch information
mmazzarolo committed Oct 11, 2020
1 parent ccb8ffe commit 6b5df4f
Show file tree
Hide file tree
Showing 2 changed files with 34 additions and 24 deletions.
17 changes: 14 additions & 3 deletions .github/workflows/release.yml
Expand Up @@ -10,13 +10,24 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v1
- name: Setup Node.js
uses: actions/checkout@v2

- name: Setup node
uses: actions/setup-node@v1
with:
node-version: '13.x'
node-version: '12.x'

- name: Restore ~/.npm cache
uses: actions/cache@v2
with:
path: ~/.npm
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.os }}-node-
- name: Install dependencies
run: npm ci

- name: Release
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
Expand Down
41 changes: 20 additions & 21 deletions .github/workflows/test.yml
Expand Up @@ -9,29 +9,28 @@ on:
- master

jobs:
install:
test:
runs-on: ubuntu-latest
name: Install
name: Test & Lint
steps:
- uses: actions/checkout@v1
- uses: actions/setup-node@v1
with:
node-version: '13.x'
- run: npm install
- uses: actions/cache@v1
id: cache-build
- name: Checkout
uses: actions/checkout@v2

- name: Setup node
uses: actions/setup-node@v1
with:
path: '.'
key: ${{ github.sha }}
node-version: '12.x'

lint:
runs-on: ubuntu-latest
name: Lint
needs: install
steps:
- uses: actions/cache@v1
id: restore-build
- name: Restore ~/.npm cache
uses: actions/cache@v2
with:
path: '.'
key: ${{ github.sha }}
- run: npm run lint
path: ~/.npm
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.os }}-node-
- name: Install dependencies
run: npm ci

- name: Run lint
run: npm run lint

0 comments on commit 6b5df4f

Please sign in to comment.