Remove support for reentrant application calls (#1437) #98
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Rust | |
on: | |
push: | |
branches: [ main ] | |
pull_request: | |
branches: | |
- "**" | |
paths-ignore: | |
- 'CONTRIBUTING.md' | |
- 'INSTALL.md' | |
- 'docker/**' | |
- 'kubernetes/**' | |
workflow_dispatch: | |
# This allows a subsequently queued workflow run to interrupt previous runs on pull-requests | |
concurrency: | |
group: '${{ github.workflow }} @ ${{ github.event.pull_request.head.label || github.head_ref || github.run_id }}' | |
cancel-in-progress: true | |
env: | |
CARGO_TERM_COLOR: always | |
CARGO_INCREMENTAL: 0 | |
CARGO_NET_RETRY: 10 | |
RUST_BACKTRACE: short | |
# We allow redundant explicit links because `cargo rdme` doesn't know how to resolve implicit intra-crate links. | |
RUSTDOCFLAGS: -A rustdoc::redundant_explicit_links -D warnings | |
RUSTFLAGS: -D warnings | |
RUSTUP_MAX_RETRIES: 10 | |
RUST_LOG: warn | |
permissions: | |
contents: read | |
jobs: | |
test: | |
runs-on: ubuntu-latest-16-cores | |
timeout-minutes: 45 | |
steps: | |
- uses: actions/checkout@v3 | |
- uses: Twey/setup-rust-toolchain@v1 | |
- name: Clear up some space | |
run: | | |
sudo rm -rf /usr/share/dotnet | |
sudo rm -rf /opt/ghc | |
sudo rm -rf "/usr/local/share/boost" | |
sudo rm -rf "$AGENT_TOOLSDIRECTORY" | |
- name: Install Protoc | |
uses: arduino/setup-protoc@v1 | |
with: | |
repo-token: ${{ secrets.GITHUB_TOKEN }} | |
- name: Build example applications | |
run: | | |
cd examples | |
cargo build --locked --release --target wasm32-unknown-unknown | |
- name: Compile the workspace with the default features (test) | |
run: | | |
cargo test --locked --no-run | |
- name: Compile the workspace with the default features (build) | |
run: | | |
cargo build --locked | |
- name: Run all tests using the default features | |
run: | | |
cargo test --locked | |
- name: Run some extra execution tests with wasmtime | |
run: | | |
cargo test --locked -p linera-execution --features wasmtime | |
- name: Run the benchmark test | |
run: | | |
cargo build --locked -p linera-service --bin linera-benchmark --features benchmark | |
cargo test --locked -p linera-service --features benchmark test_end_to_end_fungible_benchmark | |
- name: Build Wasm test runner | |
# use debug mode to avoid building wasmtime in release mode | |
run: | | |
cargo build --locked --bin linera-wasm-test-runner | |
- name: Run Linera SDK Wasm tests | |
env: | |
CARGO_TARGET_WASM32_UNKNOWN_UNKNOWN_RUNNER: "target/debug/linera-wasm-test-runner" | |
run: | | |
cargo test --locked -p linera-sdk-wasm-tests --target wasm32-unknown-unknown | |
- name: Run Wasm application tests | |
run: | | |
cd examples | |
CARGO_TARGET_WASM32_UNKNOWN_UNKNOWN_RUNNER=../target/debug/linera-wasm-test-runner cargo test --target wasm32-unknown-unknown | |
cargo test --locked --target x86_64-unknown-linux-gnu | |
- name: Run Witty integration tests | |
run: | | |
cargo build -p linera-witty-test-modules --target wasm32-unknown-unknown | |
cargo test -p linera-witty --features wasmer,wasmtime | |
- name: Check for outdated CLI.md | |
run: | | |
if ! diff CLI.md <(cargo run --bin linera -- help-markdown) | |
then | |
echo '`CLI.md` differs from the output of `linera help-markdown`' | |
echo 'Run `linera help-markdown > CLI.md` to update it.' | |
exit 1 | |
fi | |
lint: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Clear up some space | |
run: | | |
sudo rm -rf /usr/share/dotnet | |
sudo rm -rf /opt/ghc | |
sudo rm -rf "/usr/local/share/boost" | |
sudo rm -rf "$AGENT_TOOLSDIRECTORY" | |
- name: Build check_copyright_header script | |
run: | | |
cd ./scripts/check_copyright_header | |
cargo build --locked --release | |
- name: Check Copyright headers | |
run: > | |
find linera-* examples -name '*.rs' -a -not -wholename '*/target/*' -print0 | |
| xargs -0 -L1 ./scripts/target/release/check_copyright_header | |
- name: Put lint toolchain file in place | |
run: | | |
ln -sf toolchains/lint/rust-toolchain.toml | |
- uses: Twey/setup-rust-toolchain@v1 | |
- name: Install cargo-machete | |
run: | | |
cargo install cargo-machete --locked | |
- name: Install cargo-all-features | |
run: | | |
cargo install --git https://github.com/ma2bd/cargo-all-features --branch workspace_metadata --locked | |
- name: Install cargo-rdme | |
run: | | |
cargo install cargo-rdme --locked | |
- name: Install Protoc | |
uses: arduino/setup-protoc@v1 | |
with: | |
repo-token: ${{ secrets.GITHUB_TOKEN }} | |
- name: Install cargo-sort | |
run: | | |
cargo install cargo-sort --locked | |
- name: Check formatting | |
run: | | |
cargo fmt -- --check | |
- name: Check for unused dependencies | |
run: | | |
cargo machete | |
- name: Check for outdated README.md | |
run: | | |
(set -e; for I in linera-*; do echo $I; cargo rdme --check --no-fail-on-warnings -w $I; done) | |
cd examples | |
(set -e; for I in fungible social crowd-funding; do echo $I; cargo rdme --check --no-fail-on-warnings -w $I; done) | |
- name: Run Wasm application lints | |
run: | | |
cd examples | |
cargo fmt -- --check | |
cargo clippy --all-targets --all-features --target wasm32-unknown-unknown --locked | |
cargo clippy --all-targets --all-features --target x86_64-unknown-linux-gnu --locked | |
- name: Run clippy | |
run: | | |
cargo clippy --all-targets --all-features --tests --locked | |
- name: Run cargo doc | |
run: | | |
cargo doc --locked --all-features | |
- name: Run cargo check-all-features | |
run: | | |
cargo check-all-features --all-targets | |
- name: Check if Cargo.toml files are sorted | |
run: | | |
cargo sort -c -w | |
- name: Check if Cargo.toml files are sorted | |
run: | | |
cd examples | |
cargo sort -c -w | |
- name: Restore `rust-toolchain.toml` file | |
if: '!cancelled()' | |
run: | | |
ln -sf toolchains/build/rust-toolchain.toml |