Skip to content

Commit

Permalink
Merge pull request #727 from near/xiangyi/main_update
Browse files Browse the repository at this point in the history
update main branch with develop for 1.0.0-rc.1
  • Loading branch information
volovyks authored Jul 25, 2024
2 parents 240839f + b1677a5 commit 3f50d53
Show file tree
Hide file tree
Showing 160 changed files with 42,114 additions and 5,067 deletions.
File renamed without changes.
4 changes: 2 additions & 2 deletions .github/workflows/deploy-multichain-dev-contract.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ jobs:
- name: debug
run: cat ~/.near-credentials/testnet/v5.multichain-mpc-dev.testnet.json

- name: Cargo Build
- name: Build & Deploy Dev Contract
run: |
source $HOME/.cargo/env && cd ./contract ; rustup target add wasm32-unknown-unknown && cargo build --target wasm32-unknown-unknown --release && \
source $HOME/.cargo/env && cd chain-signatures ; rustup target add wasm32-unknown-unknown && cargo build -p mpc-contract --target wasm32-unknown-unknown --release && \
cd .. && (yes || true) | near deploy v5.multichain-mpc-dev.testnet target/wasm32-unknown-unknown/release/mpc_contract.wasm
2 changes: 2 additions & 0 deletions .github/workflows/docker-image.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ on:
branches:
- develop
pull_request:
paths:
- mpc-recovery/**

jobs:
build-image:
Expand Down
23 changes: 15 additions & 8 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 All @@ -17,7 +17,7 @@ jobs:
strategy:
matrix:
# FIXME: macos-latest-xl is disabled since colima is erroring out right now
os: [ubuntu-latest]
os: [warp-ubuntu-latest-x64-4x]
runs-on: ${{ matrix.os }}

steps:
Expand Down Expand Up @@ -59,18 +59,25 @@ jobs:
toolchain: stable
target: wasm32-unknown-unknown

- uses: Swatinem/rust-cache@v1
- uses: WarpBuilds/cache@v1
with:
path: |
~/.cargo/bin/
~/.cargo/registry/index/
~/.cargo/registry/cache/
~/.cargo/git/db/
target/
key: "${{ runner.os }}-cargo-${{ hashFiles('integration-tests/fastauth/Cargo.lock') }}"
restore-keys: ${{ runner.os }}-cargo-

- name: Install Protoc
uses: arduino/[email protected]
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
6 changes: 3 additions & 3 deletions .github/workflows/multichain-contract.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ on:
- develop
pull_request:
paths:
- contract/**
- chain-signatures/contract/**

env:
RUSTFLAGS: -D warnings
Expand All @@ -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 ./chain-signatures && cargo build -p mpc-contract --target wasm32-unknown-unknown --release

- name: Test Contract
run: cd contract && cargo test --target x86_64-unknown-linux-gnu --release
run: cd ./chain-signatures && cargo test -p mpc-contract --target x86_64-unknown-linux-gnu --release
env:
RUST_LOG: INFO
RUST_BACKTRACE: 1
11 changes: 6 additions & 5 deletions .github/workflows/multichain-dev.yml
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
name: Deploy Multichain Dev.
name: Build Image & Deploy Multichain Dev
on:
pull_request:
types: [closed]
branches:
- develop
paths:
- chain-signatures/**

env:
IMAGE: "us-east1-docker.pkg.dev/pagoda-discovery-platform-dev/multichain-public/multichain-dev"
Expand Down Expand Up @@ -39,15 +41,15 @@ jobs:
uses: 'google-github-actions/auth@v2'
with:
credentials_json: '${{ secrets.GCP_CREDENTIALS_DEV }}'

- name: 'Set up Cloud SDK'
uses: 'google-github-actions/setup-gcloud@v2'

- name: 'Set project'
run: 'gcloud config set project pagoda-discovery-platform-dev'

- name: 'Update Nodes'
run: |
run: |
gcloud compute instances update-container multichain-dev-0 --zone us-central1-a --container-image=${{ env.IMAGE }}:${{ env.TAG }} & \
gcloud compute instances update-container multichain-dev-1 --zone us-central1-a --container-image=${{ env.IMAGE }}:${{ env.TAG }} & \
gcloud compute instances update-container multichain-dev-2 --zone us-central1-a --container-image=${{ env.IMAGE }}:${{ env.TAG }} & \
Expand All @@ -56,4 +58,3 @@ jobs:
gcloud compute instances update-container multichain-dev-5 --zone us-central1-a --container-image=${{ env.IMAGE }}:${{ env.TAG }} & \
gcloud compute instances update-container multichain-dev-6 --zone us-central1-a --container-image=${{ env.IMAGE }}:${{ env.TAG }} & \
gcloud compute instances update-container multichain-dev-7 --zone us-central1-a --container-image=${{ env.IMAGE }}:${{ env.TAG }}
49 changes: 35 additions & 14 deletions .github/workflows/multichain-integration.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,8 @@ on:
- develop
pull_request:
paths:
- integration-tests/**
- node/**
- contract/**
- integration-tests/chain-signatures/**
- chain-signatures/**

env:
RUSTFLAGS: -D warnings
Expand All @@ -18,7 +17,7 @@ jobs:
strategy:
matrix:
# FIXME: macos-latest-xl is disabled since colima is erroring out right now
os: [ubuntu-22.04-4core]
os: [warp-ubuntu-latest-x64-4x]
runs-on: ${{ matrix.os }}

steps:
Expand All @@ -43,8 +42,8 @@ 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 localstack/localstack:latest
docker pull ghcr.io/near/near-lake-indexer:node-1.40.0
docker pull localstack/localstack:3.5.0
- name: Install stable toolchain
uses: actions-rs/toolchain@v1
Expand All @@ -53,29 +52,51 @@ jobs:
toolchain: stable
target: wasm32-unknown-unknown

- uses: Swatinem/rust-cache@v1
- uses: WarpBuilds/cache@v1
with:
path: |
~/.cargo/bin/
~/.cargo/registry/index/
~/.cargo/registry/cache/
~/.cargo/git/db/
target/
key: "${{ runner.os }}-cargo-${{ hashFiles('chain-signatures/Cargo.lock') }}"
restore-keys: ${{ runner.os }}-cargo-

- name: Install Protoc
uses: arduino/[email protected]
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}

- name: Install toxiproxy-server
run: |
wget -O toxiproxy-2.9.0_linux_amd64.deb https://github.com/Shopify/toxiproxy/releases/download/v2.9.0/toxiproxy_2.9.0_linux_amd64.deb
sudo dpkg -i toxiproxy-2.9.0_linux_amd64.deb
- name: Configure AWS
run: |
# Fake AWS configuration for LocalStack
aws configure set region us-east-1
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: Build Chain-Signatures Contract
working-directory: ./chain-signatures
run: cargo build -p mpc-contract --target wasm32-unknown-unknown --release

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

# Build the tests before actually running them to see how long the tests take to run by itself
# instead of including the build time in the test time report on Github.
- name: Build Chain-Signatures Integration Tests
working-directory: ./integration-tests/chain-signatures
run: cargo build --tests

- 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_LOG: info,workspaces=warn
RUST_BACKTRACE: 1
111 changes: 111 additions & 0 deletions .github/workflows/multichain-nightly.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,111 @@
name: Nightly Chain Signature Tests

# The right schedule
on:
schedule:
- cron: "0 3 * * *" # Run once per day at 3:00 am

jobs:
# Check the date and see if latest commit is within a day.
commited_recently:
runs-on: ubuntu-20.04
name: Check latest commit
outputs:
should_run: ${{ steps.should_run.outputs.should_run }}
steps:
- uses: actions/checkout@v4
- name: print latest_commit
run: echo ${{ github.sha }}
- id: should_run
continue-on-error: true
name: Check if the latest commit is within a day
if: ${{ github.event_name == 'schedule' }}
run: test -z $(git rev-list --after="24 hours" ${{ github.sha }}) && echo "::set-output name=should_run::false"

nightly:
strategy:
matrix:
# FIXME: macos-latest-xl is disabled since colima is erroring out right now
os: [warp-ubuntu-latest-x64-4x]

needs: commited_recently
if: ${{ needs.commited_recently.outputs.should_run != 'false' }}
runs-on: ${{ matrix.os }}

steps:
- uses: actions/checkout@v3

- name: Install Docker
if: ${{ matrix.os == 'macos-latest-xl' }}
run: |
brew install docker
colima start
# Colima does not expose the Docker socket by default, we have to symlink it
# https://github.com/abiosoft/colima/blob/main/docs/FAQ.md#cannot-connect-to-the-docker-daemon-at-unixvarrundockersock-is-the-docker-daemon-running
sudo ln -sf $HOME/.colima/default/docker.sock /var/run/docker.sock
- name: Login to GitHub Container Registry
uses: docker/login-action@v1
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Pull Relayer & Sandbox Docker Images
run: |
docker pull ghcr.io/near/os-relayer:12ba6e35690df3979fce0b36a41d0ca0db9c0ab4
docker pull ghcr.io/near/near-lake-indexer:node-1.40.0
docker pull localstack/localstack:3.5.0
- name: Install stable toolchain
uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: stable
target: wasm32-unknown-unknown

- uses: WarpBuilds/cache@v1
with:
path: |
~/.cargo/bin/
~/.cargo/registry/index/
~/.cargo/registry/cache/
~/.cargo/git/db/
target/
key: "${{ runner.os }}-cargo-${{ hashFiles('chain-signatures/Cargo.lock') }}"
restore-keys: ${{ runner.os }}-cargo-

- name: Install Protoc
uses: arduino/[email protected]
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}

- name: Install toxiproxy-server
run: |
wget -O toxiproxy-2.9.0_linux_amd64.deb https://github.com/Shopify/toxiproxy/releases/download/v2.9.0/toxiproxy_2.9.0_linux_amd64.deb
sudo dpkg -i toxiproxy-2.9.0_linux_amd64.deb
- name: Configure AWS
run: |
# Fake AWS configuration for LocalStack
aws configure set region us-east-1
aws --profile default configure set aws_access_key_id "123"
aws --profile default configure set aws_secret_access_key "456"
- name: Build Chain-Signatures Contract
working-directory: ./chain-signatures
run: cargo build -p mpc-contract --target wasm32-unknown-unknown --release

- name: Build Chain-Signatures Node
working-directory: ./chain-signatures
run: cargo build -p mpc-recovery-node --release

- name: Build Chain-Signatures Integration Tests
working-directory: ./integration-tests/chain-signatures
run: cargo build --tests

- name: Run Nightly
working-directory: ./integration-tests/chain-signatures
run: cargo test --package integration-tests-chain-signatures --test lib -- cases::nightly --show-output --ignored
env:
RUST_LOG: info,workspaces=warn
RUST_BACKTRACE: 1
Loading

0 comments on commit 3f50d53

Please sign in to comment.