-
-
Notifications
You must be signed in to change notification settings - Fork 251
Optimise CI to reduce runners usage, caching NPM modules when needed #918
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
Merged
cristianrgreco
merged 41 commits into
testcontainers:main
from
mdelapenya:refactor-pipeline
Mar 11, 2025
+337
−70
Merged
Changes from 10 commits
Commits
Show all changes
41 commits
Select commit
Hold shift + click to select a range
f0dffb9
chore: cache NPM dependencies in the smoke-test phase
mdelapenya ba4222a
chore: extract to reusable workflow
mdelapenya f9bd8ff
fix: use a composite action
mdelapenya 4fd8da1
chore: name step
mdelapenya d374502
fix: save cache
mdelapenya 56334fa
chore: immediately cache dependencies, not wait until the end
mdelapenya 380e478
chore: refine cache keys
mdelapenya 06371a5
chore: reuse cache in workflows
mdelapenya b4abbe5
fix: use inputs
mdelapenya 1cdcd97
chore: add workspace to cache key
mdelapenya 93d5784
fix: cache node_modules from the packages
mdelapenya 602ea54
feat: add shell script that detect changes
mdelapenya aebadac
chore: use script in the pipeline
mdelapenya 7afe848
chore: run lint in the right dir
mdelapenya ad5296b
chore: add a closing node that will be required by GH
mdelapenya 0b2f080
fix: pass the workspace dirs correctly
mdelapenya 89fc46f
fix: honor npm workspaces
mdelapenya 0373fff
chore: remove branch from the cache key
mdelapenya dabcce6
chore: exclude couchbase from the build
mdelapenya 23f1445
fix: configure cache paths correctly
mdelapenya a5169c6
chore: fail fast the lint and smoke test stages
mdelapenya 48469a7
fix: syntax
mdelapenya bde0cf4
fix: cache key
mdelapenya 23f82ef
fix: use module path in npm install
mdelapenya e9692d4
chore: get the workspace output from the composite action
mdelapenya edcb394
chore: escape quotes
mdelapenya ba88260
fix: pass the module correctly in smoke tests
mdelapenya 4b3d1e0
fix: remove escaped quotes
mdelapenya 5a2d967
fix: simplify
mdelapenya 2b827bc
fix: set output correctly
mdelapenya d6c3532
fix: build the cache key directly
mdelapenya aa95ebf
fix: use consistent format
mdelapenya 898fde7
fix: CI must run the ilnt in the current workspace
mdelapenya fd135cd
fix: not needed
mdelapenya 6e7f641
chore: define proper path for lint:ci
mdelapenya e68118f
chore: build just the testcontainers workspace for the smoke tests
mdelapenya 9e5dec0
chre: we do not want to fail fast the tests in order to understand wh…
mdelapenya c2fb308
chore: run podman after docker
mdelapenya f1118d1
fix: skip neo4j
mdelapenya a6843d1
chore: add neo4j again
mdelapenya 39b904d
fix: remove duplication
mdelapenya File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,39 @@ | ||
| name: 'NPM Setup' | ||
| description: 'Sets up Node.js and installs NPM dependencies with caching' | ||
|
|
||
| inputs: | ||
| runner: | ||
| description: 'Runner to use' | ||
| required: true | ||
| node-version: | ||
| description: 'Node.js version to use' | ||
| required: true | ||
| workspace: | ||
| description: 'Key for the cache' | ||
| required: true | ||
|
|
||
| runs: | ||
| using: "composite" | ||
| steps: | ||
| - name: Install NodeJS ${{ inputs.node-version }} | ||
| uses: actions/setup-node@v4 | ||
| with: | ||
| node-version: ${{ inputs.node-version }} | ||
| - uses: actions/cache/restore@v4 | ||
| id: npm-cache | ||
| with: | ||
| path: node_modules | ||
| key: ${{ github.head_ref || 'main' }}-${{ inputs.runner }}-node-${{ inputs.node-version }}-${{ inputs.workspace }}-${{ hashFiles('**/package-lock.json') }} | ||
| restore-keys: | | ||
| ${{ github.head_ref || 'main' }}-${{ inputs.runner }}-node-${{ inputs.node-version }}-${{ inputs.workspace }}- | ||
| - name: Install dependencies | ||
| if: steps.npm-cache.outputs.cache-hit != 'true' | ||
| shell: bash | ||
| run: npm ci --omit=optional | ||
| - name: Cache npm | ||
| id: cache-npm-save | ||
| if: steps.npm-cache.outputs.cache-hit != 'true' | ||
| uses: actions/cache/save@v4 | ||
| with: | ||
| path: node_modules | ||
| key: ${{ steps.npm-cache.outputs.cache-primary-key }} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.