feat: add Moonwell ark #11
This file contains hidden or 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
name: Build and Unit Test | |
on: | |
pull_request: | |
types: [opened, synchronize] | |
push: | |
branches: | |
- main | |
- dev | |
jobs: | |
build: | |
name: Build and Unit Test | |
timeout-minutes: 30 | |
runs-on: ubuntu-latest | |
steps: | |
- name: Check out code | |
uses: actions/checkout@v3 | |
with: | |
fetch-depth: 2 | |
submodules: recursive | |
- name: Cache turbo build setup | |
uses: actions/cache@v3 | |
with: | |
path: .turbo | |
key: | |
${{ runner.os }}-turbo-${{ github.ref_name }}-${{ hashFiles('pnpm-lock.yaml') }}-${{ | |
github.sha }} | |
restore-keys: | | |
${{ runner.os }}-turbo-${{ github.ref_name }}- | |
${{ runner.os }}-turbo- | |
- uses: pnpm/action-setup@v2.0.1 | |
with: | |
version: 8.14.1 | |
- name: Setup Node.js environment | |
uses: actions/setup-node@v3 | |
with: | |
node-version: 20 | |
cache: 'pnpm' | |
- name: Install dependencies | |
run: pnpm install | |
- name: Install Foundry | |
uses: foundry-rs/foundry-toolchain@v1 | |
with: | |
version: v0.3.0 | |
- name: Prebuild | |
run: pnpm prebuild | |
- name: Build | |
run: pnpm build | |
- name: Test | |
run: pnpm test | |
env: | |
MAINNET_RPC_URL: ${{ secrets.MAINNET_RPC_URL }} | |
ARBITRUM_RPC_URL: ${{ secrets.ARBITRUM_RPC_URL }} | |
BASE_RPC_URL: ${{ secrets.BASE_RPC_URL }} | |
- name: Lint | |
run: pnpm lint | |
- name: Format | |
run: pnpm format | |
- name: Generate coverage reports | |
env: | |
MAINNET_RPC_URL: ${{ secrets.MAINNET_RPC_URL }} | |
ARBITRUM_RPC_URL: ${{ secrets.ARBITRUM_RPC_URL }} | |
BASE_RPC_URL: ${{ secrets.BASE_RPC_URL }} | |
run: | | |
cd packages/core-contracts && pnpm coverage:lcov | |
cd ../access-contracts && pnpm coverage:lcov | |
cd ../rewards-contracts && pnpm coverage:lcov | |
cd ../gov-contracts && pnpm coverage:lcov | |
cd ../voting-decay && pnpm coverage:lcov | |
- name: Upload coverage report to Codecov | |
uses: codecov/codecov-action@v4 | |
with: | |
token: ${{ secrets.CODECOV_TOKEN }} | |
files: | | |
./packages/core-contracts/lcov.info | |
./packages/access-contracts/lcov.info | |
./packages/rewards-contracts/lcov.info | |
./packages/gov-contracts/lcov.info | |
./packages/voting-decay/lcov.info | |
flags: unittests | |
name: codecov-umbrella | |
- name: Checkout to PR Branch | |
if: github.event_name == 'pull_request' | |
run: | | |
BRANCH_NAME=${GITHUB_HEAD_REF} | |
git fetch origin ${BRANCH_NAME}:${BRANCH_NAME} | |
git checkout ${BRANCH_NAME} | |
- name: Update Markdown with Dynamic Codecov Badge | |
run: | | |
BRANCH_NAME=${GITHUB_HEAD_REF:-${GITHUB_REF#refs/heads/}} | |
echo "Current branch is ${BRANCH_NAME}" | |
BADGE_URL="https://codecov.io/gh/OasisDEX/summer-earn-protocol/branch/${BRANCH_NAME}/graph/badge.svg?token=${{ secrets.CODECOV_EMBED_TOKEN }}" | |
sed -i "s|\(\[!\[codecov](\)[^)]*)|\1${BADGE_URL})|g" README.md | |
- name: Commit and Push Changes | |
run: | | |
git config --global user.email "action@github.com" | |
git config --global user.name "GitHub Action" | |
git add README.md | |
git commit -m "Update Codecov badge to current branch" -a || echo "No changes to commit" | |
BRANCH_NAME=${GITHUB_HEAD_REF:-${GITHUB_REF#refs/heads/}} | |
git push origin HEAD:refs/heads/${BRANCH_NAME} |