From 2adb39641b27da95fae1f9c99e680c57404b46a8 Mon Sep 17 00:00:00 2001 From: Shredder <110225819+EmperorOrokuSaki@users.noreply.github.com> Date: Fri, 10 Feb 2023 22:42:58 +0330 Subject: [PATCH] feat: new GH action for the subgraph (#120) * feat: add subgraph unit tests to github action. * feat: add yarn codegen to the github action. * feat: create a subgraph action, remove unit testing subgraphs from test action. * fix: add the location of the contracts. * chore: remove empty tabs from GH workflow files. * chore: add path to the subgraph github action and also add build command. * fix: include a yarn compile step in the subgraph github action. --- .github/workflows/subgraph.yml | 45 ++++++++++++++++++++++++++++++++++ .github/workflows/test.yml | 2 +- 2 files changed, 46 insertions(+), 1 deletion(-) create mode 100644 .github/workflows/subgraph.yml diff --git a/.github/workflows/subgraph.yml b/.github/workflows/subgraph.yml new file mode 100644 index 0000000..4111d4e --- /dev/null +++ b/.github/workflows/subgraph.yml @@ -0,0 +1,45 @@ +name: Subgraph + +on: + pull_request: + branches: + - main + - develop + push: + paths: + - 'subgraph/**' + +jobs: + + test-subgraph: + runs-on: ubuntu-latest + + defaults: + run: + working-directory: subgraph + + strategy: + matrix: + node-version: [18.x] + + steps: + - uses: actions/checkout@v3 + - name: Use Node.js ${{ matrix.node-version }} + uses: actions/setup-node@v3 + with: + node-version: ${{ matrix.node-version }} + + - name: Compile contracts to get access to the ABI + run: cd ../contracts && yarn && yarn compile && cd ../subgraph + + - name: Install dependencies + run: yarn --ignore-scripts + + - name: Run codegen + run: yarn codegen + + - name: Build Subgraph + run: yarn build + + - name: Test Subgraph + run: yarn test diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 48efc20..3869879 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -68,4 +68,4 @@ jobs: run: yarn audit --groups dependencies - name: Build - run: yarn build \ No newline at end of file + run: yarn build