Skip to content

Commit

Permalink
Merge pull request #28450 from ProvableHQ/fix/ci
Browse files Browse the repository at this point in the history
[Fix] Minor fixes to Leo CI.
  • Loading branch information
d0cd authored Nov 19, 2024
2 parents bcdb1f5 + b16d9ac commit 8d31693
Show file tree
Hide file tree
Showing 5 changed files with 41 additions and 10 deletions.
21 changes: 15 additions & 6 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand All @@ -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"
Expand All @@ -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:
Expand Down Expand Up @@ -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
Expand Down
6 changes: 6 additions & 0 deletions .circleci/leo-example.sh
Original file line number Diff line number Diff line change
@@ -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
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/codecov.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
20 changes: 18 additions & 2 deletions build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
2 changes: 1 addition & 1 deletion examples
Submodule examples updated 39 files
+1 −0 .gitignore
+7 −9 auction/build/main.aleo
+4 −4 auction/build/program.json
+2 −10 basic_bank/build/main.aleo
+4 −4 basic_bank/build/program.json
+0 −4 battleship/board/build/main.aleo
+0 −4 battleship/build/imports/board.aleo
+0 −2 battleship/build/imports/move.aleo
+0 −6 battleship/build/imports/verify.aleo
+0 −6 battleship/build/main.aleo
+4 −21 battleship/build/program.json
+0 −2 battleship/move/build/main.aleo
+0 −6 battleship/verify/build/main.aleo
+ bubblesort/build/build/main.avm
+0 −2 bubblesort/build/main.aleo
+1 −1 bubblesort/build/program.json
+0 −2 core/build/main.aleo
+244 −0 fibonacci/build/main.aleo
+6 −0 fibonacci/build/program.json
+1 −0 fibonacci/leo.lock
+0 −2 groups/build/main.aleo
+158 −1,059 hackers-delight/ntzdebruijn/build/main.aleo
+0 −2 hackers-delight/ntzgaudet/build/main.aleo
+0 −2 hackers-delight/ntzloops/build/main.aleo
+0 −2 hackers-delight/ntzmasks/build/main.aleo
+183 −1,409 hackers-delight/ntzreisers/build/main.aleo
+198 −1,643 hackers-delight/ntzseals/build/main.aleo
+190 −307 hackers-delight/ntzsearchtree/build/main.aleo
+0 −2 hackers-delight/ntzsmallvals/build/main.aleo
+0 −2 helloworld/build/main.aleo
+0 −3 interest/build/main.aleo
+2 −5 lottery/build/main.aleo
+0 −1 message/build/main.aleo
+0 −2 simple_token/build/main.aleo
+127 −138 tictactoe/build/main.aleo
+2 −16 token/build/main.aleo
+4 −4 token/src/main.leo
+0 −3 twoadicity/build/main.aleo
+8 −23 vote/build/main.aleo

0 comments on commit 8d31693

Please sign in to comment.