Skip to content

Commit

Permalink
add ci
Browse files Browse the repository at this point in the history
  • Loading branch information
0g-peterzhb committed Mar 22, 2024
1 parent 7f5fa6d commit 8e0991e
Show file tree
Hide file tree
Showing 4 changed files with 69 additions and 1 deletion.
12 changes: 12 additions & 0 deletions .github/actions/setup-rust/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
name: Setup Rust (cache & toolchain)
runs:
using: composite
steps:
- name: Install toolchain 1.75.0
uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: 1.75.0
components: rustfmt, clippy

- uses: Swatinem/rust-cache@v2
45 changes: 45 additions & 0 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
name: functional-test

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

env:
CARGO_TERM_COLOR: always

jobs:
test:

runs-on: ubuntu-latest

steps:
- name: Checkout sources
uses: actions/checkout@v3
with:
submodules: recursive

- name: Setup Rust (cache & toolchain)
uses: ./.github/actions/setup-rust

- name: Set up Python 3.9
uses: actions/setup-python@v4
with:
python-version: '3.9'
cache: 'pip'

- name: Install dependencies
run: |
python -m pip install --upgrade pip
if [ -f requirements.txt ]; then pip install -r requirements.txt; fi
- name: Build Protobuf
run: |
cp api/proto/disperser/disperser.proto tests/
cd tests && python -m grpc_tools.protoc --proto_path=. ./disperser.proto --python_out=. --grpc_python_out=.
- name: Run tests
run: |
cd tests
python da_test_all.py
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,4 @@ coverage.*
*log

*__pycache__*
*tmp*
*tmp*
11 changes: 11 additions & 0 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
jsonrpcclient
pyyaml
pysha3
coincurve
eth-utils==1.10.0
py-ecc==5.2.0
web3
eth_tester
rtoml==0.10.0
grpcio
grpcio-tools

0 comments on commit 8e0991e

Please sign in to comment.