Skip to content

Commit

Permalink
develop
Browse files Browse the repository at this point in the history
  • Loading branch information
volovyks committed May 29, 2024
2 parents 84c0e02 + 3901486 commit 9ec7921
Show file tree
Hide file tree
Showing 83 changed files with 45,196 additions and 3,641 deletions.
File renamed without changes.
10 changes: 4 additions & 6 deletions .github/workflows/integrations.yml
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
name: Build Image and Test
name: Integration (FastAuth & Image build)

on:
push:
branches:
- develop
pull_request:
paths:
- integration-tests/**
- integration-tests/fastauth/**
- mpc-recovery/**
- load-tests/**
- test-oidc-provider/**
Expand Down Expand Up @@ -66,11 +66,9 @@ jobs:
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}

- name: Compile Contract
run: cargo build -p mpc-contract --target wasm32-unknown-unknown --release --target-dir target/seperate_wasm

- name: Test
run: cargo test -p mpc-recovery-integration-tests mpc --jobs 1 -- --test-threads 1
working-directory: ./integration-tests/fastauth
run: cargo test --jobs 1 -- --test-threads 1
env:
RUST_LOG: INFO
RUST_BACKTRACE: 1
4 changes: 2 additions & 2 deletions .github/workflows/multichain-contract.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,10 +31,10 @@ jobs:
- uses: Swatinem/rust-cache@v1

- name: Compile Contract
run: cargo build -p mpc-contract --target wasm32-unknown-unknown --release --target-dir target/seperate_wasm
run: cd ./contract && cargo build --target wasm32-unknown-unknown --release

- name: Test Contract
run: cd contract && cargo test --target x86_64-unknown-linux-gnu --release
run: cd ./contract && cargo test --target x86_64-unknown-linux-gnu --release
env:
RUST_LOG: INFO
RUST_BACKTRACE: 1
19 changes: 11 additions & 8 deletions .github/workflows/multichain-integration.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@ on:
- develop
pull_request:
paths:
- integration-tests/**
- integration-tests/chain-signatures/**
- keys/**
- node/**
- contract/**

Expand Down Expand Up @@ -43,7 +44,7 @@ jobs:
- name: Pull Relayer & Sandbox Docker Images
run: |
docker pull ghcr.io/near/os-relayer:12ba6e35690df3979fce0b36a41d0ca0db9c0ab4
docker pull ghcr.io/near/near-lake-indexer:e6519c922435f3d18b5f2ddac5d1ec171ef4dd6b
docker pull ghcr.io/near/near-lake-indexer:node-1.38
docker pull localstack/localstack:latest
- name: Install stable toolchain
Expand All @@ -67,15 +68,17 @@ jobs:
aws --profile default configure set aws_access_key_id "123"
aws --profile default configure set aws_secret_access_key "456"
- name: Compile Contract
run: cargo build -p mpc-contract --target wasm32-unknown-unknown --release --target-dir target/seperate_wasm
- name: Compile Chain-Signature Contract
working-directory: ./contract
run: cargo build --target wasm32-unknown-unknown --release

- name: Build MPC Recovery Binary Locally
run: |
cargo build -p mpc-recovery-node --release
- name: Build Chain-Signature Node Binary Locally
working-directory: ./node
run: cargo build --release

- name: Test
run: cargo test -p mpc-recovery-integration-tests multichain --jobs 1 -- --test-threads 1
working-directory: ./integration-tests/chain-signatures
run: cargo test --jobs 1 -- --test-threads 1
env:
RUST_LOG: INFO
RUST_BACKTRACE: 1
48 changes: 38 additions & 10 deletions .github/workflows/unit.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,15 +25,40 @@ jobs:
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}
- name: Compile Contract
run: cargo build -p mpc-contract --target wasm32-unknown-unknown --release --target-dir target/seperate_wasm
run: cd contract && cargo build --target wasm32-unknown-unknown --release
- name: Compile
run: cargo check
run: |
( cd keys ; cargo check )
( cd node ; cargo check )
( cd contract ; cargo check )
( cd mpc-recovery ; cargo check )
( cd load-tests ; cargo check )
( cd test-oidc-provider ; cargo check )
( cd integration-tests/chain-signatures ; cargo check )
( cd integration-tests/fastauth ; cargo check )
- name: Test format
run: cargo fmt -- --check
run: |
( cd keys ; cargo fmt -- --check )
( cd node ; cargo fmt -- --check )
( cd contract ; cargo fmt -- --check )
( cd mpc-recovery ; cargo fmt -- --check )
( cd load-tests ; cargo fmt -- --check )
( cd test-oidc-provider ; cargo fmt -- --check )
( cd integration-tests/chain-signatures ; cargo fmt -- --check )
( cd integration-tests/fastauth ; cargo fmt -- --check )
- name: Unit tests
run: cargo test -p mpc-recovery
run: ( cd mpc-recovery && cargo test )
- name: Test clippy
run: cargo clippy --tests -- -Dclippy::all
run: |
( cd keys ; cargo clippy --tests -- -Dclippy::all )
( cd node ; cargo clippy --tests -- -Dclippy::all )
( cd contract ; cargo clippy --tests -- -Dclippy::all )
( cd mpc-recovery ; cargo clippy --tests -- -Dclippy::all )
( cd load-tests ; cargo clippy --tests -- -Dclippy::all )
( cd test-oidc-provider ; cargo clippy --tests -- -Dclippy::all )
( cd integration-tests/chain-signatures ; cargo clippy --tests -- -Dclippy::all )
( cd integration-tests/fastauth ; cargo clippy --tests -- -Dclippy::all )
audit:
name: Audit
runs-on: ubuntu-latest
Expand All @@ -47,8 +72,11 @@ jobs:
- uses: Swatinem/rust-cache@v1
- name: Install Audit
run: cargo install cargo-audit
- name: Run Audit
uses: actions-rs/cargo@v1
with:
command: audit
args: --ignore RUSTSEC-2020-0071 --ignore RUSTSEC-2023-0052 --ignore RUSTSEC-2022-0093 --ignore RUSTSEC-2023-0071 --ignore RUSTSEC-2024-0019
- name: Run Audit (FastAuth)
working-directory: integration-tests/fastauth
run: |
cargo audit --ignore RUSTSEC-2020-0071 --ignore RUSTSEC-2023-0052 --ignore RUSTSEC-2022-0093 --ignore RUSTSEC-2023-0071 --ignore RUSTSEC-2024-0019
- name: Run Audit (Chain Signatures)
working-directory: integration-tests/chain-signatures
run: |
cargo audit --ignore RUSTSEC-2020-0071 --ignore RUSTSEC-2023-0052 --ignore RUSTSEC-2022-0093 --ignore RUSTSEC-2023-0071 --ignore RUSTSEC-2024-0019
6 changes: 5 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,7 +1,11 @@
/target
.direnv
.DS_Store
.idea

flamegraph*.svg
tmp
*.log
*.log

# Artifacts that may be left over
**/*-secret-manager-*
13 changes: 13 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
{
"githubPullRequests.ignoredPullRequestBranches": [
"develop"
],
"rust-analyzer.linkedProjects": [
"keys/Cargo.toml",
"node/Cargo.toml",
"contract/Cargo.toml",
"integration-tests/chain-signatures/Cargo.toml",
"integration-tests/fastauth/Cargo.toml",
"mpc-recovery/Cargo.toml",
],
}
14 changes: 0 additions & 14 deletions Cargo.toml

This file was deleted.

2 changes: 1 addition & 1 deletion DEPLOY.md
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ Save it to GCP Secret Manager under the name of your choosing (e.g. `mpc-recover
Build the mpc-recovery docker image from this folder and make sure to tag it for convenience:

```bash
$ docker build . -t near/mpc-recovery
$ docker build ./ -t near/mpc-recovery
```

## Configure Terraform Variables
Expand Down
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -187,5 +187,6 @@ direnv allow

Run unit tests with:
```BASH
cargo test -p mpc-recovery
cd mpc-recovery/
cargo test
```
2 changes: 1 addition & 1 deletion contract/.cargo/config.toml
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
[build]
target = "wasm32-unknown-unknown"
target-dir = "../target"
Loading

0 comments on commit 9ec7921

Please sign in to comment.