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

Run lint before tests #956

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open
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
21 changes: 0 additions & 21 deletions .github/workflows/check-formatting.yml

This file was deleted.

30 changes: 28 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,34 @@ on:
pull_request: {}

jobs:
build:
check:
name: Lint and Format Check
runs-on: ubuntu-22.04
steps:
- name: Checkout Repository
uses: actions/checkout@v3

- uses: the-guild-org/shared-config/setup@main
name: Setup Env
with:
nodeVersion: 20
packageManager: yarn

- name: Check Formatting
run: yarn format:check

- name: Lint
run: yarn lint

test:
needs: [check]
strategy:
matrix:
node-version: [18, 20, 22]
system:
- os: ubuntu-22.04
runs-on: ${{ matrix.system.os }}
name: Test on Node.js v${{ matrix.node-version }} (${{ matrix.system.os }})
services:
postgres:
image: postgres:13
Expand All @@ -32,19 +53,24 @@ jobs:
--health-timeout 5s
--health-retries 5
steps:
- uses: actions/checkout@v2
- name: Checkout Repository
uses: actions/checkout@v3

- name: update OS
run: |
sudo apt-get update
sudo apt install -y --no-install-recommends gcc g++ make build-essential

- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v1
with:
node-version: ${{ matrix.node-version }}
registry-url: https://registry.npmjs.org/

- run: yarn install --frozen-lockfile
env:
NODE_AUTH_TOKEN: ${{secrets.npm_token}}

- run: yarn test:ci
env:
POSTGRES_TEST_HOST: localhost
Expand Down
3 changes: 3 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,9 @@
"bootstrap": "lerna bootstrap",
"prepare": "lerna run prepare",
"release": "./scripts/release.sh",
"format": "lerna --concurrency 1 run format --stream",
"format:check": "lerna --concurrency 1 run format:check --stream",
"lint": "lerna --concurrency 1 run lint --stream",
"test": "lerna --concurrency 1 run test --stream --ignore @graphprotocol/indexer-service",
"test:ci": "lerna --concurrency 1 run test:ci --stream --ignore @graphprotocol/indexer-service",
"update-common-ts": "./scripts/update-common-ts.sh 1.8.3",
Expand Down
1 change: 1 addition & 0 deletions packages/indexer-agent/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
"private": false,
"scripts": {
"format": "prettier --write 'src/**/*.ts'",
"format:check": "prettier --check 'src/**/*.ts'",
"lint": "eslint . --ext .ts,.tsx --fix",
"compile": "tsc --build",
"prepare": "yarn format && yarn lint && yarn compile",
Expand Down
1 change: 1 addition & 0 deletions packages/indexer-cli/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
},
"scripts": {
"format": "prettier --write 'src/**/*.ts'",
"format:check": "prettier --check 'src/**/*.ts'",
"lint": "eslint . --ext .ts,.tsx --fix",
"compile": "tsc --build",
"prepare": "yarn format && yarn lint && yarn compile",
Expand Down
1 change: 1 addition & 0 deletions packages/indexer-common/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
"license": "MIT",
"scripts": {
"format": "prettier --write 'src/**/*.ts'",
"format:check": "prettier --check 'src/**/*.ts'",
"lint": "eslint . --ext .ts,.tsx --fix",
"compile": "tsc",
"prepare": "yarn format && yarn lint && yarn compile",
Expand Down
1 change: 1 addition & 0 deletions packages/indexer-native/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@
"publish-github": "node-pre-gyp-github publish --release",
"build-test-pack-publish": "yarn build-release && yarn test && yarn package && yarn publish-github-draft",
"format": "prettier --write 'lib/**/*.js'",
"format:check": "prettier --check 'lib/**/*.js'",
"lint": "eslint .",
"prepare": "yarn format && yarn lint",
"install": "yarn pull-or-build",
Expand Down
1 change: 1 addition & 0 deletions packages/indexer-service/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
"private": false,
"scripts": {
"format": "prettier --write 'src/**/*.ts'",
"format:check": "prettier --check 'src/**/*.ts'",
"lint": "eslint . --ext .ts,.tsx --fix",
"compile": "tsc --build",
"prepare": "yarn format && yarn lint && yarn compile",
Expand Down
Loading