Skip to content
Closed
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
19 changes: 14 additions & 5 deletions .github/actions/npm-setup/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,9 @@ inputs:
description: "Node.js version to use"
required: true
workspace:
description: "Workspace to install"
required: true
description: "Workspace to install. Leave empty to install every workspace"
required: false
default: ""

outputs:
workspace_path:
Expand All @@ -24,7 +25,10 @@ runs:
shell: bash
id: set-workspace
run: |
if [ "${{ inputs.workspace }}" = "testcontainers" ]; then
if [ -z "${{ inputs.workspace }}" ]; then
workspace_path=""
cache_paths=$'node_modules\npackages/testcontainers/node_modules\npackages/modules/*/node_modules'
elif [ "${{ inputs.workspace }}" = "testcontainers" ]; then
workspace_path="packages/testcontainers"
cache_paths=$'node_modules\npackages/testcontainers/node_modules'
else
Expand All @@ -51,12 +55,17 @@ runs:
id: npm-cache
with:
path: ${{ steps.set-workspace.outputs.cache_paths }}
key: npm-v2-${{ inputs.runner }}-node-${{ inputs.node-version }}-${{ inputs.workspace }}-${{ hashFiles('package-lock.json') }}
key: npm-v2-${{ inputs.runner }}-node-${{ inputs.node-version }}-${{ inputs.workspace || 'all-workspaces' }}-${{ hashFiles('package-lock.json') }}

- name: Install dependencies
if: steps.npm-cache.outputs.cache-hit != 'true'
shell: bash
run: npm ci --workspace "${WORKSPACE_PATH}" --include-workspace-root
run: |
if [ -n "${WORKSPACE_PATH}" ]; then
npm ci --workspace "${WORKSPACE_PATH}" --include-workspace-root
else
npm ci
fi

- name: Save dependencies cache
if: steps.npm-cache.outputs.cache-hit != 'true'
Expand Down
12 changes: 1 addition & 11 deletions .github/workflows/checks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -76,27 +76,17 @@ jobs:
needs:
- detect-modules
- lint
strategy:
fail-fast: false
matrix:
module: ${{ fromJSON(needs.detect-modules.outputs.modules) }}
runs-on: ubuntu-24.04
steps:
- name: Code checkout
uses: actions/checkout@v7
- name: Install Node and Dependencies
id: npm-install
uses: ./.github/actions/npm-setup
with:
runner: ubuntu-24.04
node-version: 24.x
workspace: "${{ matrix.module }}"
- name: Compile
run: |
npm run build --ignore-scripts --workspace packages/testcontainers -- --project tsconfig.json
if [ "${{ matrix.module }}" != "testcontainers" ]; then
npm run build --ignore-scripts --workspace ${{ steps.npm-install.outputs.workspace_path }} -- --project tsconfig.json --noEmit
fi
run: npm run check-compiles

smoke-test:
if: ${{ needs.detect-modules.outputs.has_testcontainers == 'true' }}
Expand Down
Loading