-
-
Notifications
You must be signed in to change notification settings - Fork 187
154 lines (133 loc) · 4.25 KB
/
integration.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
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
strategy:
fail-fast: false
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: |
pnpm i -g pnpm
pnpm install
pnpm add -D -w $PKG_URL
pnpm run knip --fix --no-exit-code
- 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
- name: freeCodeCamp
repo: freeCodeCamp/freeCodeCamp
commands: |
pnpm i -g pnpm
pnpm install
cp sample.env .env
pnpm run --dir client create:env
# No exit code, since freeCodeCamp project does not use Knip in CI
pnpm run knip:all --no-exit-code
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 }}
working-directory: ${{ matrix.project.name }}
run: ${{ matrix.project.commands }}