Skip to content

Commit

Permalink
ci: improvements
Browse files Browse the repository at this point in the history
  • Loading branch information
heueristik committed Oct 23, 2023
1 parent c01e93e commit ac4143f
Show file tree
Hide file tree
Showing 3 changed files with 48 additions and 32 deletions.
23 changes: 12 additions & 11 deletions .github/workflows/contracts-tests.yml
Original file line number Diff line number Diff line change
@@ -1,21 +1,20 @@
name: 'Contracts'

env:
INFURA_API_KEY: ${{ secrets.INFURA_API_KEY }}
working-directory: contracts
name: 'contracts'

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

jobs:
formatting-linting:
uses: ./.github/workflows/formatting-linting.yml
tests:
runs-on: 'ubuntu-latest'
defaults:
run:
working-directory: ${{env.working-directory}}
working-directory: packages/contracts
steps:
- name: 'Check out the repo'
uses: 'actions/checkout@v3'
Expand All @@ -24,15 +23,17 @@ jobs:
uses: 'actions/setup-node@v3'
with:
cache: 'yarn'
node-version: 16
node-version: 18

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

- name: 'Build the contracts'
run: 'yarn build'
working-directory: contracts
env:
INFURA_API_KEY: ${{ secrets.INFURA_API_KEY }}

- name: 'Test the contracts and generate the coverage report'
run: 'yarn coverage'
working-directory: contracts
run: 'yarn coverage >> $GITHUB_STEP_SUMMARY'
env:
INFURA_API_KEY: ${{ secrets.INFURA_API_KEY }}
18 changes: 12 additions & 6 deletions .github/workflows/formatting-linting.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,17 @@ jobs:
- name: 'Install the dependencies'
run: 'yarn install'

- name: 'Install subgraph dependencies'
run: 'cd subgraph/ && yarn install'

- name: 'Lint subgraph'
run: 'yarn lint:subgraph:ts >> $GITHUB_STEP_SUMMARY'

- name: 'Check code formatting'
run: yarn prettier:check

- name: 'Lint contracts solidity'
run: yarn lint:contracts:sol >> $GITHUB_STEP_SUMMARY

- name: 'Lint contracts ts and js'
run: yarn lint:contracts:ts >> $GITHUB_STEP_SUMMARY

- name: 'Lint js-client ts and js'
run: yarn lint:js-client:ts >> $GITHUB_STEP_SUMMARY

- name: 'Lint subgraph ts and js'
run: yarn lint:subgraph:ts >> $GITHUB_STEP_SUMMARY
39 changes: 24 additions & 15 deletions .github/workflows/subgraph-tests.yml
Original file line number Diff line number Diff line change
@@ -1,29 +1,38 @@
name: 'Subgraph'
name: 'subgraph'

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

env:
working-directory: subgraph

jobs:
formatting-linting:
uses: ./.github/workflows/formatting-linting.yml
tests:
runs-on: ubuntu-latest
runs-on: 'ubuntu-latest'
defaults:
run:
working-directory: ${{env.working-directory}}
working-directory: subgraph
steps:
- uses: actions/checkout@v2
- name: Install node
uses: actions/setup-node@v3
- name: 'Check out the repo'
uses: 'actions/checkout@v3'

- name: 'Install Node.js'
uses: 'actions/setup-node@v3'
with:
node-version: 16
- name: Install dependencies
run: yarn install --pure-lockfile
- name: Run Tests
run: yarn run coverage >> $GITHUB_STEP_SUMMARY
cache: 'yarn'
node-version: 18

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

- name: 'Build the subgraph'
run: 'yarn build'
env:
INFURA_API_KEY: ${{secrets.INFURA_API_KEY}}
NETWORK_NAME: 'goerli'

- name: 'Test the subgraph'
run: 'yarn test >> $GITHUB_STEP_SUMMARY'

0 comments on commit ac4143f

Please sign in to comment.