Repository navigation
Release: v1.0.2 #31
Workflow file for this run
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: CI | |
| on: | |
| pull_request: | |
| branches: [main] | |
| push: | |
| branches: [main] | |
| permissions: | |
| contents: read | |
| jobs: | |
| lint: | |
| name: Lint | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Check out the repository | |
| uses: actions/checkout@v7 | |
| with: | |
| persist-credentials: false | |
| - name: Set up pnpm and Node.js, install dependencies | |
| uses: pnpm/setup@fbda4c85fc2e1e08721cd8763afea8f48d60f024 # v3.0.0 | |
| with: | |
| node-version-file: .nvmrc | |
| cache: true | |
| require-lockfile: true | |
| - name: Lint | |
| run: pnpm lint | |
| - name: Check formatting | |
| run: pnpm format:check | |
| - name: Typecheck | |
| run: pnpm typecheck | |
| - name: Build | |
| run: pnpm build | |
| - name: Check the built CLI stays within its size limit | |
| run: pnpm exec size-limit | |
| - name: Check the package for publishing problems | |
| run: pnpm exec publint --strict | |
| test: | |
| name: Test (Node ${{ matrix.node }}) | |
| runs-on: ubuntu-latest | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| node: [22.12.0, 22, 24] | |
| steps: | |
| - name: Check out the repository | |
| uses: actions/checkout@v7 | |
| with: | |
| persist-credentials: false | |
| - name: Set up pnpm and Node.js, install dependencies | |
| uses: pnpm/setup@fbda4c85fc2e1e08721cd8763afea8f48d60f024 # v3.0.0 | |
| with: | |
| node-version-file: .nvmrc | |
| cache: true | |
| require-lockfile: true | |
| - name: Build and pack the CLI | |
| run: | | |
| pnpm build | |
| pnpm pack --pack-destination "$RUNNER_TEMP" | |
| # Customers run the CLI on their own Node.js, not the one in .nvmrc. | |
| - name: Set up Node.js ${{ matrix.node }} | |
| uses: actions/setup-node@v7 | |
| with: | |
| node-version: ${{ matrix.node }} | |
| # Node.js 22 needs the flag to run TypeScript; on 24 it's on by default. | |
| - name: Test | |
| run: node --experimental-strip-types --test test/*.test.ts | |
| - name: Install the packed CLI and run it | |
| run: | | |
| npm install -g --no-audit --no-fund "$RUNNER_TEMP"/team-plain-cli-*.tgz | |
| node --version | |
| plain --version | |
| plain index-url --help |