Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Try to reuse npm-package #1635

Merged
merged 2 commits into from
Aug 28, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 4 additions & 13 deletions .github/workflows/code-scanning.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,19 +15,10 @@ env:
tool_ruby_version: "2.7.7"
jobs:
npm-package-download: # this downloads and caches all of the packages. We need this run on main so PRs to main can reuse the cache
name: Download and cache any npm packages
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-20.04]
node: ["14.x"]
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node }}
cache: 'yarn'
- run: yarn install --frozen-lockfile
uses: './.github/workflows/npm-cache-packages.yml'
with:
os: ubuntu-20.04
node: 14.x

gem-package-download: # this downloads and caches all of the packages. We need this run on main so PRs to main can reuse the cache
name: Download and cache any gem packages
Expand Down
21 changes: 21 additions & 0 deletions .github/workflows/npm-cache-packages.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
name: Download and cache any npm packages
on:
workflow_call:
inputs:
os:
required: true
type: string
node:
required: true
type: string
jobs:
npm-package-download:
name: Download NPM packages
runs-on: ${{ inputs.os }}
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: ${{ inputs.node }}
cache: 'yarn'
- run: yarn install --frozen-lockfile
14 changes: 4 additions & 10 deletions .github/workflows/pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,21 +27,15 @@ jobs:


npm-package-download: # this downloads and caches all of the packages. That way if a future job fails, the caching will still occur
name: Download and cache any npm packages
needs: changes
uses: "./.github/workflows/npm-cache-packages.yml"
if: ${{ contains(needs.changes.outputs.filters, 'build-js') }}
runs-on: ${{ matrix.os }}
with:
node: ${{ matrix.node }}
os: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-20.04]
node: ["14.x"]
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node }}
cache: 'yarn'
- run: yarn install --frozen-lockfile

gem-package-download: # this downloads and caches all of the packages. That way if a future job fails, the caching will still occur
name: Download and cache any gem packages
Expand Down