From 326d2992a8f4c6694ec450ce1bae462dd13e2d7c Mon Sep 17 00:00:00 2001 From: Lucas Clemente Vella Date: Fri, 25 Oct 2024 21:06:39 +0100 Subject: [PATCH] Attempt to make cache more useful for PR builds. --- .github/workflows/build-cache.yml | 20 +++++++++++++------- .github/workflows/pr-tests.yml | 12 ++++++++---- 2 files changed, 21 insertions(+), 11 deletions(-) diff --git a/.github/workflows/build-cache.yml b/.github/workflows/build-cache.yml index fe3154652..92a258319 100644 --- a/.github/workflows/build-cache.yml +++ b/.github/workflows/build-cache.yml @@ -15,20 +15,26 @@ jobs: - uses: actions/checkout@v4 with: submodules: recursive - - name: Install Rust toolchain 1.81 (with clippy and rustfmt) - run: rustup toolchain install 1.81-x86_64-unknown-linux-gnu && rustup component add clippy --toolchain 1.81-x86_64-unknown-linux-gnu && rustup component add rustfmt --toolchain 1.81-x86_64-unknown-linux-gnu + + ##### The block below is shared between cache build and PR build workflows ##### - name: Install EStarkPolygon prover dependencies run: sudo apt-get install -y nlohmann-json3-dev libpqxx-dev nasm - - name: Lint - run: cargo clippy --all --all-targets --all-features --profile pr-tests -- -D warnings - - name: Lint + - name: Install Rust toolchain nightly-2024-09-21 (with clippy and rustfmt) + run: rustup toolchain install nightly-2024-09-21-x86_64-unknown-linux-gnu && rustup component add clippy --toolchain nightly-2024-09-21-x86_64-unknown-linux-gnu && rustup component add rustfmt --toolchain nightly-2024-09-21-x86_64-unknown-linux-gnu + - name: Install Rust toolchain 1.81 (stable) + run: rustup toolchain install 1.81-x86_64-unknown-linux-gnu + - name: Cargo check with Rust 1.81 (default features) + run: cargo +1.81-x86_64-unknown-linux-gnu check --all-targets + - name: Lint no default features run: cargo clippy --all --all-targets --no-default-features --profile pr-tests -- -D warnings + - name: Lint all features + run: cargo clippy --all --all-targets --all-features --profile pr-tests -- -D warnings - name: Format run: cargo fmt --all --check --verbose - name: Build run: cargo build --all-targets --all --all-features --profile pr-tests - - name: Check without Halo2 - run: cargo check --all --no-default-features --profile pr-tests + ############################################################################### + - name: Save date of cache build run: date -R -u > target/cache-build-date.txt - name: ⚡ Save rust cache diff --git a/.github/workflows/pr-tests.yml b/.github/workflows/pr-tests.yml index b9a74538b..1561d4112 100644 --- a/.github/workflows/pr-tests.yml +++ b/.github/workflows/pr-tests.yml @@ -40,14 +40,16 @@ jobs: - name: Date of the restored cache run: cat target/cache-build-date.txt continue-on-error: true - - name: Install Rust toolchain nightly-2024-09-21 (with clippy and rustfmt) - run: rustup toolchain install nightly-2024-09-21-x86_64-unknown-linux-gnu && rustup component add clippy --toolchain nightly-2024-09-21-x86_64-unknown-linux-gnu && rustup component add rustfmt --toolchain nightly-2024-09-21-x86_64-unknown-linux-gnu + + ##### The block below is shared between cache build and PR build workflows ##### - name: Install EStarkPolygon prover dependencies run: sudo apt-get install -y nlohmann-json3-dev libpqxx-dev nasm + - name: Install Rust toolchain nightly-2024-09-21 (with clippy and rustfmt) + run: rustup toolchain install nightly-2024-09-21-x86_64-unknown-linux-gnu && rustup component add clippy --toolchain nightly-2024-09-21-x86_64-unknown-linux-gnu && rustup component add rustfmt --toolchain nightly-2024-09-21-x86_64-unknown-linux-gnu - name: Install Rust toolchain 1.81 (stable) - run: rustup toolchain install 1.81.0-x86_64-unknown-linux-gnu + run: rustup toolchain install 1.81-x86_64-unknown-linux-gnu - name: Cargo check with Rust 1.81 (default features) - run: rustup default 1.81.0-x86_64-unknown-linux-gnu && cargo +1.81.0-x86_64-unknown-linux-gnu check --all-targets --no-default-features + run: cargo +1.81-x86_64-unknown-linux-gnu check --all-targets - name: Lint no default features run: cargo clippy --all --all-targets --no-default-features --profile pr-tests -- -D warnings - name: Lint all features @@ -56,6 +58,8 @@ jobs: run: cargo fmt --all --check --verbose - name: Build run: cargo build --all-targets --all --all-features --profile pr-tests + ############################################################################### + - uses: taiki-e/install-action@nextest - name: Archive EStarkPolygon prover built dependencies run: tar --zstd -cf pil-stark-prover-deps.tar.zst target/pr-tests/build/pil-stark-prover-*/out