Skip to content

Commit

Permalink
Module install optimization
Browse files Browse the repository at this point in the history
- Do not install modules during the cache population step if there is a cache hit (also skips installing if there is a cache hit)
- Populate or verify the module cache before allowing any other step to proceed
  • Loading branch information
huntharo committed Apr 25, 2024
1 parent ef727b7 commit 9c964ab
Show file tree
Hide file tree
Showing 3 changed files with 28 additions and 0 deletions.
10 changes: 10 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,16 @@ env:
AWS_REGION: us-east-2

jobs:
install-deps:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: ./.github/actions/configure-nodejs
with:
lookup-only: 'true' # We only want to lookup from the cache - if a hit, this job does nothing

build:
needs: [install-deps]
runs-on: ubuntu-latest
outputs:
prSuffix: ${{ steps.prSuffix.outputs.prSuffix }}
Expand Down Expand Up @@ -578,6 +587,7 @@ jobs:
build-jsii:
# if: github.event_name != 'pull_request' || (github.event_name == 'pull_request' && contains( github.event.pull_request.labels.*.name, 'BUILD-JSII')) || (github.event_name == 'pull_request' && github.actor == 'dependabot[bot]')
needs: [install-deps]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
Expand Down
9 changes: 9 additions & 0 deletions .github/workflows/main-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,17 @@ on:
# - main

jobs:
install-deps:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: ./.github/actions/configure-nodejs
with:
lookup-only: 'true' # We only want to lookup from the cache - if a hit, this job does nothing

build:
name: Build CDK Construct
needs: [install-deps]
runs-on: ubuntu-latest
permissions:
contents: write
Expand Down
9 changes: 9 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,20 @@ on:
release:
types: [published]
jobs:
install-deps:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: ./.github/actions/configure-nodejs
with:
lookup-only: 'true' # We only want to lookup from the cache - if a hit, this job does nothing

#
# CDK Construct
#
release:
name: Build CDK Construct
needs: [install-deps]
runs-on: ubuntu-latest
permissions:
contents: write
Expand Down

0 comments on commit 9c964ab

Please sign in to comment.