110 lines
2.7 KiB
YAML
110 lines
2.7 KiB
YAML
name: CLI PR Checks
|
|
|
|
on:
|
|
pull_request:
|
|
branches: [main]
|
|
paths:
|
|
- "extensions/cli/**"
|
|
|
|
permissions:
|
|
contents: read
|
|
pull-requests: write
|
|
issues: write
|
|
|
|
jobs:
|
|
lint:
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- name: Checkout code
|
|
uses: actions/checkout@v4
|
|
|
|
- name: Setup Node.js
|
|
uses: actions/setup-node@v4
|
|
with:
|
|
node-version: 20
|
|
cache: "npm"
|
|
cache-dependency-path: extensions/cli/package-lock.json
|
|
|
|
- name: Setup packages
|
|
uses: ./.github/actions/setup-packages
|
|
- name: Setup core component
|
|
uses: ./.github/actions/setup-component
|
|
with:
|
|
component: core
|
|
include-root: true
|
|
|
|
- name: Install dependencies
|
|
run: |
|
|
cd extensions/cli
|
|
npm ci
|
|
|
|
- name: Run linting
|
|
run: |
|
|
cd extensions/cli
|
|
npm run lint
|
|
|
|
test:
|
|
strategy:
|
|
matrix:
|
|
os: [ubuntu-latest, windows-latest, macos-latest]
|
|
node-version: [18, 20, 22, 24]
|
|
runs-on: ${{ matrix.os }}
|
|
|
|
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"
|
|
cache-dependency-path: extensions/cli/package-lock.json
|
|
|
|
- name: Setup packages
|
|
uses: ./.github/actions/setup-packages
|
|
- name: Setup core component
|
|
uses: ./.github/actions/setup-component
|
|
with:
|
|
component: core
|
|
include-root: true
|
|
|
|
- name: Install dependencies
|
|
run: |
|
|
cd extensions/cli
|
|
npm ci
|
|
|
|
- name: Build
|
|
run: |
|
|
cd extensions/cli
|
|
npm run build
|
|
|
|
# e2e tests are failing on Windows specifically - likely due to stdout flush issues
|
|
- name: Run tests
|
|
if: matrix.os != 'windows-latest'
|
|
run: |
|
|
cd extensions/cli
|
|
npm test
|
|
|
|
- name: Run tests (excluding e2e on Windows)
|
|
if: matrix.os == 'windows-latest'
|
|
shell: bash
|
|
run: |
|
|
cd extensions/cli
|
|
npm test -- --exclude='**/*.e2e.*' --exclude='**/e2e/**'
|
|
|
|
# GitHub does not have a way of requiring that all checks pass (you must manually select each job)
|
|
# This action at least lets us manage the list of required tests via source control
|
|
# so that creators of new jobs can add them to this list
|
|
require-all-checks-to-pass-cli:
|
|
if: always()
|
|
runs-on: ubuntu-latest
|
|
needs:
|
|
- lint
|
|
- test
|
|
|
|
steps:
|
|
- name: Decide whether the needed jobs succeeded or failed
|
|
uses: re-actors/alls-green@release/v1
|
|
with:
|
|
jobs: ${{ toJSON(needs) }}
|