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

cache installed deps on CI #4796

Open
wants to merge 13 commits into
base: main
Choose a base branch
from
56 changes: 34 additions & 22 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,18 @@ jobs:
run: node common/scripts/install-run-rush.js change --verify
working-directory: repo-a

- name: Cache Rush Installed Dependencies
id: cache-deps
uses: actions/cache@v3
with:
path: |
repo-a/common/temp/node_modules
repo-a/common/temp/**/node_modules
repo-a/common/pnpm-store

# If lock files have changed, then we should reasonably assume that a new install is needed
key: ${{ matrix.NodeVersionDisplayName }}+(${{ matrix.OS }})-${{ hashFiles('repo-a/common/**/pnpm-lock.yaml') }}

- name: Rush Install
run: node common/scripts/install-run-rush.js install
working-directory: repo-a
Expand All @@ -67,30 +79,30 @@ jobs:
# run: /usr/bin/Xvfb :99 -screen 0 1024x768x24 > /dev/null 2>&1 &
# working-directory: repo-a

- name: Rush retest (install-run-rush)
run: node common/scripts/install-run-rush.js retest --verbose --production
working-directory: repo-a
# - name: Rush retest (install-run-rush)
# run: node common/scripts/install-run-rush.js retest --verbose --production
# working-directory: repo-a

- name: Ensure repo README is up-to-date
run: node repo-scripts/repo-toolbox/lib/start.js readme --verify
working-directory: repo-a
# - name: Ensure repo README is up-to-date
# run: node repo-scripts/repo-toolbox/lib/start.js readme --verify
# working-directory: repo-a

- name: Clone another copy of the repo to test the build cache
uses: actions/checkout@v3
with:
fetch-depth: 1
path: repo-b
# - name: Clone another copy of the repo to test the build cache
# uses: actions/checkout@v3
# with:
# fetch-depth: 1
# path: repo-b

- name: Git config user
run: |
git config --local user.name "Rushbot"
git config --local user.email "[email protected]"
working-directory: repo-b
# - name: Git config user
# run: |
# git config --local user.name "Rushbot"
# git config --local user.email "[email protected]"
# working-directory: repo-b

- name: Rush update (rush-lib)
run: node ${{ github.workspace }}/repo-a/apps/rush/lib/start-dev.js update
working-directory: repo-b
# - name: Rush update (rush-lib)
# run: node ${{ github.workspace }}/repo-a/apps/rush/lib/start-dev.js update
# working-directory: repo-b

- name: Rush test (rush-lib)
run: node ${{ github.workspace }}/repo-a/apps/rush/lib/start-dev.js test --verbose --production --timeline
working-directory: repo-b
# - name: Rush test (rush-lib)
# run: node ${{ github.workspace }}/repo-a/apps/rush/lib/start-dev.js test --verbose --production --timeline
# working-directory: repo-b
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,5 @@
{
"pnpmShrinkwrapHash": "c040a0d59aada7e1f9bdf0916df7079547de3a85",
"preferredVersionsHash": "ce857ea0536b894ec8f346aaea08cfd85a5af648",
"packageJsonInjectedDependenciesHash": "25b153582664854d3f0080a8d4fb2ce9dd409aed"
"packageJsonInjectedDependenciesHash": "faf9f64843602dd4f48cdea4308e7b00fe222387"
}
Loading