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
| name: Package Manager Integration Tests | |
| on: | |
| push: | |
| branches: [ main ] | |
| paths: | |
| - 'packages/atxp-common/src/platform/**' | |
| - 'packages/atxp-common/package.json' | |
| - '.github/workflows/package-manager-integration.yml' | |
| pull_request: | |
| branches: [ main ] | |
| paths: | |
| - 'packages/atxp-common/src/platform/**' | |
| - 'packages/atxp-common/package.json' | |
| - '.github/workflows/package-manager-integration.yml' | |
| workflow_dispatch: # Allow manual triggering | |
| jobs: | |
| test-package-managers: | |
| name: Test Package Manager Compatibility | |
| runs-on: ubuntu-latest | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| node-version: [18, 20, 22] | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v4 | |
| - name: Setup Node.js ${{ matrix.node-version }} | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: ${{ matrix.node-version }} | |
| cache: 'npm' | |
| - name: Install dependencies with rollup workaround | |
| run: npm ci | |
| continue-on-error: true | |
| id: npm-ci | |
| - name: Remove node_modules and package-lock (Unix) | |
| if: steps.npm-ci.outcome == 'failure' && runner.os != 'Windows' | |
| run: rm -rf node_modules package-lock.json | |
| - name: Remove node_modules and package-lock (Windows) | |
| if: steps.npm-ci.outcome == 'failure' && runner.os == 'Windows' | |
| run: | | |
| if (Test-Path node_modules) { Remove-Item -Recurse -Force node_modules } | |
| if (Test-Path package-lock.json) { Remove-Item -Force package-lock.json } | |
| shell: pwsh | |
| - name: Fallback install if npm ci failed | |
| if: steps.npm-ci.outcome == 'failure' | |
| run: | | |
| echo "npm ci failed, applying rollup optional dependency workaround..." | |
| npm cache clean --force | |
| npm install | |
| - name: Setup pnpm | |
| uses: pnpm/action-setup@v4 | |
| with: | |
| version: 'latest' | |
| - name: Setup Yarn | |
| run: | | |
| corepack enable | |
| yarn --version | |
| - name: Setup Bun | |
| uses: oven-sh/setup-bun@v1 | |
| with: | |
| bun-version: 'latest' | |
| - name: Build packages | |
| run: npm run build | |
| - name: Run package manager integration tests | |
| run: npm run test:package-managers | |
| env: | |
| NODE_ENV: test | |
| - name: Upload test results | |
| if: failure() | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: test-results-node-${{ matrix.node-version }} | |
| path: | | |
| packages/atxp-common/test-results/ | |
| /tmp/atxp-integration-*/ | |
| retention-days: 3 | |
| # Separate job to test in different OS environments | |
| test-cross-platform: | |
| name: Cross-Platform Package Manager Tests | |
| runs-on: ${{ matrix.os }} | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| os: [ubuntu-latest, macos-latest, windows-latest] | |
| # Only test with Node 20 for cross-platform to reduce CI time | |
| node-version: [20] | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v4 | |
| - name: Setup Node.js ${{ matrix.node-version }} | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: ${{ matrix.node-version }} | |
| cache: 'npm' | |
| - name: Install dependencies with rollup workaround | |
| run: npm ci | |
| continue-on-error: true | |
| id: npm-ci | |
| - name: Remove node_modules and package-lock (Unix) | |
| if: steps.npm-ci.outcome == 'failure' && runner.os != 'Windows' | |
| run: rm -rf node_modules package-lock.json | |
| - name: Remove node_modules and package-lock (Windows) | |
| if: steps.npm-ci.outcome == 'failure' && runner.os == 'Windows' | |
| run: | | |
| if (Test-Path node_modules) { Remove-Item -Recurse -Force node_modules } | |
| if (Test-Path package-lock.json) { Remove-Item -Force package-lock.json } | |
| shell: pwsh | |
| - name: Fallback install if npm ci failed | |
| if: steps.npm-ci.outcome == 'failure' | |
| run: | | |
| echo "npm ci failed, applying rollup optional dependency workaround..." | |
| npm cache clean --force | |
| npm install | |
| - name: Setup pnpm | |
| uses: pnpm/action-setup@v4 | |
| with: | |
| version: 'latest' | |
| - name: Setup Bun (Unix only) | |
| if: runner.os != 'Windows' | |
| uses: oven-sh/setup-bun@v1 | |
| with: | |
| bun-version: 'latest' | |
| - name: Build packages | |
| run: npm run build | |
| - name: Run package manager integration tests | |
| run: npm run test:package-managers | |
| env: | |
| NODE_ENV: test |