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 ab95346
Showing 1 changed file with 106 additions and 0 deletions.
106 changes: 106 additions & 0 deletions .github/workflows/core.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,106 @@
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-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

0 comments on commit ab95346

Please sign in to comment.