Skip to content

Commit

Permalink
Merge pull request #616 from sbillig/ci-speedup
Browse files Browse the repository at this point in the history
CI speedup
  • Loading branch information
sbillig authored Dec 21, 2021
2 parents c605e1b + 0e6f953 commit 98967b5
Show file tree
Hide file tree
Showing 4 changed files with 38 additions and 56 deletions.
35 changes: 11 additions & 24 deletions .github/workflows/expensive.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,50 +2,37 @@ name: Expensive

on:
schedule:
- cron: '*/30 * * * *'
- cron: '*/60 * * * *'

env:
CARGO_TERM_COLOR: always

jobs:
test:
# Build & Test runs on all platforms
runs-on: ${{ matrix.os }}
strategy:
matrix:
include:
- os: ubuntu-latest
runs-on: ubuntu-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')
- name: Install system dependencies
run: |
"${GITHUB_WORKSPACE}/.github/install_deps.sh"
sudo apt-get install -y libboost-all-dev
- name: Install rust
uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: stable
override: true

- name: Cache Dependencies
uses: Swatinem/rust-cache@v1

- name: Build
run: cargo build --all-features --verbose
run: cargo test --workspace --all-features --no-run --locked -- --ignored
- name: Run expensive tests
id: expensive_tests
run: cargo test --workspace --features solc-backend --verbose -- --ignored
run: cargo test --workspace --all-features --verbose -- --ignored
- name: Report
if: failure() && steps.expensive_tests.outcome == 'failure'
run: |
cat ./crates/tests/proptest-regressions/differential.txt
53 changes: 22 additions & 31 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@ on:

env:
CARGO_TERM_COLOR: always
CARGO_INCREMENTAL: 0
RUSTFLAGS: "-D warnings"

jobs:
coverage:
Expand All @@ -19,24 +21,21 @@ jobs:
- 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') }}
sudo apt-get install -y libboost-all-dev
- name: Install rust
uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: stable
override: true
- name: Cache Dependencies
uses: Swatinem/rust-cache@v1
- name: install cargo-tarpaulin
run: |
cargo install cargo-quickinstall
cargo quickinstall cargo-tarpaulin
- name: coverage with tarpaulin
run: |
cargo install cargo-tarpaulin
make coverage
bash <(curl -s https://codecov.io/bash)
Expand All @@ -46,22 +45,16 @@ jobs:
- 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') }}
sudo apt-get install -y libboost-all-dev
- name: Install rust
uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: stable
override: true
components: rustfmt, clippy
- name: Cache Dependencies
uses: Swatinem/rust-cache@v1
- name: Validate doc examples
run: ./docs/validate_doc_examples.py
- name: Validate release notes entry
Expand All @@ -87,32 +80,26 @@ jobs:
- 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"
sudo apt-get install -y libboost-all-dev
- name: Install rust
uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: stable
override: true
- name: Cache Dependencies
uses: Swatinem/rust-cache@v1
- name: Build
run: cargo build --all-features --verbose
run: cargo test --workspace --all-features --no-run --locked
- name: Run tests
run: cargo test --workspace --features solc-backend --verbose
run: cargo test --workspace --all-features --verbose

wasm-test:
runs-on: ubuntu-latest
Expand All @@ -125,6 +112,10 @@ jobs:
profile: minimal
toolchain: stable
override: true
- name: Cache Dependencies
uses: Swatinem/rust-cache@v1
- name: Build WASM tests
run: wasm-pack test --node crates/fe -- --workspace --no-run
- name: Run WASM tests
# wasm-pack needs a Cargo.toml with a 'package' field.
# (see https://github.com/rustwasm/wasm-pack/issues/642)
Expand All @@ -150,7 +141,7 @@ jobs:
- name: Install Linux dependencies
if: startsWith(matrix.os,'ubuntu')
run: |
"${GITHUB_WORKSPACE}/.github/install_deps.sh"
sudo apt-get install -y libboost-all-dev
- name: Install Mac System dependencies
if: startsWith(matrix.os,'macOS')
run: |
Expand Down
4 changes: 4 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,7 @@ members = ["crates/*"]

[profile.dev.package.solc]
opt-level = 3

[profile.dev]
# Speeds up the build. May need to diable for debugging.
debug = 0
2 changes: 1 addition & 1 deletion docs/validate_doc_examples.py
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ def create_fe_file(snippet: CodeSnippet) -> pathlib.Path:
return fe_snippet_path

def run_snippet(path: pathlib.Path) -> 'subprocess.CompletedProcess[bytes]':
return subprocess.run(["cargo", "run", "--features", "solc-backend", str(path), '--overwrite'])
return subprocess.run(["cargo", "run", str(path), '--overwrite'])

def validate_code_examples() -> None:
TMP_SNIPPET_DIR.mkdir(exist_ok=True)
Expand Down

0 comments on commit 98967b5

Please sign in to comment.