Skip to content

Commit

Permalink
Merge branch 'master' into shashank/cleanup-baseline-check
Browse files Browse the repository at this point in the history
  • Loading branch information
anorth authored Jun 4, 2024
2 parents 0c98215 + ea7c454 commit 741579b
Show file tree
Hide file tree
Showing 408 changed files with 52,607 additions and 20,255 deletions.
51 changes: 0 additions & 51 deletions .github/actions/rust-cargo-run/action.yml

This file was deleted.

12 changes: 12 additions & 0 deletions .github/workflows/audit.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
name: Cargo audit
on:
push:

jobs:
security_audit:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
- uses: actions-rs/audit-check@v1
with:
token: ${{ secrets.GITHUB_TOKEN }}
77 changes: 11 additions & 66 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,39 +5,39 @@ on:
branches:
- master
pull_request:
merge_group:

env:
RUSTFLAGS: -Dwarnings
CARGO_INCREMENTAL: 0 # Speeds up the build (no cache) and reduces disk space!

jobs:
rustfmt:
runs-on: ubuntu-latest
steps:
- name: Checking out
uses: actions/checkout@v2
uses: actions/checkout@v3
- name: Running rustfmt
run: make rustfmt

check-clippy:
runs-on: ubuntu-latest
steps:
- name: Checking out
uses: actions/checkout@v2
uses: actions/checkout@v3
- name: Running clippy
run: make check

