-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Define GitHub Actions workflow for Core module (#9)
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
Showing
3 changed files
with
115 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
lts/iron |