mirror of
https://github.com/hedgedoc/hedgedoc.git
synced 2025-04-22 09:59:27 +00:00
Use safer node_modules cache (#803)
Signed-off-by: Tilman Vatteroth <tilman.vatteroth@tu-dortmund.de>
This commit is contained in:
parent
e8ccd44ff7
commit
590218c7c4
3 changed files with 41 additions and 14 deletions
14
.github/workflows/build.yml
vendored
14
.github/workflows/build.yml
vendored
|
@ -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
|
||||
|
|
24
.github/workflows/e2e.yml
vendored
24
.github/workflows/e2e.yml
vendored
|
@ -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:
|
||||
|
|
17
.github/workflows/lint.yml
vendored
17
.github/workflows/lint.yml
vendored
|
@ -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
|
||||
|
|
Loading…
Add table
Reference in a new issue