Skip to content
This repository has been archived by the owner on Nov 6, 2022. It is now read-only.

Commit

Permalink
Merge pull request #623 from OffchainLabs/develop
Browse files Browse the repository at this point in the history
Version Number and Branch Organization
  • Loading branch information
rachel-bousfield authored Sep 22, 2021
2 parents a16b184 + e5e299c commit 5bc83b7
Show file tree
Hide file tree
Showing 248 changed files with 57,953 additions and 16,329 deletions.
173 changes: 173 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,173 @@
name: CI

on:
workflow_dispatch:
pull_request:
push:
branches:
- master
- develop

env:
RUST_BACKTRACE: 1
RUSTFLAGS: -Dwarnings

jobs:
rustfmt:
name: Rust formatting check
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2

- name: Install stable
uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: stable
override: true
components: rustfmt

- name: Rustfmt
uses: actions-rs/cargo@v1
with:
command: fmt
args: --all -- --check

test:
name: Test with ${{ matrix.rust }} rust on ${{ matrix.os }}
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-20.04]
rust: [stable, nightly]
fail-fast: false

steps:
- name: Checkout
uses: actions/checkout@v1

- name: Install dependencies
run: |
sudo apt-get update && sudo apt-get install -y \
libasound2-dev libudev-dev build-essential pkg-config libssl-dev
- name: Install rust ${{ matrix.rust }}
uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: ${{ matrix.rust }}
override: true
components: ${{ matrix.rust == 'nightly' && 'llvm-tools-preview' || '' }}

- name: Install grcov if supported for rust ${{ matrix.rust }}
uses: actions-rs/[email protected]
if: matrix.rust == 'nightly'
with:
crate: grcov
version: latest
use-tool-cache: true

- name: Cache rust build products
uses: actions/cache@v2
with:
path: |
~/.cargo/registry
~/.cargo/git
target
key: ${{ matrix.os }}-cargo-${{ matrix.rust }}-${{ hashFiles('**/Cargo.lock') }}
restore-keys: |
${{ matrix.os }}-cargo-${{ matrix.rust }}-
- name: Build
uses: actions-rs/cargo@v1
with:
command: build
args: --all

- name: Set up code-coverage instrumentation if supported for rust ${{ matrix.rust }}
if: matrix.rust == 'nightly'
run: |
echo LLVM_PROFILE_FILE="your_name-%p-%m.profraw" >> $GITHUB_ENV
echo "CARGO_INCREMENTAL=0" >> $GITHUB_ENV
echo RUSTFLAGS="-Zinstrument-coverage" >> $GITHUB_ENV
echo RUSTDOCFLAGS="-Cpanic=abort" >> $GITHUB_ENV
- name: Install npm dependencies
run: |
sudo npm install -g yarn && cd contracts && yarn install
- name: Make and test ArbOS
run: make clean && make -j ci compile_options="-w"

- name: Check if ArbOS or replayTests changed
run: git update-index --refresh && git diff-index HEAD --

- name: Create code-coverage files if supported for rust ${{ matrix.rust }}
if: matrix.rust == 'nightly'
run: |
grcov . --binary-path ./target/release/ -s . -t lcov --branch --ignore-not-existing --ignore "/*" -o lcov.info
- name: Upload to codecov.io
uses: codecov/codecov-action@v1
if: matrix.rust == 'nightly'
with:
token: ${{ secrets.CODECOV_TOKEN }}
files: ./lcov.info,./lcov-mini.info
fail_ci_if_error: true
verbose: false

node:
name: Node integration test
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v1

- name: Install dependencies
run: |
sudo add-apt-repository -y ppa:longsleep/golang-backports
sudo apt-get update && sudo apt-get install -y \
autoconf automake cmake libboost-dev libboost-filesystem-dev libgmp-dev \
librocksdb-dev libssl-dev libgflags-dev libsnappy-dev zlib1g-dev libbz2-dev \
liblz4-dev libzstd-dev libtool golang-go clang-format cmake
sudo apt-get install librocksdb-dev
#
# If apt's rocksdb is ever out of date, we'll need to use the following
# git clone -b v6.11.4 https://github.com/facebook/rocksdb
# cd rocksdb && make shared_lib && sudo make install
#
curl -sSL "https://github.com/gotestyourself/gotestsum/releases/download/v1.7.0/gotestsum_1.7.0_linux_amd64.tar.gz" | sudo tar -xz -C /usr/local/bin gotestsum
- name: Clone Arbitrum
run: |
git clone --recursive https://github.com/OffchainLabs/arbitrum.git
cd arbitrum && git submodule update --init --recursive
- name: Copy over this branch's ArbOS
run: |
rm -r arbitrum/packages/arb-os/*
# We'd need `make testlogs` to generate these files
# cp -r testlogs/* arbitrum/packages/arb-avm-cpp/tests/arbos-cases/
mv * arbitrum/packages/arb-os/ || true
- name: Build Arbitrum
run: |
mkdir arbitrum/packages/arb-avm-cpp/debug/
cd $_
cmake .. -DCMAKE_BUILD_TYPE=Debug
make -j
- name: Test Node's C++ Database
run: |
./arbitrum/packages/arb-avm-cpp/build/bin/avm_tests
- name: Test Node's Core
run: |
cd arbitrum/packages/arb-node-core/
gotestsum --format testname | tee issues | grep FAIL
- name: Test Node's RPC
run: |
cd arbitrum/packages/arb-rpc-node/
gotestsum --format testname | tee issues | grep FAIL
34 changes: 28 additions & 6 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,22 +2,44 @@
# will have compiled files and executables
/target/

# Remove Cargo.lock from gitignore if creating an executable, leave it for libraries
# More information here https://doc.rust-lang.org/cargo/guide/cargo-toml-vs-cargo-lock.html
Cargo.lock

# These are backup files generated by rustfmt
**/*.rs.bk
arb_os/*.mao
arb_os/*.mexe
arb_os/evmJumpTable.mini
builtin/*.mao
builtin/*.mexe
upgradetests/*.mexe
stdlib/*.mao
stdlib/*.mexe
minitests/*.mao
minitests/*.mexe
contracts/add/node_modules/*
testlogs/*
arb_os/contractTemplates.mini
.idea
evm-tests/.travis.yml
evm-test-logs/*
**.bkp
**~
lcov.info
lcov-mini.info

# Files generated by Hardhat
contracts/artifacts
contracts/cache
contracts/node_modules
contracts/src/types
arb_os/save_bridge_for_debugging.mini

# Tooling
flamegraph.svg
perf.data

# coverage files
**.all
**.cov
**.partial

# auto-generated files
.make/
arb_os/bridge_arbos_versions.mini
arb_os/arbos-upgrade-base.mexe
3 changes: 3 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[submodule "evm-tests/tests"]
path = evm-tests/tests
url = https://github.com/ethereum/tests.git
Loading

0 comments on commit 5bc83b7

Please sign in to comment.