From 3e7932e23658e16bd61c2c5ebce08c771a1065b9 Mon Sep 17 00:00:00 2001 From: Jakub Nowakowski Date: Thu, 26 Oct 2023 18:52:12 +0200 Subject: [PATCH] Define GitHub Actions workflow for Core module This is an initial implementation of the CI process to check formatting, build contracts, test them and run deployment with local hardhat network. --- .github/workflows/core.yaml | 107 ++++++++++++++++++++++++++++++++++++ 1 file changed, 107 insertions(+) create mode 100644 .github/workflows/core.yaml diff --git a/.github/workflows/core.yaml b/.github/workflows/core.yaml new file mode 100644 index 000000000..769fd7e6a --- /dev/null +++ b/.github/workflows/core.yaml @@ -0,0 +1,107 @@ +name: Core + +on: + push: + branches: + - main + paths: + - "core/**" + pull_request: + +defaults: + run: + working-directory: ./core + +jobs: + core-format: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + + - name: Set up Node + uses: actions/setup-node@v3 + with: + node-version-file: "core/.nvmrc" + cache: "yarn" + cache-dependency-path: "core/yarn.lock" + + - name: Install Dependencies + run: yarn install --prefer-offline --frozen-lockfile + + - name: Format + run: yarn format + + core-build: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + + - name: Set up Node + uses: actions/setup-node@v3 + with: + node-version-file: "core/.nvmrc" + cache: "yarn" + cache-dependency-path: "core/yarn.lock" + + - name: Install Dependencies + run: yarn install --prefer-offline --frozen-lockfile + + - name: Build + run: yarn build + + - name: Upload Build Artifacts + uses: actions/upload-artifact@v3 + with: + name: core-build + path: core/build/ + if-no-files-found: error + + core-test: + needs: [core-build] + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + + - name: Set up Node + uses: actions/setup-node@v3 + with: + node-version-file: "core/.nvmrc" + cache: "yarn" + cache-dependency-path: "core/yarn.lock" + + - name: Install Dependencies + run: yarn install --prefer-offline --frozen-lockfile + + - name: Download Build Artifacts + uses: actions/download-artifact@v3 + with: + name: core-build + path: core/build/ + + - name: Test + run: yarn test + + core-deploy-dry-run: + needs: [core-build] + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + + - name: Set up Node + uses: actions/setup-node@v3 + with: + node-version-file: "core/.nvmrc" + cache: "yarn" + cache-dependency-path: "core/yarn.lock" + + - name: Install Dependencies + run: yarn install --prefer-offline --frozen-lockfile + + - name: Download Build Artifacts + uses: actions/download-artifact@v3 + with: + name: core-build + path: core/build/ + + - name: Deploy + run: yarn deploy