Skip to content

Commit

Permalink
Define GitHub Actions workflow for Core module
Browse files Browse the repository at this point in the history
This is an initial implementation of the CI process to check formatting,
build contracts, test them and run deployment with local hardhat
network.
  • Loading branch information
nkuba committed Oct 26, 2023
1 parent bbbf636 commit d2297db
Showing 1 changed file with 109 additions and 0 deletions.
109 changes: 109 additions & 0 deletions .github/workflows/core.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,109 @@
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/
core/typechain/
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/

- name: Test
run: yarn test --no-compile

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/

- name: Deploy
run: yarn deploy --no-compile

0 comments on commit d2297db

Please sign in to comment.