name: Test on: push: branches: [ main ] pull_request: branches: [ main ] jobs: pr-title: name: Lint PR Title if: github.event_name == 'pull_request' runs-on: ubuntu-latest steps: - uses: amannn/action-semantic-pull-request@48f256284bd46cdaab1048c3721360e808335d50 # v6.1.1 env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} with: types: | feat fix perf revert refactor style docs test chore ci build test: name: Run Tests runs-on: ubuntu-latest strategy: matrix: node-version: [22.x] 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: Enable Corepack (provides pnpm for the installer flavor test) # The installer flavor test (mod-arch-installer/scripts/test-flavor.mjs) # scaffolds a frontend that uses pnpm and shells out to `pnpm install`. # Corepack provisions the pnpm version pinned by the scaffolded frontend's # `packageManager` field, so the version stays a single source of truth. run: corepack enable - name: Install dependencies run: npm ci - name: Build all packages run: npm run build - name: Run linting run: npm run lint - name: Run all tests run: npm run test env: # Auto-download the pinned pnpm in CI instead of prompting interactively. COREPACK_ENABLE_DOWNLOAD_PROMPT: '0' test-coverage: name: Test Coverage runs-on: ubuntu-latest steps: - name: Checkout code uses: actions/checkout@v4 - name: Setup Node.js uses: actions/setup-node@v4 with: node-version: '22.x' cache: 'npm' - name: Install dependencies run: npm ci - name: Run tests with coverage (mod-arch-core) run: npm run test:jest -- --coverage --workspace=mod-arch-core - name: Run tests with coverage (mod-arch-shared) run: npm run test:jest -- --coverage --workspace=mod-arch-shared test-individual-packages: name: Test Individual Packages runs-on: ubuntu-latest strategy: matrix: package: [mod-arch-core, mod-arch-shared, mod-arch-kubeflow] steps: - name: Checkout code uses: actions/checkout@v4 - name: Setup Node.js uses: actions/setup-node@v4 with: node-version: '22.x' cache: 'npm' - name: Install dependencies run: npm ci - name: Build all packages run: npm run build - name: Test ${{ matrix.package }} run: | if [ "${{ matrix.package }}" = "mod-arch-core" ]; then npm run test:core elif [ "${{ matrix.package }}" = "mod-arch-shared" ]; then npm run test:shared elif [ "${{ matrix.package }}" = "mod-arch-kubeflow" ]; then npm run test:kubeflow fi