Support exported types #1190
This file contains 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: Run Knip against external projects | |
on: | |
workflow_dispatch: | |
pull_request: | |
push: | |
branches: | |
- '**' | |
tags: | |
- '!**' | |
env: | |
PKG_URL: | | |
https://pkg.pr.new/knip@${{ github.event.pull_request.head.sha || github.sha }} | |
jobs: | |
prepare: | |
name: Build and publish Knip | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: oven-sh/setup-bun@v2 | |
- run: bun install --ignore-scripts --frozen-lockfile | |
working-directory: packages/knip | |
- run: bun run build | |
working-directory: packages/knip | |
- run: bunx pkg-pr-new publish --compact ./packages/knip | |
test: | |
name: Run | |
runs-on: ubuntu-latest | |
needs: prepare | |
continue-on-error: true | |
strategy: | |
matrix: | |
project: | |
- name: create-typescript-app | |
repo: JoshuaKGoldberg/create-typescript-app | |
commands: | | |
pnpm install | |
pnpm dlx $PKG_URL | |
- name: slonik | |
repo: gajus/slonik | |
commands: | | |
pnpm install | |
pnpm dlx $PKG_URL | |
- name: 10ten-ja-reader | |
repo: birchill/10ten-ja-reader | |
commands: | | |
pnpm install | |
pnpm dlx $PKG_URL | |
- name: DefinitelyTyped-tools | |
repo: microsoft/DefinitelyTyped-tools | |
commands: | | |
pnpm install | |
pnpm dlx $PKG_URL | |
- name: query | |
repo: TanStack/query | |
commands: | | |
pnpm install | |
pnpm add -D -w $PKG_URL | |
pnpm test:knip --cache | |
pnpm test:knip --cache | |
- name: argos | |
repo: argos-ci/argos | |
commands: | | |
npm ci | |
npm add -D $PKG_URL | |
npm run knip | |
- name: eslint | |
repo: eslint/eslint | |
commands: | | |
npm install --force | |
npm install --prefix docs | |
npm install --force -D $PKG_URL | |
npm run lint:unused -- --cache | |
npm run lint:unused -- --cache | |
- name: TypeScript | |
repo: microsoft/TypeScript | |
commands: | | |
npm ci | |
npm install -D $PKG_URL | |
npm run knip | |
- name: mocha | |
repo: mochajs/mocha | |
commands: | | |
npm ci | |
npm install -D $PKG_URL | |
npm run lint:knip | |
- name: InvokeAI | |
repo: invoke-ai/InvokeAI | |
sparse-checkout: invokeai/frontend/web | |
commands: | | |
cd invokeai/frontend/web | |
pnpm install | |
pnpm add -D $PKG_URL | |
bunx --bun knip --tags=-knipignore | |
bunx --bun knip --tags=-knipignore --production --fix --no-exit-code --allow-remove-files | |
bunx --bun knip --tags=-knipignore --production | |
- name: prettier | |
repo: prettier/prettier | |
commands: | | |
yarn | |
yarn --cwd scripts/release | |
yarn --cwd scripts/tools/bundle-test | |
yarn --cwd scripts/tools/eslint-plugin-prettier-internal-rules | |
yarn --cwd website | |
yarn add -D knip@$PKG_URL | |
yarn knip | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: actions/setup-node@v4 | |
with: | |
node-version: 20 | |
- uses: oven-sh/setup-bun@v2 | |
- uses: pnpm/action-setup@v4 | |
with: | |
version: 8 | |
- name: Check out ${{ matrix.project.repo }} | |
uses: actions/checkout@v4 | |
with: | |
repository: ${{ matrix.project.repo }} | |
path: ${{ matrix.project.name }} | |
sparse-checkout: ${{ matrix.project.sparse-checkout }} | |
- name: Run Knip in ${{ matrix.project.repo }} | |
run: | | |
cd ${{ matrix.project.name }} | |
${{ matrix.project.commands }} |