Skip to content

Commit

Permalink
Backport Ganache test job from ipc-solidity-actors
Browse files Browse the repository at this point in the history
  • Loading branch information
fridrik01 committed Jan 9, 2024
1 parent e2d8713 commit a002028
Showing 1 changed file with 44 additions and 0 deletions.
44 changes: 44 additions & 0 deletions .github/workflows/build-and-test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
name: Build and Test Workflow

on:
push:
branches:
- main
pull_request:

jobs:
build:
runs-on: ubuntu-latest

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

- name: Set up Node.js
uses: actions/setup-node@v2
with:
node-version: '18' # Adjust this as needed for your project

- name: Install dependencies
run: |
cd contracts
npm install
- name: Install Foundry
run: |
cd contracts
curl -L https://foundry.paradigm.xyz | bash
export PATH="$PATH:/home/runner/.config/.foundry/bin"
foundryup
forge install
- name: Generate Ethereum Private Key and Create .env File and run make
run: |
cd contracts
PRIVATE_KEY=$(node -e "console.log(require('crypto').randomBytes(32).toString('hex'))")
echo "export PRIVATE_KEY=0x$PRIVATE_KEY" > .env
echo "export RPC_URL=http://127.0.0.1:1337" >> .env
echo "export CHAIN_ID=1337" >> .env
export PATH="$PATH:/home/runner/.config/.foundry/bin"
npx ganache-cli -g0 -p1337 --account 0x$PRIVATE_KEY,1001901919191919191 &
sleep 5
make

0 comments on commit a002028

Please sign in to comment.