diff --git a/.github/workflows/integration.yml b/.github/workflows/integration.yml index 39bd1039c..c3bb51b37 100644 --- a/.github/workflows/integration.yml +++ b/.github/workflows/integration.yml @@ -10,127 +10,124 @@ on: - '!**' jobs: - integration: - name: integration + prepare: + name: Build and publish Knip runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 - - uses: pnpm/action-setup@v4 - with: - version: 8 + - 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 https://pkg.pr.new/knip@${{ github.sha }} + + - name: slonik + repo: gajus/slonik + commands: | + pnpm install + pnpm dlx https://pkg.pr.new/knip@${{ github.sha }} + + - name: 10ten-ja-reader + repo: birchill/10ten-ja-reader + commands: | + pnpm install + pnpm dlx https://pkg.pr.new/knip@${{ github.sha }} + + - name: DefinitelyTyped-tools + repo: microsoft/DefinitelyTyped-tools + commands: | + pnpm install + pnpm dlx https://pkg.pr.new/knip@${{ github.sha }} + + - name: query + repo: TanStack/query + commands: | + pnpm install + pnpm add -D -w https://pkg.pr.new/knip@${{ github.sha }} + pnpm test:knip --cache + pnpm test:knip --cache + + - name: argos + repo: argos-ci/argos + commands: | + pnpm install + pnpm add -D -w https://pkg.pr.new/knip@${{ github.sha }} + pnpm knip + + - name: eslint + repo: eslint/eslint + commands: | + npm install --force + npm install --prefix docs + npm install --force -D https://pkg.pr.new/knip@${{ github.sha }} + npm run lint:unused -- --cache + npm run lint:unused -- --cache + + - name: TypeScript + repo: microsoft/TypeScript + commands: | + npm install + npm install -D https://pkg.pr.new/knip@${{ github.sha }} + npm run knip + + - name: InvokeAI + repo: invoke-ai/InvokeAI + sparse-checkout: invokeai/frontend/web + commands: | + cd invokeai/frontend/web + pnpm install + pnpm add -D https://pkg.pr.new/knip@${{ github.sha }} + knip-bun --tags=-knipignore + knip-bun --tags=-knipignore --production --fix --no-exit-code --allow-remove-files + knip-bun --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@https://pkg.pr.new/knip@${{ github.sha }} + yarn knip + + steps: + - uses: actions/checkout@v4 + - uses: actions/setup-node@v4 with: node-version: 20 - - uses: oven-sh/setup-bun@v2 - - run: cd packages/knip && npm install && npm run build && npm link + - uses: oven-sh/setup-bun@v2 - - name: Test Knip against create-typescript-app - uses: actions/checkout@v4 - with: - repository: JoshuaKGoldberg/create-typescript-app - path: create-typescript-app - - run: | - cd create-typescript-app - pnpm install - knip - - - name: Test Knip against slonik - uses: actions/checkout@v4 - with: - repository: gajus/slonik - path: slonik - - run: | - cd slonik - pnpm install - knip - - - name: Test Knip against 10ten-ja-reader - uses: actions/checkout@v4 - with: - repository: birchill/10ten-ja-reader - path: 10ten-ja-reader - - run: | - cd 10ten-ja-reader - pnpm install - knip - - - name: Test Knip against DefinitelyTyped-tools - uses: actions/checkout@v4 - with: - repository: microsoft/DefinitelyTyped-tools - path: DefinitelyTyped-tools - - run: | - cd DefinitelyTyped-tools - pnpm install - knip - - - name: Test Knip against TanStack/query - uses: actions/checkout@v4 - with: - repository: TanStack/query - path: query - - run: | - cd query - pnpm install - knip --cache - knip --cache - - - name: Test Knip against argos-ci/argos - uses: actions/checkout@v4 - with: - repository: argos-ci/argos - path: argos - - run: | - cd argos - npm ci - knip --tags=-route - - - name: Test Knip against ESLint - uses: actions/checkout@v4 - with: - repository: eslint/eslint - path: eslint - - run: | - cd eslint - npm install --force - cd docs && npm install && cd - - knip --cache - knip --cache - - - name: Test Knip against TypeScript - uses: actions/checkout@v4 - with: - repository: microsoft/TypeScript - path: TypeScript - - run: | - cd TypeScript - npm ci - knip --tags=+internal,-knipignore --exclude=duplicates,enumMembers - - - name: Test Knip against InvokeAI - uses: actions/checkout@v4 + - uses: pnpm/action-setup@v4 with: - repository: invoke-ai/InvokeAI - path: InvokeAI - sparse-checkout: invokeai/frontend/web - - run: | - cd InvokeAI/invokeai/frontend/web - pnpm install - knip-bun --tags=-knipignore - knip-bun --tags=-knipignore --production --fix --no-exit-code --allow-remove-files - knip-bun --tags=-knipignore --production - - - name: Test Knip against Prettier + version: 8 + + - name: Check out ${{ matrix.project.repo }} uses: actions/checkout@v4 with: - repository: prettier/prettier - path: prettier - - run: | - cd prettier - yarn - yarn --cwd scripts/release - yarn --cwd scripts/tools/bundle-test - yarn --cwd scripts/tools/eslint-plugin-prettier-internal-rules - yarn --cwd website - yarn knip + 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 }}