Skip to content

Commit 144566e

Browse files
committed
Add quality workflows
1 parent 03674f6 commit 144566e

3 files changed

Lines changed: 96 additions & 29 deletions

File tree

.github/workflows/build.yml

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
name: Build
2+
permissions:
3+
contents: read
4+
5+
on:
6+
pull_request:
7+
types: [opened, synchronize, reopened]
8+
9+
concurrency:
10+
group: ${{ github.workflow }}-${{ github.ref }}
11+
cancel-in-progress: true
12+
13+
jobs:
14+
build:
15+
runs-on: ubuntu-22.04
16+
steps:
17+
- uses: actions/checkout@v4
18+
- uses: pnpm/action-setup@fe02b34f77f8bc703788d5817da081398fad5dd2 # v4.0.0
19+
- uses: actions/setup-node@v4
20+
with:
21+
node-version-file: "package.json"
22+
cache: "pnpm"
23+
24+
- name: Install deps
25+
run: pnpm install
26+
27+
- name: Generate GraphQL types
28+
run: pnpm run generate
29+
30+
- name: Build
31+
run: pnpm run build

.github/workflows/knip.yml

Lines changed: 0 additions & 29 deletions
This file was deleted.

.github/workflows/quality.yml

Lines changed: 65 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,65 @@
1+
name: Quality
2+
permissions:
3+
contents: read
4+
pull-requests: write
5+
6+
on:
7+
pull_request:
8+
types: [opened, synchronize, reopened]
9+
10+
concurrency:
11+
group: ${{ github.workflow }}-${{ github.ref }}
12+
cancel-in-progress: true
13+
14+
jobs:
15+
knip:
16+
runs-on: ubuntu-22.04
17+
steps:
18+
- uses: actions/checkout@v4
19+
- uses: pnpm/action-setup@fe02b34f77f8bc703788d5817da081398fad5dd2 # v4.0.0
20+
- uses: actions/setup-node@v4
21+
with:
22+
node-version-file: "package.json"
23+
cache: "pnpm"
24+
25+
- name: Install deps
26+
run: pnpm install
27+
28+
- name: Knip for unused files, dependencies and exports
29+
run: pnpm run knip
30+
31+
graphql-lint-unused:
32+
runs-on: ubuntu-22.04
33+
steps:
34+
- uses: actions/checkout@v4
35+
- uses: pnpm/action-setup@fe02b34f77f8bc703788d5817da081398fad5dd2 # v4.0.0
36+
- uses: actions/setup-node@v4
37+
with:
38+
node-version-file: "package.json"
39+
cache: "pnpm"
40+
41+
- name: Install deps
42+
run: pnpm install
43+
44+
- name: Run graphql-lint-unused
45+
id: graphql-lint
46+
continue-on-error: true
47+
run: |
48+
OUTPUT=$(pnpm run graphql-lint-unused 2>&1) || true
49+
echo "$OUTPUT"
50+
EOF=$(dd if=/dev/urandom bs=15 count=1 status=none | base64)
51+
echo "result<<$EOF" >> "$GITHUB_OUTPUT"
52+
echo "$OUTPUT" >> "$GITHUB_OUTPUT"
53+
echo "$EOF" >> "$GITHUB_OUTPUT"
54+
55+
- name: Comment PR with results
56+
uses: peter-evans/create-or-update-comment@v4
57+
with:
58+
issue-number: ${{ github.event.pull_request.number }}
59+
body: |
60+
## GraphQL Unused Fields Report
61+
62+
```
63+
${{ steps.graphql-lint.outputs.result }}
64+
```
65+
comment-tag: graphql-lint-unused

0 commit comments

Comments
 (0)