Use safer node_modules cache (#803)

Signed-off-by: Tilman Vatteroth <tilman.vatteroth@tu-dortmund.de>
This commit is contained in:
Tilman Vatteroth 2020-11-29 10:07:44 +01:00 committed by GitHub
parent e8ccd44ff7
commit 590218c7c4
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 41 additions and 14 deletions

View file

@ -20,17 +20,23 @@ jobs:
steps:
- name: Checkout repository
uses: actions/checkout@v2
- name: Get yarn cache directory path
id: yarn-cache-dir-path
run: echo "::set-output name=dir::$(yarn cache dir)"
- name: Cache node_modules
uses: actions/cache@v2.1.3
uses: actions/cache@v2
id: yarn-cache
with:
path: node_modules
key: node_modules
path: ${{ steps.yarn-cache-dir-path.outputs.dir }}
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
restore-keys: |
${{ runner.os }}-yarn-
- name: Set up NodeJS
uses: actions/setup-node@v1
with:
node-version: ${{ matrix.node }}
- name: Install dependencies
run: yarn install
run: yarn install --frozen-lockfile --prefer-offline
- name: Test Project
run: yarn test
- name: Build project

View file

@ -16,20 +16,32 @@ jobs:
name: build frontend
steps:
- uses: actions/checkout@v2
- name: Get yarn cache directory path
id: yarn-cache-dir-path
run: echo "::set-output name=dir::$(yarn cache dir)"
- name: Cache build
uses: actions/cache@v2.1.3
with:
path: build
key: build
- name: Cache node_modules
uses: actions/cache@v2.1.3
uses: actions/cache@v2
id: yarn-cache
with:
path: node_modules
key: node_modules
- uses: actions/setup-node@v1
path: ${{ steps.yarn-cache-dir-path.outputs.dir }}
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
restore-keys: |
${{ runner.os }}-yarn-
- name: Set up NodeJS
uses: actions/setup-node@v1
with:
node-version: '14'
- run: yarn install
node-version: 14
- run: yarn install --frozen-lockfile --prefer-offline
- run: yarn build
- uses: actions/upload-artifact@master
with:

View file

@ -17,16 +17,25 @@ jobs:
steps:
- name: Checkout repository
uses: actions/checkout@v2
- name: Get yarn cache directory path
id: yarn-cache-dir-path
run: echo "::set-output name=dir::$(yarn cache dir)"
- name: Cache node_modules
uses: actions/cache@v2.1.3
uses: actions/cache@v2
id: yarn-cache
with:
path: node_modules
key: node_modules
path: ${{ steps.yarn-cache-dir-path.outputs.dir }}
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
restore-keys: |
${{ runner.os }}-yarn-
- name: Set up NodeJS
uses: actions/setup-node@v1
with:
node-version: 14
- name: Install dependencies
run: yarn install
run: yarn install --frozen-lockfile --prefer-offline
- name: Lint code
run: yarn lint