Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

remove husky and use CI #661

Merged
merged 10 commits into from
May 28, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
76 changes: 73 additions & 3 deletions .github/workflows/ci-cd-pull-request.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,55 @@ env:
BASE_IMAGE: ghcr.io/graphprotocol/graph-docs-staging

jobs:
build:
lint:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is currently failing on this PR, not sure why. 🤔

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@saihaj – No idea why I had to make these ugly changes to make pnpm lint pass in CI (it works without those changes locally).

if: contains(github.head_ref, 'crowdin') == false
runs-on: ubuntu-latest
steps:
- name: Cancel Previous Runs
uses: styfle/cancel-workflow-action@0.9.1
with:
access_token: ${{ github.token }}

- name: Check out the repo
uses: actions/checkout@v4

- name: Set up env
uses: the-guild-org/shared-config/setup@main
with:
nodeVersion: 20
packageManager: pnpm

- name: Install dependencies
run: pnpm install

- name: Lint
run: pnpm lint

format:
if: contains(github.head_ref, 'crowdin') == false
runs-on: ubuntu-latest
steps:
- name: Cancel Previous Runs
uses: styfle/cancel-workflow-action@0.9.1
with:
access_token: ${{ github.token }}

- name: Check out the repo
uses: actions/checkout@v4

- name: Set up env
uses: the-guild-org/shared-config/setup@main
with:
nodeVersion: 20
packageManager: pnpm

- name: Install dependencies
run: pnpm install
Comment on lines +51 to +52
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Are we gonna spend more Actions minutes since this now runs 3 times instead of once?


- name: Check formatting
run: pnpm prettier:check

typecheck:
if: contains(github.head_ref, 'crowdin') == false
runs-on: ubuntu-latest
steps:
Expand All @@ -27,8 +75,30 @@ jobs:
- name: Install dependencies
run: pnpm install

- name: Lint and typecheck
run: pnpm check
- name: Typecheck
run: pnpm typecheck

build:
if: contains(github.head_ref, 'crowdin') == false
runs-on: ubuntu-latest
needs: [lint, format, typecheck]
saihaj marked this conversation as resolved.
Show resolved Hide resolved
steps:
- name: Cancel Previous Runs
uses: styfle/cancel-workflow-action@0.9.1
with:
access_token: ${{ github.token }}

- name: Check out the repo
uses: actions/checkout@v4

- name: Set up env
uses: the-guild-org/shared-config/setup@main
with:
nodeVersion: 20
packageManager: pnpm

- name: Install dependencies
run: pnpm install

- name: Build Docker image
uses: docker/build-push-action@v5
Expand Down
4 changes: 0 additions & 4 deletions .husky/pre-commit

This file was deleted.

4 changes: 0 additions & 4 deletions .husky/pre-push

This file was deleted.

9 changes: 0 additions & 9 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,6 @@
"docker:up": "docker run --rm -it -p 3000:80 -v \"$(pwd)/nginx.conf:/etc/nginx/nginx.conf\" docs",
"lint": "eslint . --cache --ignore-path .gitignore --max-warnings 0",
"lint:fix": "eslint . --cache --ignore-path .gitignore --fix; pnpm prettier",
"pre-commit": "lint-staged --concurrent false",
"pre-push": "pnpm build",
"prepare": "husky install && chmod +x .husky/*",
"prettier": "pnpm prettier:check --write",
"prettier:check": "prettier --cache --check .",
"test": "turbo run test",
Expand All @@ -24,8 +21,6 @@
"@edgeandnode/eslint-config": "^2.0.3",
"eslint": "^8.57.0",
"eslint-plugin-mdx": "^2.3.4",
"husky": "^9.0.11",
"lint-staged": "^15.2.2",
"prettier": "^3.2.5",
"prettier-plugin-tailwindcss": "^0.5.14",
"remark-frontmatter": "^5.0.0",
Expand All @@ -35,9 +30,5 @@
"remark-lint-restrict-elements": "workspace:*",
"turbo": "^1.13.3",
"typescript": "^5.4.5"
},
"lint-staged": {
"**/*.{js,jsx,ts,tsx,mjs,cjs}": "eslint --fix",
"**/*.{js,jsx,ts,tsx,mjs,cjs,md,mdx,yml,yaml,json}": "prettier --write"
}
}
Loading
Loading