Skip to content

Commit

Permalink
Add steps for running tests in CI
Browse files Browse the repository at this point in the history
  • Loading branch information
nikugogoi committed Apr 29, 2022
1 parent a51f390 commit 26a324e
Show file tree
Hide file tree
Showing 7 changed files with 173 additions and 118 deletions.
24 changes: 23 additions & 1 deletion .github/workflows/on-main.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ on:
- main

jobs:
test:
lint:
runs-on: ubuntu-latest
strategy:
matrix:
Expand All @@ -26,6 +26,28 @@ jobs:
NODE_AUTH_TOKEN: ${{ secrets.PAT_PACKAGES }}
- name: Linter check
run: yarn lint
test:
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [16.x]
steps:
- uses: actions/checkout@v2
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}
registry-url: 'https://npm.pkg.github.com'
- run: yarn
env:
NODE_AUTH_TOKEN: ${{ secrets.PAT_PACKAGES }}
- name: Run tests
env:
NODE_AUTH_TOKEN: ${{ secrets.PAT_PACKAGES }}
run: |
yarn build
yarn test:init
yarn test
build:
name: Run docker build
runs-on: ubuntu-latest
Expand Down
24 changes: 23 additions & 1 deletion .github/workflows/on-pr.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ name: Docker Build
on: [pull_request]

jobs:
test:
lint:
runs-on: ubuntu-latest
strategy:
matrix:
Expand All @@ -23,6 +23,28 @@ jobs:
NODE_AUTH_TOKEN: ${{ secrets.PAT_PACKAGES }}
- name: Linter check
run: yarn lint
test:
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [16.x]
steps:
- uses: actions/checkout@v2
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}
registry-url: 'https://npm.pkg.github.com'
- run: yarn
env:
NODE_AUTH_TOKEN: ${{ secrets.PAT_PACKAGES }}
- name: Run tests
env:
NODE_AUTH_TOKEN: ${{ secrets.PAT_PACKAGES }}
run: |
yarn build
yarn test:init
yarn test
build:
name: Run docker build
runs-on: ubuntu-latest
Expand Down
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,8 @@
},
"scripts": {
"lint": "lerna run lint --stream",
"test": "lerna run test --stream --no-bail",
"test:init": "lerna run test:init --stream --ignore @vulcanize/*-watcher",
"test": "lerna run test --stream --ignore @vulcanize/*-watcher",
"build": "lerna run build --stream",
"build:watch": "lerna run build --stream --parallel -- -w",
"build:contracts": "lerna run build:contracts",
Expand Down
11 changes: 6 additions & 5 deletions packages/graph-node/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@
"license": "AGPL-3.0",
"devDependencies": {
"@graphprotocol/graph-ts": "^0.22.0",
"@nomiclabs/hardhat-ethers": "^2.0.2",
"@nomiclabs/hardhat-waffle": "^2.0.1",
"@types/chai": "^4.2.18",
"@types/chai-spies": "^1.0.3",
"@types/js-yaml": "^4.0.4",
Expand All @@ -20,13 +22,11 @@
"eslint-plugin-promise": "^5.1.0",
"eslint-plugin-standard": "^5.0.0",
"ethers": "^5.2.0",
"hardhat": "^2.3.0",
"mocha": "^8.4.0",
"nodemon": "^2.0.7",
"ts-node": "^10.0.0",
"typescript": "^4.3.2",
"mocha": "^8.4.0",
"hardhat": "^2.3.0",
"@nomiclabs/hardhat-ethers": "^2.0.2",
"@nomiclabs/hardhat-waffle": "^2.0.1"
"typescript": "^4.3.2"
},
"bin": {
"compare-entity": "bin/compare-entity"
Expand All @@ -37,6 +37,7 @@
"asbuild:debug": "asc assembly/index.ts --lib ./node_modules --exportRuntime --target debug --runPasses asyncify --runtime stub --maximumMemory 10",
"asbuild:release": "asc assembly/index.ts --lib ./node_modules --exportRuntime --target release --runPasses asyncify",
"asbuild": "yarn asbuild:debug && yarn asbuild:release",
"test:init": "cp .env.example .env && yarn build:example",
"test": "yarn asbuild:debug && DEBUG=vulcanize:* node node_modules/.bin/_mocha src/**/*.test.ts",
"build:example": "cd test/subgraph/example1 && yarn && yarn codegen && yarn build",
"watch": "DEBUG=vulcanize:* nodemon --watch src src/watcher.ts",
Expand Down
4 changes: 2 additions & 2 deletions packages/graph-node/test/subgraph/example1/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
"deploy-local": "graph deploy --node http://localhost:8020/ --ipfs http://localhost:5001 example1"
},
"dependencies": {
"@graphprotocol/graph-cli": "ssh://git@github.com:vulcanize/graph-cli.git#graph-watcher",
"@graphprotocol/graph-ts": "^0.22.1"
"@graphprotocol/graph-ts": "^0.22.1",
"@vulcanize/graph-cli": "0.22.5"
}
}
Loading

0 comments on commit 26a324e

Please sign in to comment.