Skip to content

Commit

Permalink
Define GitHub Actions workflow for Core module (#9)
Browse files Browse the repository at this point in the history
This is an initial implementation of the CI process to check the
formatting, build contracts, test them, and run deployment with the
local hardhat network.
  • Loading branch information
r-czajkowski authored Nov 1, 2023
2 parents ee3d77f + d94a2c1 commit 2359564
Show file tree
Hide file tree
Showing 3 changed files with 115 additions and 2 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@v4

- name: Set up Node
uses: actions/setup-node@v4
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@v4

- name: Set up Node
uses: actions/setup-node@v4
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@v4

- name: Set up Node
uses: actions/setup-node@v4
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@v4

- name: Set up Node
uses: actions/setup-node@v4
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
7 changes: 5 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,12 @@
# litmus

Bitcoin Liquid Staking

# Development
[![Core](https://github.com/thesis/litmus/actions/workflows/core.yaml/badge.svg?branch=main&event=push)](https://github.com/thesis/litmus/actions/workflows/core.yaml)

## Development

## Pre-commit Hooks
### Pre-commit Hooks

Developers are encouraged to use [pre-commit](https://pre-commit.com/) hooks to
automatically discover code issues, before they submit the code.
Expand Down
1 change: 1 addition & 0 deletions core/.nvmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
lts/iron

0 comments on commit 2359564

Please sign in to comment.