mirror of
https://github.com/ProvableHQ/leo.git
synced 2024-11-22 05:00:59 +03:00
Merge pull request #28450 from ProvableHQ/fix/ci
[Fix] Minor fixes to Leo CI.
This commit is contained in:
commit
8d316932c6
@ -42,15 +42,20 @@ commands:
|
||||
- run:
|
||||
name: Install Rust
|
||||
command: |
|
||||
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y
|
||||
source "$HOME/.cargo/env"
|
||||
rustup install 1.82.0
|
||||
rustup override set 1.82.0
|
||||
cargo --version --verbose
|
||||
rustc --version
|
||||
# If Rust is not installed on the machine, install it
|
||||
if ! command -v rustc &> /dev/null; then
|
||||
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y
|
||||
source "$HOME/.cargo/env"
|
||||
rustup install 1.82.0
|
||||
rustup override set 1.82.0
|
||||
cargo --version --verbose
|
||||
rustc --version
|
||||
fi
|
||||
if [ ! -f "Cargo.lock" ]; then
|
||||
cargo generate-lockfile
|
||||
fi
|
||||
cargo install cargo-mtime
|
||||
|
||||
|
||||
|
||||
install-rust-windows:
|
||||
@ -71,6 +76,7 @@ commands:
|
||||
if (!(Test-Path "Cargo.lock" -PathType Leaf)) {
|
||||
cargo generate-lockfile
|
||||
}
|
||||
cargo install cargo-mtime
|
||||
|
||||
build-and-test:
|
||||
description: "Build and run tests"
|
||||
@ -79,12 +85,14 @@ commands:
|
||||
name: Build
|
||||
no_output_timeout: 30m
|
||||
command: |
|
||||
cargo-mtime . ~/.cache/mtimes/project.db
|
||||
cargo test --no-run --all --locked --profile ci --features only_testnet
|
||||
- run:
|
||||
name: Run tests
|
||||
no_output_timeout: 30m
|
||||
# The `--verbose` flag is used to check which files are being recompiled. Ideally, this should be none.
|
||||
command: |
|
||||
cargo-mtime . ~/.cache/mtimes/project.db
|
||||
cargo test --all --locked --profile ci --features only_testnet --verbose
|
||||
|
||||
install_rust_nightly:
|
||||
@ -144,6 +152,7 @@ jobs:
|
||||
- cargo-v1-{{ arch }}-{{ checksum "Cargo.toml" }}-{{ checksum "Cargo.lock" }}
|
||||
- cargo-v1-{{ arch }}-{{ checksum "Cargo.toml" }}
|
||||
- cargo-v1-{{ arch }}
|
||||
- install-rust
|
||||
- run:
|
||||
name: Update Submodules
|
||||
command: git submodule update --init --recursive
|
||||
|
@ -1,3 +1,9 @@
|
||||
# Alias the leo command to use the local binary.
|
||||
# Note: Use a full path for $LEO when running locally.
|
||||
leo() {
|
||||
$LEO "$@"
|
||||
}
|
||||
|
||||
(
|
||||
# Create a new Leo lottery example program.
|
||||
$LEO example lottery || exit
|
||||
|
2
.github/workflows/codecov.yml
vendored
2
.github/workflows/codecov.yml
vendored
@ -55,7 +55,7 @@ jobs:
|
||||
make install DESTDIR=../../kcov-build
|
||||
cd ../..
|
||||
rm -rf kcov-master
|
||||
for file in target/debug/deps/*-*; do if [[ "$file" != *\.* ]]; then mkdir -p "target/cov/$(basename $file)"; ./kcov-build/usr/local/bin/kcov --exclude-pattern=/.cargo,/usr/lib --exclude-region='@kcov_skip(start):@kcov_skip(end)' --verify "target/cov/$(basename $file)" "$file"; fi done
|
||||
for file in target/ci/deps/*-*; do if [[ "$file" != *\.* ]]; then mkdir -p "target/cov/$(basename $file)"; ./kcov-build/usr/local/bin/kcov --exclude-pattern=/.cargo,/usr/lib --exclude-region='@kcov_skip(start):@kcov_skip(end)' --verify "target/cov/$(basename $file)" "$file"; fi done
|
||||
|
||||
- name: Upload coverage to Codecov
|
||||
uses: codecov/codecov-action@v3
|
||||
|
20
build.rs
20
build.rs
@ -71,8 +71,24 @@ fn check_file_licenses<P: AsRef<Path>>(path: P) {
|
||||
}
|
||||
}
|
||||
|
||||
// Re-run upon any changes to the workspace.
|
||||
println!("cargo:rerun-if-changed=.");
|
||||
// Watch the directories that contain Rust source files
|
||||
println!("cargo:rerun-if-changed=compiler");
|
||||
println!("cargo:rerun-if-changed=errors");
|
||||
println!("cargo:rerun-if-changed=leo");
|
||||
println!("cargo:rerun-if-changed=tests/test-framework");
|
||||
println!("cargo:rerun-if-changed=utils");
|
||||
|
||||
// Watch the build script itself
|
||||
println!("cargo:rerun-if-changed=build.rs");
|
||||
|
||||
// Watch the license header file
|
||||
println!("cargo:rerun-if-changed=.resources/license_header");
|
||||
|
||||
// Watch the Cargo.toml file
|
||||
println!("cargo:rerun-if-changed=Cargo.toml");
|
||||
|
||||
// Watch the Cargo.lock file
|
||||
println!("cargo:rerun-if-changed=Cargo.lock");
|
||||
}
|
||||
|
||||
// The build script; it currently only checks the licenses.
|
||||
|
2
examples
2
examples
@ -1 +1 @@
|
||||
Subproject commit b75bb77851667f6ece0af4cacfc27715aa7186aa
|
||||
Subproject commit 155f8410fb199c971b50950882a74ff593f8f5d9
|
Loading…
Reference in New Issue
Block a user