Skip to content

Commit

Permalink
Merge pull request #29 from l-monninger/main
Browse files Browse the repository at this point in the history
#4, #7, #13, #14, readying for open-source release
  • Loading branch information
l-monninger authored Jul 27, 2023
2 parents bc07f48 + 21fe197 commit 10d4174
Show file tree
Hide file tree
Showing 10,472 changed files with 2,526 additions and 1,527,445 deletions.
The diff you're trying to view is too large. We only load the first 3000 changed files.
22 changes: 0 additions & 22 deletions .github/mirror.sh

This file was deleted.

45 changes: 45 additions & 0 deletions .github/workflows/check.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
name: Cargo Check

on:
push:
branches:
- main

jobs:
check:
runs-on: ubuntu-latest

steps:
- name: Checkout Repository
uses: actions/checkout@v2
with:
submodules: 'recursive'

- name: Set up Rust
uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: nightly
override: true

- name: Cache cargo registry
uses: actions/cache@v2
with:
path: ~/.cargo/registry
key: ${{ runner.os }}-cargo-registry-${{ hashFiles('**/Cargo.lock') }}

- name: Cache cargo index
uses: actions/cache@v2
with:
path: ~/.cargo/git
key: ${{ runner.os }}-cargo-git-${{ hashFiles('**/Cargo.lock') }}

- name: Cache cargo build
uses: actions/cache@v2
with:
path: ./m1/target
key: ${{ runner.os }}-cargo-build-target-${{ hashFiles('**/Cargo.lock') }}

- name: Run Cargo Check
working-directory: ./m1
run: RUSTFLAGS="--cfg tokio_unstable" cargo check
55 changes: 55 additions & 0 deletions .github/workflows/coverage.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
name: Code Coverage

on:
workflow_run:
workflows: ["Cargo Check"]
types:
- completed

jobs:
coverage:
runs-on: ubuntu-latest
if: ${{ github.event.workflow_run.conclusion == 'success' }}
steps:
- name: Checkout Repository
uses: actions/checkout@v2
with:
submodules: 'recursive'

- name: Set up Rust
uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: nightly
components: rustfmt
override: true

