mirror of
https://github.com/vector-im/hydrogen-web.git
synced 2024-12-23 19:45:05 +01:00
Merge pull request #363 from vector-im/bwindels/cache-ci-deps
Enable yarn cache in github actions
This commit is contained in:
commit
bc09ed8bf6
22
.github/workflows/codechecks.js.yml
vendored
22
.github/workflows/codechecks.js.yml
vendored
@ -1,6 +1,8 @@
|
||||
# This workflow will do a clean install of node dependencies, build the source code and run tests across different versions of node
|
||||
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-nodejs-with-github-actions
|
||||
|
||||
# yarn cache setup from https://www.karltarvas.com/2020/12/09/github-actions-cache-yarn-install.html
|
||||
|
||||
name: Code checks
|
||||
|
||||
on:
|
||||
@ -19,15 +21,25 @@ jobs:
|
||||
node-version: [14.x]
|
||||
|
||||
steps:
|
||||
- name: Checkout project source
|
||||
- name: Checkout source
|
||||
uses: actions/checkout@v2
|
||||
- name: Install tools
|
||||
uses: actions/setup-node@v2
|
||||
with:
|
||||
node-version: ${{ matrix.node-version }}
|
||||
- name: Install project dependencies
|
||||
run: npm install --also=dev
|
||||
# See: https://github.com/actions/cache/blob/main/examples.md#node---yarn
|
||||
- name: Get Yarn cache directory
|
||||
id: yarn-cache-dir-path
|
||||
run: echo "::set-output name=dir::$(yarn cache dir)"
|
||||
- name: Use Yarn cache
|
||||
uses: actions/cache@v2
|
||||
id: yarn-cache
|
||||
with:
|
||||
path: ${{ steps.yarn-cache-dir-path.outputs.dir }}
|
||||
key: ${{ runner.os }}-yarn-${{ matrix.node-version }}-${{ hashFiles('**/yarn.lock') }}
|
||||
- name: Install dependencies
|
||||
run: yarn install --prefer-offline --frozen-lockfile
|
||||
- name: Unit tests
|
||||
run: npm test
|
||||
run: yarn test
|
||||
- name: Lint
|
||||
run: npm run lint-ci
|
||||
run: yarn run lint-ci
|
Loading…
Reference in New Issue
Block a user