diff --git a/.github/workflows/core.yaml b/.github/workflows/core.yaml new file mode 100644 index 000000000..7addece4a --- /dev/null +++ b/.github/workflows/core.yaml @@ -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 diff --git a/README.md b/README.md index f4912793e..d22f5fb9b 100644 --- a/README.md +++ b/README.md @@ -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. diff --git a/core/.nvmrc b/core/.nvmrc new file mode 100644 index 000000000..9de225682 --- /dev/null +++ b/core/.nvmrc @@ -0,0 +1 @@ +lts/iron