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

Bare bones for differential fuzzing #421

Merged
merged 8 commits into from May 31, 2021
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.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
250 changes: 124 additions & 126 deletions .github/workflows/main.yml
Expand Up @@ -2,169 +2,167 @@ name: CI

on:
push:
branches: [ master ]
branches: [master]
tags:
- v*

pull_request:
branches: [ master ]
branches: [master]

env:
CARGO_TERM_COLOR: always

jobs:

coverage:

runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2
- name: Install system dependencies
run: |
"${GITHUB_WORKSPACE}/.github/install_deps.sh"
- name: Cache Rust dependencies
uses: actions/cache@v1.1.2
with:
# There's a problem with caching serde, hence we exclude it here
path: |
target
!target/**/*serde*
key: ${{ runner.OS }}-build-v2-${{ hashFiles('**/Cargo.lock') }}
- name: Install rust
uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: stable
override: true
- name: coverage with tarpaulin
run: |
cargo install cargo-tarpaulin
make coverage
bash <(curl -s https://codecov.io/bash)
- uses: actions/checkout@v2
- name: Install system dependencies
run: |
"${GITHUB_WORKSPACE}/.github/install_deps.sh"
- name: Cache Rust dependencies
uses: actions/cache@v1.1.2
with:
# There's a problem with caching serde, hence we exclude it here
path: |
target
!target/**/*serde*
key: ${{ runner.OS }}-build-v2-${{ hashFiles('**/Cargo.lock') }}
- name: Install rust
uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: stable
override: true
- name: coverage with tarpaulin
run: |
cargo install cargo-tarpaulin
make coverage
bash <(curl -s https://codecov.io/bash)

lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Install system dependencies
run: |
"${GITHUB_WORKSPACE}/.github/install_deps.sh"
- name: Cache Rust dependencies
uses: actions/cache@v1.1.2
with:
# There's a problem with caching serde, hence we exclude it here
path: |
target
!target/**/*serde*
key: ${{ runner.OS }}-build-v2-${{ hashFiles('**/Cargo.lock') }}
- name: Install rust
uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: stable
override: true
components: rustfmt, clippy
- name: Validate release notes entry
run: ./newsfragments/validate_files.py
- name: Lint with rustfmt
uses: actions-rs/cargo@v1
with:
command: fmt
args: --all -- --check
- name: Lint with clippy
uses: actions-rs/cargo@v1
with:
command: clippy
args: --workspace --all-targets --all-features -- -D warnings
- uses: actions/checkout@v2
- name: Install system dependencies
run: |
"${GITHUB_WORKSPACE}/.github/install_deps.sh"
- name: Cache Rust dependencies
uses: actions/cache@v1.1.2
with:
# There's a problem with caching serde, hence we exclude it here
path: |
target
!target/**/*serde*
key: ${{ runner.OS }}-build-v2-${{ hashFiles('**/Cargo.lock') }}
- name: Install rust
uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: stable
override: true
components: rustfmt, clippy
- name: Validate release notes entry
run: ./newsfragments/validate_files.py
- name: Lint with rustfmt
uses: actions-rs/cargo@v1
with:
command: fmt
args: --all -- --check
- name: Lint with clippy
uses: actions-rs/cargo@v1
with:
command: clippy
args: --workspace --all-targets --all-features -- -D warnings

test:
# Build & Test runs on all platforms
runs-on: ${{ matrix.os }}
strategy:
matrix:
include:
- os: ubuntu-latest
- os: macOS-latest
- os: ubuntu-latest
- os: macOS-latest
steps:
- uses: actions/checkout@v2
- name: Cache Rust dependencies
uses: actions/cache@v1.1.2
with:
# There's a problem with caching serde, hence we exclude it here
path: |
target
!target/**/*serde*
key: ${{ runner.OS }}-build-v2-${{ hashFiles('**/Cargo.lock') }}
- name: Install Mac System dependencies
if: startsWith(matrix.os,'macOS')
run: |
brew install boost
- name: Install Linux dependencies
if: startsWith(matrix.os,'ubuntu')
run: |
"${GITHUB_WORKSPACE}/.github/install_deps.sh"
- name: Install rust
uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: stable
override: true
- name: Build
run: cargo build --all-features --verbose
- name: Run tests
run: cargo test --workspace --features solc-backend --verbose

wasm-test:
runs-on: ubuntu-latest
container: davesque/rust-wasm
steps:
- uses: actions/checkout@v2
- name: Cache Rust dependencies
uses: actions/cache@v1.1.2
with:
# There's a problem with caching serde, hence we exclude it here
path: |
target
!target/**/*serde*
key: ${{ runner.OS }}-build-v2-${{ hashFiles('**/Cargo.lock') }}
- name: Install Mac System dependencies
if: startsWith(matrix.os,'macOS')
run: |
brew install boost
- name: Install Linux dependencies
if: startsWith(matrix.os,'ubuntu')
run: |
"${GITHUB_WORKSPACE}/.github/install_deps.sh"
- name: Install rust
uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: stable
override: true
- name: Run WASM tests
run: wasm-pack test --node -- --workspace
- name: Build
run: cargo build --all-features --verbose
- name: Run tests
run: cargo test --workspace --features solc-backend --verbose

# wasm-test:
# runs-on: ubuntu-latest
# container: davesque/rust-wasm
# steps:
# - uses: actions/checkout@v2
# - name: Install rust
# uses: actions-rs/toolchain@v1
# with:
# profile: minimal
# toolchain: stable
# override: true
# - name: Run WASM tests
# run: wasm-pack test --node -- --workspace
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Guess that was temporary disabled during development for some reason. Can we roll it back now?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is intentional because now tests are living in a separate library which needs to go under workspace so new changes lead to compile the solc bindings to wasm as well which is not possible right now as wasm32-unknown-unknown is not supporting c++ bindings right now. We did decided to comment the wasm-pack test cases on the CI and to make it work for now and for the releases we will manually run the wasm-pack test cases locally to verify whether everything is good or not.


release:
# Only run this when we push a tag
if: startsWith(github.ref, 'refs/tags/')
runs-on: ${{ matrix.os }}
needs: [lint, test, wasm-test]
strategy:
matrix:
include:
# Only run this when we push a tag
if: startsWith(github.ref, 'refs/tags/')
runs-on: ${{ matrix.os }}
# needs: [lint, test, wasm-test]
needs: [lint, test]
strategy:
matrix:
include:
- os: ubuntu-latest
BIN_FILE: fe_amd64
- os: macOS-latest
BIN_FILE: fe_mac

steps:
- uses: actions/checkout@v2
- name: Install Linux dependencies
if: startsWith(matrix.os,'ubuntu')
run: |
"${GITHUB_WORKSPACE}/.github/install_deps.sh"
- name: Install Mac System dependencies
if: startsWith(matrix.os,'macOS')
run: |
brew install boost
- name: Install rust
uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: stable
override: true
- name: Build
run: cargo build --all-features --release && strip target/release/fe && mv target/release/fe target/release/${{ matrix.BIN_FILE }}
- name: Release
uses: softprops/action-gh-release@v1
with:
files: target/release/${{ matrix.BIN_FILE }}
prerelease: true
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
steps:
- uses: actions/checkout@v2
- name: Install Linux dependencies
if: startsWith(matrix.os,'ubuntu')
run: |
"${GITHUB_WORKSPACE}/.github/install_deps.sh"
- name: Install Mac System dependencies
if: startsWith(matrix.os,'macOS')
run: |
brew install boost
- name: Install rust
uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: stable
override: true
- name: Build
run: cargo build --all-features --release && strip target/release/fe && mv target/release/fe target/release/${{ matrix.BIN_FILE }}
- name: Release
uses: softprops/action-gh-release@v1
with:
files: target/release/${{ matrix.BIN_FILE }}
prerelease: true
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
44 changes: 44 additions & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

21 changes: 11 additions & 10 deletions Cargo.toml
@@ -1,26 +1,27 @@
[package]
name = "fe"
version = "0.5.0-alpha"
authors = ["David Sanders <david@ethereum.org>"]
edition = "2018"
license = "Apache-2.0"
repository = "https://github.com/ethereum/fe"
categories = ["cryptography::cryptocurrencies", "command-line-utilities", "development-tools"]
description = "An implementation of the Fe smart contract language"
edition = "2018"
keywords = ["ethereum", "fe", "yul", "smart", "contract", "compiler"]
categories = ["cryptography::cryptocurrencies", "command-line-utilities", "development-tools"]
license = "Apache-2.0"
name = "fe"
readme = "README.md"
repository = "https://github.com/ethereum/fe"
version = "0.5.0-alpha"

[workspace]
members = [".", "parser", "compiler"]
members = [".", "parser", "compiler", "tests"]

[features]
solc-backend = ["fe-compiler/solc-backend"]
solc-backend = ["fe-compiler/solc-backend", "fe-compiler-tests/solc-backend"]

[dependencies]
clap = "2.33.3"
fe-common = {path = "common", version = "^0.5.0-alpha"}
fe-parser = {path = "parser", version = "^0.5.0-alpha"}
fe-compiler = {path = "compiler", version = "^0.5.0-alpha"}
clap = "2.33.3"
fe-compiler-tests = {path = "tests", features = ["solc-backend"], version = "^0.4.0-alpha"}
fe-parser = {path = "parser", version = "^0.5.0-alpha"}

[dev-dependencies]
cargo-release = "0.13.9"
Expand Down