Skip to content

Commit

Permalink
Merge pull request #34 from EspressoSystems/nm/move-test
Browse files Browse the repository at this point in the history
Move libp2p networking code to this repository
  • Loading branch information
nmccarty authored Mar 7, 2022
2 parents f7556c7 + 3d711ce commit 533efc4
Show file tree
Hide file tree
Showing 36 changed files with 7,408 additions and 360 deletions.
5 changes: 5 additions & 0 deletions .github/actions-rs/grcov.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
output-type: lcov
ignore:
- "/*"
- "../*"
- "target/*"
7 changes: 6 additions & 1 deletion .github/dependabot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,9 @@ updates:
- package-ecosystem: "cargo"
directory: "/"
schedule:
interval: "daily"
interval: "daily"

- package-ecosystem: "cargo"
directory: "/libp2p-networking"
schedule:
interval: "daily"
55 changes: 55 additions & 0 deletions .github/workflows/build_libp2p_networking.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
name: Build (libp2p-networking)

on:
push:
branches:
- main
pull_request:
branches:
- main
schedule:
- cron: '0 0 * * 1'
workflow_dispatch:

jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Cancel Outdated Builds
uses: styfle/[email protected]
with:
all_but_latest: true
access_token: ${{ github.token }}

- name: Checkout Repository
uses: actions/checkout@v3

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

- name: Enable Rust Caching
uses: Swatinem/rust-cache@v1

- name: Clippy
uses: actions-rs/clippy-check@v1
with:
token: ${{ github.token }}
args: --manifest-path libp2p-networking/Cargo.toml

# Does not work with a nested dir
# - name: Audit
# uses: actions-rs/audit-check@v1
# with:
# token: ${{ github.token }}

- name: Cargo Build
run: cargo build --release --manifest-path libp2p-networking/Cargo.toml

- name: Cargo Test
run: cargo test --verbose --release test_stress --manifest-path libp2p-networking/Cargo.toml -- -Zunstable-options --report-time --test-threads=1
53 changes: 53 additions & 0 deletions .github/workflows/coverage_libp2p_networking.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
name: Code Coverage (libp2p-newtorking)

on:
push:
branches:
- main
pull_request:
branches:
- main
schedule:
- cron: '0 0 * * 1'
workflow_dispatch:

jobs:
code-coverage:
runs-on: ubuntu-latest
steps:
- name: Checkout Repository
uses: actions/checkout@v3

- name: Install Rust Nightly Toolchain
uses: actions-rs/toolchain@v1
with:
toolchain: nightly
override: true

- name: Run Cargo Test With Coverage Options
uses: actions-rs/cargo@v1
with:
command: test
args: --all-features --no-fail-fast test_coverage -- --test-threads=1
env:
CARGO_INCREMENTAL: '0'
RUSTFLAGS: '-Zprofile -Ccodegen-units=1 -Cinline-threshold=0 -Clink-dead-code -Coverflow-checks=off -Cpanic=abort -Zpanic_abort_tests'
RUSTDOCFLAGS: '-Zprofile -Ccodegen-units=1 -Cinline-threshold=0 -Clink-dead-code -Coverflow-checks=off -Cpanic=abort -Zpanic_abort_tests'

# TODO: Seems like we can't override the path where grcov runs, so we're currently code coveraging the main repo
# - name: Install grcov
# run: |
# wget -O grcov.tar.gz https://github.com/mozilla/grcov/releases/download/v0.8.2/grcov-linux-x86_64.tar.bz2
# tar -xvf grcov.tar.gz
# sudo mv -v grcov /home/runner/.cargo/bin/
# rm -rv grcov.tar.gz

# - name: Run Coverage Tool (grcov)
# uses: actions-rs/[email protected]
# id: coverage

# - name: Coveralls upload
# uses: coverallsapp/github-action@master
# with:
# github-token: ${{ secrets.GITHUB_TOKEN }}
# path-to-lcov: ${{ steps.coverage.outputs.report }}
Loading

0 comments on commit 533efc4

Please sign in to comment.