diff --git a/.github/actions/npm-setup/action.yml b/.github/actions/npm-setup/action.yml index df34da377..df787100c 100644 --- a/.github/actions/npm-setup/action.yml +++ b/.github/actions/npm-setup/action.yml @@ -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: @@ -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 @@ -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' diff --git a/.github/workflows/checks.yml b/.github/workflows/checks.yml index a0d5ad398..f8c1b9811 100644 --- a/.github/workflows/checks.yml +++ b/.github/workflows/checks.yml @@ -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' }}