Skip to content

Commit

Permalink
ci: use caching
Browse files Browse the repository at this point in the history
  • Loading branch information
G-Rath committed Mar 8, 2024
1 parent d70da8a commit e85b4cc
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 0 deletions.
2 changes: 2 additions & 0 deletions .github/workflows/dummy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,11 @@ jobs:
- uses: actions/setup-node@v3
with:
node-version: '16'
cache: yarn
- uses: ruby/setup-ruby@v1
with:
ruby-version: '3.1.2'
bundler-cache: true
- name: Install dependencies
run: |
bundle install
Expand Down
26 changes: 26 additions & 0 deletions .github/workflows/generator.yml
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,32 @@ jobs:
bundle config --local path vendor/bundle
- name: Install dependencies
run: bundle install

- name: Get npm cache directory
id: npm-cache-dir
shell: bash
run: echo "dir=$(npm config get cache)" >> ${GITHUB_OUTPUT}

- uses: actions/cache@v3
id: npm-cache # use this to check for `cache-hit` ==> if: steps.npm-cache.outputs.cache-hit != 'true'
with:
path: ${{ steps.npm-cache-dir.outputs.dir }}
key: generator-${{ runner.os }}-npm-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
generator-${{ runner.os }}-npm-
- name: Get yarn cache directory path
id: yarn-cache-dir-path
run: echo "dir=$(yarn cache dir)" >> $GITHUB_OUTPUT

- uses: actions/cache@v3
id: yarn-cache # use this to check for `cache-hit` (`steps.yarn-cache.outputs.cache-hit != 'true'`)
with:
path: ${{ steps.yarn-cache-dir-path.outputs.dir }}
key: generator-${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
restore-keys: |
generator-${{ runner.os }}-yarn-
- run: bundle exec rake run_spec:generator
env:
SHAKAPACKER_USE_PACKAGE_JSON_GEM: ${{ matrix.use_package_json_gem }}

0 comments on commit e85b4cc

Please sign in to comment.