Skip to content

Commit

Permalink
ci: add ci workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
0xmichalis committed Jan 18, 2024
1 parent 5b046f4 commit 9e4d2e0
Show file tree
Hide file tree
Showing 2 changed files with 69 additions and 0 deletions.
63 changes: 63 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
name: faucet tests

on:
push:
branches: [main]
pull_request:
branches: [main]

jobs:
test:
if: github.event.pull_request.draft == false
runs-on: ubuntu-latest

strategy:
matrix:
node-version: [16.x]

steps:
- name: Checkout code
uses: actions/checkout@v2

- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v2
with:
node-version: ${{ matrix.node-version }}

- name: Get yarn cache directory path
id: yarn-cache-dir-path
run: echo "dir=$(yarn config get cacheFolder)" >> $GITHUB_OUTPUT

- name: Check yarn cache
uses: actions/cache@v2
id: cache-yarn-cache
with:
path: ${{ steps.yarn-cache-dir-path.outputs.dir }}
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
restore-keys: |
${{ runner.os }}-yarn-
- name: Check node_modules cache
id: cache-node-modules
uses: actions/cache@v2
with:
path: |
node_modules
*/*/node_modules
key: ${{ runner.os }}-${{ matrix.node-version }}-nodemodules-${{ hashFiles('**/yarn.lock') }}
restore-keys: |
${{ runner.os }}-${{ matrix.node-version }}-nodemodules-
- name: Install packages
run: yarn install --immutable

- name: Build contracts
run: yarn hardhat compile

- name: Test contracts
run: yarn hardhat test
env:
MUMBAI_URL: ${{ secrets.MUMBAI_RPC_URL }}

- name: Deploy contracts
run: yarn hardhat deploy --network hardhat
6 changes: 6 additions & 0 deletions utils/constants.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,10 @@
export const deploymentAddresses: Record<string, Record<string, string>> = {
hardhat: {
// dummy addresses to deploy the faucet in a dev environment
CONTRACT_REGISTRY_ADDRESS: "0x0000000000000000000000000000000000000000",
BCT_ADDRESS: "0x0000000000000000000000000000000000000000",
NCT_ADDRESS: "0x0000000000000000000000000000000000000000",
},
mumbai: {
CONTRACT_REGISTRY_ADDRESS: "0x6739D490670B2710dc7E79bB12E455DE33EE1cb6",
BCT_ADDRESS: "0xf2438A14f668b1bbA53408346288f3d7C71c10a1",
Expand Down

0 comments on commit 9e4d2e0

Please sign in to comment.