Skip to content
Merged
Show file tree
Hide file tree
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 Mar 5, 2025
ba4222a
chore: extract to reusable workflow
mdelapenya Mar 5, 2025
f9bd8ff
fix: use a composite action
mdelapenya Mar 5, 2025
4fd8da1
chore: name step
mdelapenya Mar 5, 2025
d374502
fix: save cache
mdelapenya Mar 5, 2025
56334fa
chore: immediately cache dependencies, not wait until the end
mdelapenya Mar 5, 2025
380e478
chore: refine cache keys
mdelapenya Mar 5, 2025
06371a5
chore: reuse cache in workflows
mdelapenya Mar 5, 2025
b4abbe5
fix: use inputs
mdelapenya Mar 5, 2025
1cdcd97
chore: add workspace to cache key
mdelapenya Mar 5, 2025
93d5784
fix: cache node_modules from the packages
mdelapenya Mar 6, 2025
602ea54
feat: add shell script that detect changes
mdelapenya Mar 6, 2025
aebadac
chore: use script in the pipeline
mdelapenya Mar 6, 2025
7afe848
chore: run lint in the right dir
mdelapenya Mar 6, 2025
ad5296b
chore: add a closing node that will be required by GH
mdelapenya Mar 6, 2025
0b2f080
fix: pass the workspace dirs correctly
mdelapenya Mar 6, 2025
89fc46f
fix: honor npm workspaces
mdelapenya Mar 6, 2025
0373fff
chore: remove branch from the cache key
mdelapenya Mar 7, 2025
dabcce6
chore: exclude couchbase from the build
mdelapenya Mar 7, 2025
23f1445
fix: configure cache paths correctly
mdelapenya Mar 7, 2025
a5169c6
chore: fail fast the lint and smoke test stages
mdelapenya Mar 7, 2025
48469a7
fix: syntax
mdelapenya Mar 7, 2025
bde0cf4
fix: cache key
mdelapenya Mar 7, 2025
23f82ef
fix: use module path in npm install
mdelapenya Mar 7, 2025
e9692d4
chore: get the workspace output from the composite action
mdelapenya Mar 7, 2025
edcb394
chore: escape quotes
mdelapenya Mar 7, 2025
ba88260
fix: pass the module correctly in smoke tests
mdelapenya Mar 7, 2025
4b3d1e0
fix: remove escaped quotes
mdelapenya Mar 7, 2025
5a2d967
fix: simplify
mdelapenya Mar 7, 2025
2b827bc
fix: set output correctly
mdelapenya Mar 7, 2025
d6c3532
fix: build the cache key directly
mdelapenya Mar 7, 2025
aa95ebf
fix: use consistent format
mdelapenya Mar 7, 2025
898fde7
fix: CI must run the ilnt in the current workspace
mdelapenya Mar 7, 2025
fd135cd
fix: not needed
mdelapenya Mar 7, 2025
6e7f641
chore: define proper path for lint:ci
mdelapenya Mar 7, 2025
e68118f
chore: build just the testcontainers workspace for the smoke tests
mdelapenya Mar 7, 2025
9e5dec0
chre: we do not want to fail fast the tests in order to understand wh…
mdelapenya Mar 7, 2025
c2fb308
chore: run podman after docker
mdelapenya Mar 7, 2025
f1118d1
fix: skip neo4j
mdelapenya Mar 7, 2025
a6843d1
chore: add neo4j again
mdelapenya Mar 7, 2025
39b904d
fix: remove duplication
mdelapenya Mar 10, 2025
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
39 changes: 39 additions & 0 deletions .github/actions/npm-setup/action.yml
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 }}
8 changes: 6 additions & 2 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,11 @@ jobs:
uses: actions/setup-node@v4
with:
node-version: 22.x
- name: Install dependencies
run: npm ci --omit=optional
- name: Install Node and Dependencies
uses: ./.github/actions/npm-setup
with:
runner: ubuntu-22.04
node-version: 22.x
workspace: "packages/testcontainers"
- name: Code linting
run: npm run lint:ci
9 changes: 4 additions & 5 deletions .github/workflows/test-template.yml
Original file line number Diff line number Diff line change
Expand Up @@ -130,13 +130,12 @@ jobs:
- name: Code checkout
uses: actions/checkout@v4

- name: Install NodeJS ${{ inputs.node-version }}
uses: actions/setup-node@v4
- name: Install Node ${{ inputs.node-version }} and Dependencies
uses: ./.github/actions/npm-setup
with:
runner: ${{ inputs.runner }}
node-version: ${{ inputs.node-version }}

- name: Install dependencies
run: npm ci --omit=optional
workspace: "${{ inputs.workspace }}"

- name: Run tests
run: npm run test:ci -- ${{ inputs.workspace }}
11 changes: 7 additions & 4 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,12 +29,15 @@ jobs:
steps:
- name: Code checkout
uses: actions/checkout@v4
- name: Install NodeJS ${{ matrix.node-version }}
uses: actions/setup-node@v4

# Uses a composite action for a consistent NPM install including cache
- name: Install Node ${{ matrix.node-version }} and Dependencies
uses: ./.github/actions/npm-setup
with:
runner: ${{ matrix.runner }}
node-version: ${{ matrix.node-version }}
- name: Install dependencies
run: npm ci --omit=optional
workspace: "packages/testcontainers"

- name: Build workspaces
run: npm run build -ws
- name: Remove dev dependencies
Expand Down
Loading