test:
runs-on: ubuntu-latest
runs-on: ${{ fromJSON(github.repository == 'filecoin-project/builtin-actors' && '["self-hosted", "linux", "x64", "4xlarge"]' || '"ubuntu-latest"') }}
steps:
- name: Checking out
uses: actions/checkout@v2
uses: actions/checkout@v3
- if: env.RUNNER_ENVIRONMENT != 'github-hosted'
uses: dtolnay/rust-toolchain@stable
- name: Running tests
uses: ./.github/actions/rust-cargo-run
with:
command: test
args: --locked --all --no-fail-fast --exclude=fil_builtin_actors_bundle
github_token: ${{ secrets.GITHUB_TOKEN }}
save_cache: true
run: |
cargo test --locked --all --no-fail-fast --exclude=fil_builtin_actors_bundle
build:
runs-on: ubuntu-latest
Expand All @@ -46,64 +46,9 @@ jobs:
network: [ 'mainnet', 'caterpillarnet', 'butterflynet', 'calibrationnet', 'devnet', 'testing', 'testing-fake-proofs' ]
steps:
- name: Checking out
uses: actions/checkout@v2
- name: Install Rust toolchain
uses: ./.github/actions/rust-cargo-run
with:
command: version
github_token: ${{ secrets.GITHUB_TOKEN }}
uses: actions/checkout@v3
- name: Writing bundle
env:
BUILD_FIL_NETWORK: ${{ matrix.network }}
run: |
cargo run --locked -- -o output/builtin-actors.car
coverage:
runs-on: ubuntu-latest
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
steps:
- name: Checking out
uses: actions/checkout@v2
- name: Install Rust toolchain
uses: ./.github/actions/rust-cargo-run
with:
command: version
components: llvm-tools-preview
github_token: ${{ secrets.GITHUB_TOKEN }}
cache_name: v3-cov
save_cache: true
- name: Put LLVM tools into the PATH
run: echo "${HOME}/.rustup/toolchains/$(cat rust-toolchain)-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/bin" >> $GITHUB_PATH
- name: Install demangler
run: cargo install rustfilt
- name: Create coverage report
env:
# Make sure that each run of an executable creates a new profile file,
# with the default name they would override each other.
LLVM_PROFILE_FILE: "%m.profraw"
RUSTFLAGS: "-Cinstrument-coverage"
run: cargo test --workspace --exclude fil_builtin_actors_bundle
- name: Merge profiling data
# Do *not* use sparse output. It leads to more lines that are not taken
# into account at all
run: llvm-profdata merge --output=default.profdata $(find . -name '*.profraw')
- name: Create HTML coverage report
# The compiled files contain the coverage information. From running the
# tests we don't know what those files are called, hence use all files
# from the `./target/debug/deps` directory which don't have an extension.
run: |
OBJECT_OPTIONS=($(find ./target/debug/deps/* -name '*' -not -name '*\.*' -printf ' --object %p'))
# Create HTML report of this project, we don't care about coverage of
# dependencies
llvm-cov show --Xdemangler=rustfilt --show-expansions --show-line-counts-or-regions --ignore-filename-regex=".cargo|.rustup|/rustc|./tests/" --format=html --output-dir=./llvm-show --instr-profile=default.profdata ${OBJECT_OPTIONS[@]}
# Create file to be uploaded to codecov
llvm-cov export --ignore-filename-regex=".cargo|.rustup|/rustc|./tests" --format=lcov --instr-profile=default.profdata ${OBJECT_OPTIONS[@]} > lcov.info
- name: Archive code coverage results
uses: actions/upload-artifact@v3
with:
name: code-coverage-report
path: llvm-show/*
- name: Upload coverage to Codecov
uses: codecov/codecov-action@81cd2dc8148241f03f5839d295e000b8f761e378 # v3.1.0
with:
files: lcov.info
51 changes: 51 additions & 0 deletions .github/workflows/coverage.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
name: Coverage

on: workflow_dispatch

env:
RUSTFLAGS: -Dwarnings
CARGO_INCREMENTAL: 0 # Speeds up the build (no cache) and reduces disk space!

jobs:
coverage:
runs-on: ubuntu-latest
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
steps:
- name: Checking out
uses: actions/checkout@v3
- name: Put LLVM tools into the PATH
run: echo "$(rustc --print sysroot)/lib/rustlib/x86_64-unknown-linux-gnu/bin" >> $GITHUB_PATH
- name: Install demangler
run: sudo apt-get install -y rustfilt
- name: Create coverage report
env:
# Make sure that each run of an executable creates a new profile file,
# with the default name they would override each other.
LLVM_PROFILE_FILE: "%m.profraw"
RUSTFLAGS: "-Cinstrument-coverage"
run: cargo test --workspace --exclude fil_builtin_actors_bundle
- name: Merge profiling data
# Do *not* use sparse output. It leads to more lines that are not taken
# into account at all
run: llvm-profdata merge --output=default.profdata $(find . -name '*.profraw')
- name: Create HTML coverage report
# The compiled files contain the coverage information. From running the
# tests we don't know what those files are called, hence use all files
# from the `./target/debug/deps` directory which don't have an extension.
run: |
OBJECT_OPTIONS=($(find ./target/debug/deps/* -name '*' -not -name '*\.*' -printf ' --object %p'))
# Create HTML report of this project, we don't care about coverage of
# dependencies
llvm-cov show --Xdemangler=rustfilt --show-expansions --show-line-counts-or-regions --ignore-filename-regex=".cargo|.rustup|/rustc|./tests/" --format=html --output-dir=./llvm-show --instr-profile=default.profdata ${OBJECT_OPTIONS[@]}
# Create file to be uploaded to codecov
llvm-cov export --ignore-filename-regex=".cargo|.rustup|/rustc|./tests" --format=lcov --instr-profile=default.profdata ${OBJECT_OPTIONS[@]} > lcov.info
- name: Archive code coverage results
uses: actions/upload-artifact@v3
with:
name: code-coverage-report
path: llvm-show/*
- name: Upload coverage to Codecov
uses: codecov/codecov-action@d9f34f8cd5cb3b3eb79b3e4b5dae3a16df499a70 # v3.1.1
with:
files: lcov.info
13 changes: 7 additions & 6 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,13 @@ jobs:
network: [ 'mainnet', 'caterpillarnet', 'butterflynet', 'calibrationnet', 'devnet', 'testing', 'testing-fake-proofs' ]
steps:
- name: Checking out
uses: actions/checkout@v2
- name: Install Rust toolchain
uses: ./.github/actions/rust-cargo-run
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
command: version
uses: actions/checkout@v3
- name: Setting up cache
uses: pl-strflt/rust-sccache-action@v1
env:
SCCACHE_CACHE_SIZE: 2G
SCCACHE_DIR: ${{ github.workspace }}/.cache/sccache
CACHE_SKIP_SAVE: true
- name: Writing bundle
env:
BUILD_FIL_NETWORK: ${{ matrix.network }}
Expand Down
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,6 @@ target
*.wat
*.wasm
.idea/
.vscode/
**/.DS_Store
output/builtin-actors.car
output/*.car
Loading

0 comments on commit 741579b

Please sign in to comment.