Skip to content

Commit

Permalink
Try cache of nodemodules
Browse files Browse the repository at this point in the history
# Conflicts:
#	.github/workflows/ci.yml
  • Loading branch information
rodrigok committed Feb 23, 2023
1 parent a4a573d commit b59c99d
Show file tree
Hide file tree
Showing 5 changed files with 31 additions and 19 deletions.
24 changes: 22 additions & 2 deletions .github/actions/setup-node/action.yml
Expand Up @@ -2,9 +2,14 @@ name: 'Setup Node'

inputs:
node-version:
# default: '14.21.2'
required: true
type: string
cache-modules:
required: false
type: boolean
install:
required: false
type: boolean

outputs:
node-version:
Expand All @@ -14,9 +19,24 @@ runs:
using: composite

steps:
- name: Cache Node Modules
if: inputs.cache-modules
id: cache-node-modules
uses: actions/cache@v3
with:
path: |
node_modules
apps/meteor/node_modules
key: node-modules-${{ hashFiles('yarn.lock') }}

- name: Use Node.js ${{ inputs.node-version }}
id: node-version
uses: actions/setup-node@v3
with:
node-version: ${{ inputs.node-version }}
cache: 'yarn'
# cache: 'yarn'

- name: yarn install
if: inputs.install && steps.cache-node-modules.outputs.cache-hit != 'true'
shell: bash
run: yarn
14 changes: 3 additions & 11 deletions .github/workflows/ci-code-check.yml
Expand Up @@ -33,26 +33,18 @@ jobs:
uses: ./.github/actions/setup-node
with:
node-version: ${{ inputs.node-version }}
cache-modules: true
install: true

# - name: Free disk space
# run: |
# sudo apt clean
# docker rmi $(docker image ls -aq)
# df -h

# - name: Versions
# run: |
# npm --versions
# yarn -v
# node -v
# git version

- name: yarn install
run: yarn

- uses: dtinth/setup-github-actions-caching-for-turbo@v1

- name: TS typecheck
- name: TS TypeCheck
if: matrix.check == 'ts'
run: yarn turbo run typecheck

Expand Down
2 changes: 2 additions & 0 deletions .github/workflows/ci-test-e2e.yml
Expand Up @@ -90,6 +90,8 @@ jobs:
uses: ./.github/actions/setup-node
with:
node-version: ${{ inputs.node-version }}
cache-modules: true
install: true

- uses: dtinth/setup-github-actions-caching-for-turbo@v1

Expand Down
5 changes: 2 additions & 3 deletions .github/workflows/ci-test-unit.yml
Expand Up @@ -38,9 +38,8 @@ jobs:
uses: ./.github/actions/setup-node
with:
node-version: ${{ inputs.node-version }}

- name: yarn install
run: yarn
cache-modules: true
install: true

- uses: dtinth/setup-github-actions-caching-for-turbo@v1

Expand Down
5 changes: 2 additions & 3 deletions .github/workflows/ci.yml
Expand Up @@ -106,6 +106,8 @@ jobs:
uses: ./.github/actions/setup-node
with:
node-version: ${{ needs.release-versions.outputs.node-version }}
cache-modules: true
install: true

# - name: Free disk space
# run: |
Expand Down Expand Up @@ -158,9 +160,6 @@ jobs:
meteor node -v
git version
- name: yarn install
run: yarn

- uses: dtinth/setup-github-actions-caching-for-turbo@v1

- name: Translation check
Expand Down

0 comments on commit b59c99d

Please sign in to comment.