Skip to content

Commit

Permalink
build: improve package.json and adapted workflows
Browse files Browse the repository at this point in the history
  • Loading branch information
heueristik committed Oct 13, 2023
1 parent 76e948b commit e1baf43
Show file tree
Hide file tree
Showing 3 changed files with 52 additions and 7 deletions.
47 changes: 47 additions & 0 deletions .github/workflows/contracts-tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
name: 'Contracts'

env:
INFURA_API_KEY: ${{ secrets.INFURA_API_KEY }}
working-directory: .

on:
workflow_dispatch:
push:
paths:
- 'contracts/**'
- '.github/workflows/contracts-*.yml'

jobs:
tests:
runs-on: 'ubuntu-latest'
defaults:
run:
working-directory: ${{env.working-directory}}
steps:
- name: 'Check out the repo'
uses: 'actions/checkout@v3'

- name: 'Install Node.js'
uses: 'actions/setup-node@v3'
with:
cache: 'yarn'
node-version: 16

- name: 'Install general dependencies'
run: 'yarn install'

- name: 'Install contracts dependencies'
run: 'yarn install'
working-directory: contracts

- name: 'Lint the contracts'
run: 'yarn lint:sol'
working-directory: contracts

- name: 'Build the contracts'
run: 'yarn build'
working-directory: contracts

- name: 'Test the contracts and generate the coverage report'
run: 'yarn coverage'
working-directory: contracts
2 changes: 1 addition & 1 deletion .github/workflows/style-check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ jobs:
run: 'yarn install'

- name: 'Lint the code'
run: 'yarn lint:ts'
run: 'yarn lint'

- name: 'Check code formatting'
run: yarn prettier:check
10 changes: 4 additions & 6 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -32,12 +32,10 @@
"typescript": "^5.2.2"
},
"scripts": {
"build": "cd ./contracts && yarn build && cd ../subgraph && yarn build",
"test": "cd ./contracts && yarn test && cd ../subgraph && yarn test",
"lint:ts": "eslint --ignore-path ./.eslintignore --ext .js,.ts .",
"clean": "cd ./contracts && yarn clean && yarn clean && cd ../subgraph && yarn clean",
"test": "yarn --cwd ./subgraph test",
"lint": "eslint --ignore-path ./.eslintignore --ext .js,.ts .",
"clean": "yarn clean && yarn --cwd ./subgraph clean",
"prettier:check": "prettier --check \"**/*.{js,json,md,sol,ts,yml}\"",
"prettier:write": "prettier --write \"**/*.{js,json,md,sol,ts,yml}\""
},
"packageManager": "[email protected]"
}
}

0 comments on commit e1baf43

Please sign in to comment.