Skip to content

feat: run changed testsuites in PR ci #652

feat: run changed testsuites in PR ci

feat: run changed testsuites in PR ci #652

Workflow file for this run

name: CI
on:
push:
branches:
- main
pull_request:
branches:
- main
jobs:
ci:
timeout-minutes: 10
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: 18
- run: corepack enable
- run: pnpm --version
- uses: actions/setup-node@v3
with:
node-version: 18
cache: "pnpm"
cache-dependency-path: "**/pnpm-lock.yaml"
- name: install
run: pnpm install --frozen-lockfile --prefer-offline
- name: format
run: pnpm format
- name: lint
run: pnpm run lint
- name: audit
if: (${{ success() }} || ${{ failure() }})
run: pnpm audit
- name: test self
if: (${{ success() }} || ${{ failure() }})
run: pnpm test:self
- name: test changed suites
env:
GH_TOKEN: ${{ github.token }}
run: |
GH_DIFF=$(gh pr diff --name-only --color never)
echo $GH_DIFF
CHANGED_SUITES=$(echo $GH_DIFF | grep '^tests/[^_].*\.ts' | xargs -d '\n' ls -1df 2>/dev/null |cut -d '/' -f 2 | cut -d '.' -f 1 | xargs -rd '\n')
if [ -n "$CHANGED_SUITES" ]; then
pnpm tsx ecosystem-ci.ts $CHANGED_SUITES
fi