Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Clear Technical Debt #217

Merged
merged 15 commits into from
Jan 2, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
101 changes: 82 additions & 19 deletions .github/workflows/integration.yml
Original file line number Diff line number Diff line change
@@ -1,20 +1,8 @@
name: "INTEGRATION"

env:
HARDHAT_VAR_MNEMONIC: "test test test test test test test test test test test junk"
HARDHAT_VAR_INFURA_API_KEY: "zzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzz"
PRIVATE_KEY: "0xac0974bec39a17e36ba4a6b4d238ff944bacb478cbed5efcae784d7bf4f2ff80"
# Uncomment the following lines to set your configuration variables using
# GitHub secrets (https://docs.github.com/en/actions/security-guides/using-secrets-in-github-actions)
#
# HARDHAT_VAR_MNEMONIC: ${{ secrets.Mnemonic }}
# HARDHAT_VAR_INFURA_API_KEY: ${{ secrets.InfuraApiKey }}
# HARDHAT_VAR_ARBISCAN_API_KEY: ${{ secrets.ArbiscanApiKey }}
# HARDHAT_VAR_BSCSCAN_API_KEY: ${{ secrets.BscscanApiKey }}
# HARDHAT_VAR_ETHERSCAN_API_KEY: ${{ secrets.EtherscanApiKey }}
# HARDHAT_VAR_OPTIMISM_API_KEY: ${{ secrets.OptimismApiKey }}
# HARDHAT_VAR_POLYGONSCAN_API_KEY: ${{ secrets.PolygonscanApiKey }}
# HARDHAT_VAR_SNOWTRACE_API_KEY: ${{ secrets.SnowtraceApiKey }}

on:
workflow_dispatch:
Expand All @@ -24,17 +12,36 @@ on:
- main

jobs:
ci:
test-net:
runs-on: "ubuntu-latest"
steps:
- name: "Check out the repo"
uses: "actions/checkout@v4"

- name: "Setup node"
uses: actions/setup-node@v2
with:
node-version: 20

- name: "Run network tests"
run: "yarn test:integration net --no-prebuild"

- name: "Add test summary"
run: |
echo "## Network test results" >> $GITHUB_STEP_SUMMARY
echo "✅ Passed" >> $GITHUB_STEP_SUMMARY

prebuild:
runs-on: "ubuntu-latest"
steps:
- name: "Check out the repo"
uses: "actions/checkout@v4"

- name: "Setup node"
uses: actions/setup-node@v2
with:
node-version: 20

- name: Install Rust 1.81.0
uses: actions-rs/toolchain@v1
with:
Expand All @@ -46,10 +53,10 @@ jobs:
with:
path: "**/node_modules"
key: ${{ runner.os }}-modules-${{ hashFiles('**/yarn.lock') }}

- name: "Install the dependencies"
run: "yarn install"

- name: "Lint the code"
run: "yarn lint"

Expand All @@ -61,10 +68,66 @@ jobs:
- name: "Compile the contracts and generate the TypeChain bindings"
run: "yarn typechain"

- name: "Test the contracts and generate the coverage report"
run: "yarn test:integration"
- name: "Run prebuild"
run: "yarn test:integration prebuild"

- name: "Upload build artifacts"
uses: actions/upload-artifact@v3
with:
name: build-artifacts
path: |
packages/ciphernode/target/debug/enclave
packages/ciphernode/target/debug/fake_encrypt
packages/ciphernode/target/debug/pack_e3_params

test:
needs: prebuild
runs-on: "ubuntu-latest"
strategy:
matrix:
test-suite: [base, persist]
fail-fast: false

steps:
- name: "Check out the repo"
uses: "actions/checkout@v4"

- name: "Setup node"
uses: actions/setup-node@v2
with:
node-version: 20

- name: Install Rust 1.81.0
uses: actions-rs/toolchain@v1
with:
toolchain: 1.81.0
override: true

- name: Cache node modules
uses: actions/cache@v2
with:
path: "**/node_modules"
key: ${{ runner.os }}-modules-${{ hashFiles('**/yarn.lock') }}

- name: "Install the dependencies"
run: "yarn install"

- name: "Download build artifacts"
uses: actions/download-artifact@v3
with:
name: build-artifacts
path: packages/ciphernode/target/debug/

- name: "Set executable permissions"
run: |
chmod +x packages/ciphernode/target/debug/enclave
chmod +x packages/ciphernode/target/debug/fake_encrypt
chmod +x packages/ciphernode/target/debug/pack_e3_params

- name: "Run ${{ matrix.test-suite }} tests"
run: "yarn test:integration ${{ matrix.test-suite }} --no-prebuild"

- name: "Add test summary"
run: |
echo "## Test results" >> $GITHUB_STEP_SUMMARY
echo "## Test results for ${{ matrix.test-suite }}" >> $GITHUB_STEP_SUMMARY
echo "✅ Passed" >> $GITHUB_STEP_SUMMARY
4 changes: 0 additions & 4 deletions deploy/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ services:
target: secrets.json
env_file: .env
environment:
RUST_LOG: "info"
AGGREGATOR: "false"
ADDRESS: "0xbDA5747bFD65F08deb54cb465eB87D40e51B197E"
QUIC_PORT: 9091
Expand All @@ -29,7 +28,6 @@ services:
target: secrets.json
env_file: .env
environment:
RUST_LOG: "info"
AGGREGATOR: "false"
ADDRESS: "0xdD2FD4581271e230360230F9337D5c0430Bf44C0"
QUIC_PORT: 9092
Expand All @@ -49,7 +47,6 @@ services:
target: secrets.json
env_file: .env
environment:
RUST_LOG: "info"
AGGREGATOR: "false"
ADDRESS: "0x2546BcD3c84621e976D8185a91A922aE77ECEc30"
QUIC_PORT: 9093
Expand All @@ -71,7 +68,6 @@ services:
target: secrets.json
env_file: .env
environment:
RUST_LOG: "info"
AGGREGATOR: "true"
ADDRESS: "0x8626a6940E2eb28930eFb4CeF49B2d1F2C9C1199"
QUIC_PORT: 9094
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
"lint": "yarn evm:lint",
"typechain": "yarn evm:typechain",
"test": "yarn evm:test && yarn ciphernode:test",
"test:integration": "./tests/basic_integration/test.sh",
"test:integration": "./tests/integration/test.sh",
"coverage": "yarn evm:coverage",
"enclave": "cd packages/ciphernode && ./scripts/launch.sh",
"ciphernode:lint": "cd packages/ciphernode && cargo fmt -- --check",
Expand Down
1 change: 1 addition & 0 deletions packages/ciphernode/.dockerignore
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
!*/src/**/*.rs

# Explicitly ignore build artifacts everywhere
target/
**/target/
**/.git/
**/.gitignore
Expand Down
Loading
Loading