- name: Install kcov
run: |
sudo apt-get update
sudo apt-get install -y pkg-config libcurl4-openssl-dev libelf-dev libdw-dev cmake gcc binutils-dev libiberty-dev
wget https://github.com/SimonKagstrom/kcov/archive/master.tar.gz
tar xzf master.tar.gz
mkdir kcov-master/build
cd kcov-master/build
cmake ..
make
sudo make install
- name: Build for Coverage
run: |
cd ./m1
RUSTFLAGS="--cfg tokio_unstable" cargo build --all --all-targets
- name: Test & Generate Coverage Report
run: |
for file in m1/target/debug/deps/*; do
mkdir -p "target/cov/$(basename $file)";
kcov --exclude-pattern=/.cargo,/usr/lib --verify "target/cov/$(basename $file)" "$file";
done
- name: Upload Coverage to Codecov
uses: codecov/codecov-action@v1
with:
token: ${{ secrets.CODECOV_TOKEN }} # Add your Codecov token here
directory: ./target/cov/
25 changes: 0 additions & 25 deletions .github/workflows/mirror.yml

This file was deleted.

62 changes: 26 additions & 36 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -1,23 +1,26 @@
name: Binary Release

on:
push:
branches:
- main
workflow_run:
workflows: ["Cargo Check"]
types:
- completed

jobs:
build:
runs-on: ubuntu-latest

if: ${{ github.event.workflow_run.conclusion == 'success' }}
steps:
- name: Checkout Repository
uses: actions/checkout@v2
with:
submodules: 'recursive' # Ensures submodules are fetched

- name: Set up Rust
uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: stable
toolchain: nightly
override: true

- name: Install Dependencies
Expand All @@ -27,94 +30,81 @@ jobs:
- name: Run dev setup script
run: |
cd "$GITHUB_WORKSPACE/vm/aptos-vm"
cd "$GITHUB_WORKSPACE/aptos-pre-core"
chmod -R 755 ./scripts
echo "yes" | ./scripts/dev_setup.sh
- name: Build subnet binaries
- name: Build binaries
run: |
cd "$GITHUB_WORKSPACE"
cargo build --release -p subnet
cargo build --release -p movement
cd "$GITHUB_WORKSPACE/m1"
RUSTFLAGS="--cfg tokio_unstable" cargo build --release
- name: Archive binaries
uses: actions/upload-artifact@v2
with:
name: binaries
path: |
$GITHUB_WORKSPACE/target/release/subnet
$GITHUB_WORKSPACE/target/release/movement
$GITHUB_WORKSPACE/m1/target/release/*
- name: Set up cross-compilation environment
uses: crazy-max/ghaction-docker-buildx@v3
with:
version: latest

- name: Build binaries for macOS
run: |
cd "$GITHUB_WORKSPACE"
cd "$GITHUB_WORKSPACE/m1"
docker buildx create --name mybuilder
docker buildx use mybuilder
docker buildx inspect --bootstrap
cargo build --release -p subnet --target=x86_64-apple-darwin
cargo build --release -p movement --target=x86_64-apple-darwin
RUSTFLAGS="--cfg tokio_unstable" cargo build --release --target=x86_64-apple-darwin
- name: Archive macOS binaries
uses: actions/upload-artifact@v2
with:
name: macos-binaries
path: |
$GITHUB_WORKSPACE/target/x86_64-apple-darwin/release/subnet
$GITHUB_WORKSPACE/target/x86_64-apple-darwin/release/movement
$GITHUB_WORKSPACE/m1/target/x86_64-apple-darwin/release/*
- name: Build binaries for Linux arm64
run: |
cd "$GITHUB_WORKSPACE"
cd "$GITHUB_WORKSPACE/m1"
docker buildx create --name mybuilder
docker buildx use mybuilder
docker buildx inspect --bootstrap
cargo build --release -p subnet --target=aarch64-unknown-linux-gnu
cargo build --release -p movement --target=aarch64-unknown-linux-gnu
RUSTFLAGS="--cfg tokio_unstable" cargo build --release --target=aarch64-unknown-linux-gnu
- name: Archive Linux arm64 binaries
uses: actions/upload-artifact@v2
with:
name: linux-arm64-binaries
path: |
$GITHUB_WORKSPACE/target/aarch64-unknown-linux-gnu/release/subnet
$GITHUB_WORKSPACE/target/aarch64-unknown-linux-gnu/release/movement
$GITHUB_WORKSPACE/m1/target/aarch64-unknown-linux-gnu/release/*
- name: Build binaries for Linux x86_64
run: |
cd "$GITHUB_WORKSPACE"
cd "$GITHUB_WORKSPACE/m1"
docker buildx create --name mybuilder
docker buildx use mybuilder
docker buildx inspect --bootstrap
cargo build --release -p subnet --target=x86_64-unknown-linux-gnu
cargo build --release -p movement --target=x86_64-unknown-linux-gnu
RUSTFLAGS="--cfg tokio_unstable" cargo build --release --target=x86_64-unknown-linux-gnu
- name: Archive Linux x86_64 binaries
uses: actions/upload-artifact@v2
with:
name: linux-x86_64-binaries
path: |
$GITHUB_WORKSPACE/target/x86_64-unknown-linux-gnu/release/subnet
$GITHUB_WORKSPACE/target/x86_64-unknown-linux-gnu/release/movement
$GITHUB_WORKSPACE/m1/target/x86_64-unknown-linux-gnu/release/*
- name: Build binaries for Windows
run: |
cd "$GITHUB_WORKSPACE"
cd "$GITHUB_WORKSPACE/m1"
docker buildx create --name mybuilder
docker buildx use mybuilder
docker buildx inspect --bootstrap
cargo build --release -p subnet --target=x86_64-pc-windows-gnu
cargo build --release -p movement --target=x86_64-pc-windows-gnu
RUSTFLAGS="--cfg tokio_unstable" cargo build --release --target=x86_64-pc-windows-gnu
- name: Archive Windows binaries
uses: actions/upload-artifact@v2
with:
name: windows-binaries
path: |
$GITHUB_WORKSPACE/target/x86_64-pc-windows-gnu/release/subnet.exe
$GITHUB_WORKSPACE/target/x86_64-pc-windows-gnu/release/movement.exe
$GITHUB_WORKSPACE/m1/target/x86_64-pc-windows-gnu/release/*.exe
29 changes: 0 additions & 29 deletions .github/workflows/rust.yml

This file was deleted.

38 changes: 38 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
name: Rust Tests

on:
workflow_run:
workflows: ["Cargo Check"]
types:
- completed

jobs:
test:
runs-on: ubuntu-latest
if: ${{ github.event.workflow_run.conclusion == 'success' }}
steps:
- name: Checkout code
uses: actions/checkout@v2
with:
submodules: 'recursive'

- name: Set up Rust
uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: nightly

- name: Build and Test Subnet
run: |
cd ./m1
RUSTFLAGS="--cfg tokio_unstable" cargo build --all --all-targets
RUSTFLAGS="--cfg tokio_unstable" cargo test --all
- name: Update Badge
run: |
if [ $? -eq 0 ]; then
sed -i 's/badge\/tests-[a-zA-Z]*/badge\/tests-Passing-brightgreen/g' README.md
else
sed -i 's/badge\/tests-[a-zA-Z]*/badge\/tests-Failing-red/g' README.md
fi
if: ${{ always() }}
14 changes: 14 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
[submodule "aptos-core"]
path = aptos-core
url = https://github.com/movemntdev/aptos-core
branch = m1
[submodule "x25519-dalek"]
path = x25519-dalek
url = https://github.com/movemntdev/x25519-dalek
[submodule "ed25519-dalek"]
path = ed25519-dalek
url = https://github.com/movemntdev/ed25519-dalek
[submodule "aptos-pre-core"]
path = aptos-pre-core
url = https://github.com/movemntdev/aptos-core
branch = m1-pre-core
Loading

0 comments on commit 10d4174

Please sign in to comment.