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 2 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
73 changes: 73 additions & 0 deletions .github/workflows/ci-cd-pull-request.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,82 @@ env:
BASE_IMAGE: ghcr.io/graphprotocol/graph-docs-staging

jobs:
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: Format
saihaj marked this conversation as resolved.
Show resolved Hide resolved
run: pnpm prettier:check

typecheck:
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: 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
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.

3 changes: 0 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +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 .",
Expand All @@ -24,7 +22,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",
saihaj marked this conversation as resolved.
Show resolved Hide resolved
"prettier": "^3.2.5",
"prettier-plugin-tailwindcss": "^0.5.14",
Expand Down
40 changes: 17 additions & 23 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading