From 7387b6857190f0e02502c5f4a4f35411e7a68615 Mon Sep 17 00:00:00 2001 From: Shredder <110225819+EmperorOrokuSaki@users.noreply.github.com> Date: Wed, 8 Mar 2023 09:50:25 +0330 Subject: [PATCH] chore: add / update workflows to do folder filtering (#153) * Reflect Polygon -> Eth Mainnet change in main readme * chore: add / update workflows to do folder filtering and run change specific tests. * chore: run workflows based on both the path and the target branch of pr. * chore: add graphclient generation command to ui workflow Co-authored-by: Camila Sosa Morales * style: fix indentation in the ui workflow yml file --------- Co-authored-by: Janison Sivarajah Co-authored-by: Camila Sosa Morales --- .github/workflows/{test.yml => contract.yml} | 117 ++++++++----------- .github/workflows/subgraph.yml | 1 - .github/workflows/ui.yml | 38 ++++++ 3 files changed, 84 insertions(+), 72 deletions(-) rename .github/workflows/{test.yml => contract.yml} (55%) create mode 100644 .github/workflows/ui.yml diff --git a/.github/workflows/test.yml b/.github/workflows/contract.yml similarity index 55% rename from .github/workflows/test.yml rename to .github/workflows/contract.yml index 3869879..8fd65a7 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/contract.yml @@ -1,71 +1,46 @@ -name: Tests - -on: - pull_request: - branches: - - main - - develop - -jobs: - test-contracts: - runs-on: ubuntu-latest - - defaults: - run: - working-directory: contracts - - 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 }} - submodules: recursive - - - name: Install Foundry - uses: foundry-rs/foundry-toolchain@v1 - with: - version: nightly - - - name: Install Dependencies - run: yarn --ignore-scripts - - - name: Audit - run: yarn audit --groups dependencies - - - name: Compile - run: yarn compile - - - name: Run Test - run: yarn test - - test-ui: - runs-on: ubuntu-latest - - defaults: - run: - working-directory: ui - - 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: Install Dependencies - run: yarn --ignore-scripts - - - name: Audit - run: yarn audit --groups dependencies - - - name: Build - run: yarn build +name: Contract + +on: + pull_request: + branches: + - main + - develop + paths: + - 'contracts/**' + +jobs: + test-contracts: + runs-on: ubuntu-latest + + defaults: + run: + working-directory: contracts + + 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 }} + submodules: recursive + + - name: Install Foundry + uses: foundry-rs/foundry-toolchain@v1 + with: + version: nightly + + - name: Install Dependencies + run: yarn --ignore-scripts + + - name: Audit + run: yarn audit --groups dependencies + + - name: Compile + run: yarn compile + + - name: Run Test + run: yarn test \ No newline at end of file diff --git a/.github/workflows/subgraph.yml b/.github/workflows/subgraph.yml index 43a7dcd..0505785 100644 --- a/.github/workflows/subgraph.yml +++ b/.github/workflows/subgraph.yml @@ -6,7 +6,6 @@ on: - main jobs: - test-subgraph: runs-on: ubuntu-latest diff --git a/.github/workflows/ui.yml b/.github/workflows/ui.yml new file mode 100644 index 0000000..35ef11f --- /dev/null +++ b/.github/workflows/ui.yml @@ -0,0 +1,38 @@ +name: UI + +on: + pull_request: + branches: + - main + - develop + paths: + - 'ui/**' + +jobs: + test-ui: + runs-on: ubuntu-latest + + defaults: + run: + working-directory: ui + + 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: Install Dependencies + run: yarn --ignore-scripts + - name: Create .graphclient folder + run: yarn graphclient build + - name: Audit + run: yarn audit --groups dependencies + + - name: Build + run: yarn build