Skip to content

Commit d226d91

Browse files
saihajbenface
andauthored
remove husky and use CI (#661)
* ci: split check into parallel jobs * chore: remove husky * remove prepare script * Apply suggestions from code review Co-authored-by: Benoît Rouleau <[email protected]> * remove lint staged * remove check script * Try to fix `@typescript-eslint` errors in CI (even though there are no errors locally…) * Looks like that worked, but there are 2 warnings left – try to fix them * That didn’t work; try something else --------- Co-authored-by: Benoît Rouleau <[email protected]>
1 parent 58a2dbc commit d226d91

File tree

6 files changed

+79
-288
lines changed

6 files changed

+79
-288
lines changed

.github/workflows/ci-cd-pull-request.yml

+73-3
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,55 @@ env:
66
BASE_IMAGE: ghcr.io/graphprotocol/graph-docs-staging
77

88
jobs:
9-
build:
9+
lint:
10+
if: contains(github.head_ref, 'crowdin') == false
11+
runs-on: ubuntu-latest
12+
steps:
13+
- name: Cancel Previous Runs
14+
uses: styfle/[email protected]
15+
with:
16+
access_token: ${{ github.token }}
17+
18+
- name: Check out the repo
19+
uses: actions/checkout@v4
20+
21+
- name: Set up env
22+
uses: the-guild-org/shared-config/setup@main
23+
with:
24+
nodeVersion: 20
25+
packageManager: pnpm
26+
27+
- name: Install dependencies
28+
run: pnpm install
29+
30+
- name: Lint
31+
run: pnpm lint
32+
33+
format:
34+
if: contains(github.head_ref, 'crowdin') == false
35+
runs-on: ubuntu-latest
36+
steps:
37+
- name: Cancel Previous Runs
38+
uses: styfle/[email protected]
39+
with:
40+
access_token: ${{ github.token }}
41+
42+
- name: Check out the repo
43+
uses: actions/checkout@v4
44+
45+
- name: Set up env
46+
uses: the-guild-org/shared-config/setup@main
47+
with:
48+
nodeVersion: 20
49+
packageManager: pnpm
50+
51+
- name: Install dependencies
52+
run: pnpm install
53+
54+
- name: Check formatting
55+
run: pnpm prettier:check
56+
57+
typecheck:
1058
if: contains(github.head_ref, 'crowdin') == false
1159
runs-on: ubuntu-latest
1260
steps:
@@ -27,8 +75,30 @@ jobs:
2775
- name: Install dependencies
2876
run: pnpm install
2977

30-
- name: Lint and typecheck
31-
run: pnpm check
78+
- name: Typecheck
79+
run: pnpm typecheck
80+
81+
build:
82+
if: contains(github.head_ref, 'crowdin') == false
83+
runs-on: ubuntu-latest
84+
needs: [lint, format, typecheck]
85+
steps:
86+
- name: Cancel Previous Runs
87+
uses: styfle/[email protected]
88+
with:
89+
access_token: ${{ github.token }}
90+
91+
- name: Check out the repo
92+
uses: actions/checkout@v4
93+
94+
- name: Set up env
95+
uses: the-guild-org/shared-config/setup@main
96+
with:
97+
nodeVersion: 20
98+
packageManager: pnpm
99+
100+
- name: Install dependencies
101+
run: pnpm install
32102

33103
- name: Build Docker image
34104
uses: docker/build-push-action@v5

.husky/pre-commit

-4
This file was deleted.

.husky/pre-push

-4
This file was deleted.

package.json

-9
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,6 @@
1212
"docker:up": "docker run --rm -it -p 3000:80 -v \"$(pwd)/nginx.conf:/etc/nginx/nginx.conf\" docs",
1313
"lint": "eslint . --cache --ignore-path .gitignore --max-warnings 0",
1414
"lint:fix": "eslint . --cache --ignore-path .gitignore --fix; pnpm prettier",
15-
"pre-commit": "lint-staged --concurrent false",
16-
"pre-push": "pnpm build",
17-
"prepare": "husky install && chmod +x .husky/*",
1815
"prettier": "pnpm prettier:check --write",
1916
"prettier:check": "prettier --cache --check .",
2017
"test": "turbo run test",
@@ -24,8 +21,6 @@
2421
"@edgeandnode/eslint-config": "^2.0.3",
2522
"eslint": "^8.57.0",
2623
"eslint-plugin-mdx": "^2.3.4",
27-
"husky": "^9.0.11",
28-
"lint-staged": "^15.2.2",
2924
"prettier": "^3.2.5",
3025
"prettier-plugin-tailwindcss": "^0.5.14",
3126
"remark-frontmatter": "^5.0.0",
@@ -35,9 +30,5 @@
3530
"remark-lint-restrict-elements": "workspace:*",
3631
"turbo": "^1.13.3",
3732
"typescript": "^5.4.5"
38-
},
39-
"lint-staged": {
40-
"**/*.{js,jsx,ts,tsx,mjs,cjs}": "eslint --fix",
41-
"**/*.{js,jsx,ts,tsx,mjs,cjs,md,mdx,yml,yaml,json}": "prettier --write"
4233
}
4334
}

0 commit comments

Comments
 (0)