Skip to content

Commit

Permalink
chore: implement GH CI workflows
Browse files Browse the repository at this point in the history
  • Loading branch information
facuspagnuolo committed Jun 19, 2023
1 parent ea43b95 commit 491fffb
Show file tree
Hide file tree
Showing 11 changed files with 366 additions and 0 deletions.
20 changes: 20 additions & 0 deletions .github/actions/setup/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
name: Setup

runs:
using: composite
steps:
- name: Install node
uses: actions/setup-node@v3
with:
node-version: 16
cache: yarn
- name: Cache
uses: actions/cache@v2
id: cache
with:
path: '**/node_modules'
key: yarn-v1-${{ hashFiles('**/yarn.lock') }}
- name: Install
if: steps.cache.outputs.cache-hit != 'true'
shell: bash
run: yarn --prefer-offline
28 changes: 28 additions & 0 deletions .github/scripts/setup-hardhat-config.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
#!/bin/sh
MAINNET_URL="$1"
POLYGON_URL="$2"
OPTIMISM_URL="$3"
ARBITRUM_URL="$4"
GNOSIS_URL="$5"
BSC_URL="$6"
FANTOM_URL="$7"
AVALANCHE_URL="$8"

set -o errexit

mkdir -p $HOME/.hardhat

echo "
{
\"networks\": {
\"mainnet\": { \"url\": \"${MAINNET_URL}\" },
\"polygon\": { \"url\": \"${POLYGON_URL}\" },
\"optimism\": { \"url\": \"${OPTIMISM_URL}\" },
\"arbitrum\": { \"url\": \"${ARBITRUM_URL}\" },
\"gnosis\": { \"url\": \"${GNOSIS_URL}\" },
\"bsc\": { \"url\": \"${BSC_URL}\" },
\"fantom\": { \"url\": \"${FANTOM_URL}\" },
\"avalanche\": { \"url\": \"${AVALANCHE_URL}\" }
}
}
" > $HOME/.hardhat/networks.mimic.json
22 changes: 22 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
name: Build

env:
CI: true

on:
push:
branches: "*"
pull_request:
branches: "*"

jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Set up environment
uses: ./.github/actions/setup
- name: Build
run: yarn build

37 changes: 37 additions & 0 deletions .github/workflows/ci-authorizer.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
name: Authorizer CI

env:
CI: true

on:
push:
branches: "*"
paths:
- packages/authorizer/**
pull_request:
branches: "*"
paths:
- packages/authorizer/**

jobs:
lint:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Set up environment
uses: ./.github/actions/setup
- name: Lint
run: yarn workspace @mimic-fi/v3-authorizer lint


test:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Set up environment
uses: ./.github/actions/setup
- name: Test
run: yarn workspace @mimic-fi/v3-authorizer test

37 changes: 37 additions & 0 deletions .github/workflows/ci-deployer.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
name: Deployer CI

env:
CI: true

on:
push:
branches: "*"
paths:
- packages/deployer/**
pull_request:
branches: "*"
paths:
- packages/deployer/**

jobs:
lint:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Set up environment
uses: ./.github/actions/setup
- name: Lint
run: yarn workspace @mimic-fi/v3-deployer lint


test:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Set up environment
uses: ./.github/actions/setup
- name: Test
run: yarn workspace @mimic-fi/v3-deployer test

37 changes: 37 additions & 0 deletions .github/workflows/ci-fee-controller.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
name: Fee Controller CI

env:
CI: true

on:
push:
branches: "*"
paths:
- packages/fee-controller/**
pull_request:
branches: "*"
paths:
- packages/fee-controller/**

jobs:
lint:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Set up environment
uses: ./.github/actions/setup
- name: Lint
run: yarn workspace @mimic-fi/v3-fee-controller lint


test:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Set up environment
uses: ./.github/actions/setup
- name: Test
run: yarn workspace @mimic-fi/v3-fee-controller test

37 changes: 37 additions & 0 deletions .github/workflows/ci-helpers.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
name: Helpers CI

env:
CI: true

on:
push:
branches: "*"
paths:
- packages/helpers/**
pull_request:
branches: "*"
paths:
- packages/helpers/**

jobs:
lint:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Set up environment
uses: ./.github/actions/setup
- name: Lint
run: yarn workspace @mimic-fi/v3-helpers lint


test:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Set up environment
uses: ./.github/actions/setup
- name: Test
run: yarn workspace @mimic-fi/v3-helpers test

37 changes: 37 additions & 0 deletions .github/workflows/ci-price-oracle.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
name: Price Oracle CI

env:
CI: true

on:
push:
branches: "*"
paths:
- packages/price-oracle/**
pull_request:
branches: "*"
paths:
- packages/price-oracle/**

jobs:
lint:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Set up environment
uses: ./.github/actions/setup
- name: Lint
run: yarn workspace @mimic-fi/v3-price-oracle lint


test:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Set up environment
uses: ./.github/actions/setup
- name: Test
run: yarn workspace @mimic-fi/v3-price-oracle test

37 changes: 37 additions & 0 deletions .github/workflows/ci-registry.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
name: Registry CI

env:
CI: true

on:
push:
branches: "*"
paths:
- packages/registry/**
pull_request:
branches: "*"
paths:
- packages/registry/**

jobs:
lint:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Set up environment
uses: ./.github/actions/setup
- name: Lint
run: yarn workspace @mimic-fi/v3-registry lint


test:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Set up environment
uses: ./.github/actions/setup
- name: Test
run: yarn workspace @mimic-fi/v3-registry test

37 changes: 37 additions & 0 deletions .github/workflows/ci-smart-vault.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
name: Smart Vault CI

env:
CI: true

on:
push:
branches: "*"
paths:
- packages/smart-vault/**
pull_request:
branches: "*"
paths:
- packages/smart-vault/**

jobs:
lint:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Set up environment
uses: ./.github/actions/setup
- name: Lint
run: yarn workspace @mimic-fi/v3-smart-vault lint


test:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Set up environment
uses: ./.github/actions/setup
- name: Test
run: yarn workspace @mimic-fi/v3-smart-vault test

37 changes: 37 additions & 0 deletions .github/workflows/ci-tasks.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
name: Tasks CI

env:
CI: true

on:
push:
branches: "*"
paths:
- packages/tasks/**
pull_request:
branches: "*"
paths:
- packages/tasks/**

jobs:
lint:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Set up environment
uses: ./.github/actions/setup
- name: Lint
run: yarn workspace @mimic-fi/v3-tasks lint


test:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Set up environment
uses: ./.github/actions/setup
- name: Test
run: yarn workspace @mimic-fi/v3-tasks test

0 comments on commit 491fffb

Please sign in to comment.