Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CI: Update Valida pin #10

Merged
merged 21 commits into from
Feb 11, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
106 changes: 106 additions & 0 deletions .github/workflows/pincheck.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,106 @@
name: Nightly Valida Pin Update

on:
schedule:
- cron: '0 0 * * *' # Run at midnight UTC daily
workflow_dispatch:

jobs:
check-and-build-main:
runs-on: warp-custom-big-disk
permissions:
contents: write
packages: read

steps:
# Build latest Valida
- name: Checkout repo
uses: actions/checkout@v4
with:
repository: lita-xyz/valida-toolchain
ssh-key: ${{ secrets.ACCESS_VALIDA_TOOLCHAIN }}

- name: Install dependencies
run: |
sudo apt update
sudo apt install -y cmake ninja-build clang lld libstdc++-12-dev
if [ "$(uname -m)" = "x86_64" ]; then
sudo apt install -y gcc-multilib
fi

git clone https://github.com/lita-xyz/cargo-multiarch.git
cd cargo-multiarch
cargo install --locked --path .
cd ..

- name: Install Rust nightly toolchain
uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: nightly
components: rustfmt, clippy

- name: Build all projects
run: |
sudo mkdir -p /valida-toolchain
sudo mkdir -p /home/runner/.local/bin
sudo chown $(whoami):users /home/runner/.local/bin
sudo chown $(whoami):users /valida-toolchain
./configure-build-install.sh
rustup toolchain link valida /valida-toolchain

- name: Checkout Reva repository
uses: actions/checkout@v4

- name: Build Reva
id: reva
continue-on-error: true
run: |
cd bin/host
cargo +valida build --target=x86_64-unknown-linux-gnu --release

- name: Build Eth-client
id: eth
continue-on-error: true
run: |
cd bin/client-eth
cargo +valida build --release

- name: Clear failing build
if: steps.reva.outcome=='failure' || steps.eth.outcome=='failure'
run: |
sudo rm -rf /valida-toolchain/*

- name: Refresh current pin on failure
if: steps.reva.outcome=='failure' || steps.eth.outcome=='failure'
uses: WarpBuilds/[email protected]
with:
enableCrossArchArchive: true
path: /valida-toolchain/
key: valida-latest

- name: Delete existing cache on build success
if: steps.reva.outcome=='success' || steps.eth.outcome=='success'
uses: WarpBuilds/cache@v1
with:
path: /valida-toolchain/
key: valida-latest
delete-cache: true

- name: Update cache on success
if: steps.reva.outcome=='success' || steps.eth.outcome=='success'
uses: WarpBuilds/[email protected]
with:
enableCrossArchArchive: true
key: valida-latest
path: /valida-toolchain/

- name: Save Valida commit hash on success
if: steps.reva.outcome=='success' && steps.eth.outcome=='success'
run: |
git rev-parse HEAD > .valida-pin
git config --global user.email "github-actions[bot]@users.noreply.github.com"
git config --global user.name "github-actions[bot]"
git add .valida-pin
git commit -m "Update Valida pin"
git push
113 changes: 15 additions & 98 deletions .github/workflows/pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,53 +12,6 @@ concurrency:
cancel-in-progress: true

jobs:
# lock-files:
# name: "Check lock files"
# runs-on: ["runs-on", "runner=8cpu-linux-x64", "run-id=${{ github.run_id }}"]
# env:
# CARGO_NET_GIT_FETCH_WITH_CLI: "true"
# steps:
# - name: "Checkout sources"
# uses: "actions/checkout@v4"

# - name: "Update lock files"
# run: |
# cargo tree
# (cd ./bin/client-eth && cargo tree)
# (cd ./bin/client-op && cargo tree)
# (cd ./bin/client-linea && cargo tree)

# - name: "Assert no changes"
# run: |
# if [ -n "$(git status --porcelain)" ]; then
# echo "Lock files not up to date"
# exit 1
# fi

# deps-semver:
# name: "Check upstream SemVer violations"
# runs-on: ["runs-on", "runner=8cpu-linux-x64", "run-id=${{ github.run_id }}"]
# steps:
# - name: "Checkout sources"
# uses: "actions/checkout@v4"

# - name: "Install sp1up"
# run: |
# curl -L https://sp1.succinct.xyz | bash
# echo "$HOME/.sp1/bin" >> $GITHUB_PATH

# - name: "Install SP1 toolchain"
# run: |
# sp1up

# - name: "Remove lock files"
# run: |
# find -name Cargo.lock -type f -exec rm {} \;

# - name: "Build without lock files"
# run: |
# cargo build --all --all-targets

fmt:
name: "Run cargo fmt"
runs-on: warp-ubuntu-latest-x64-4x
Expand Down Expand Up @@ -96,65 +49,29 @@ jobs:
toolchain: nightly
components: clippy

- name: "Read Valida version"
id: valida-version
- name: "Make Dirs"
run: |
VALIDA_VERSION=$(cat valida-version-pin.txt)
echo "version=$VALIDA_VERSION" >> $GITHUB_OUTPUT
mkdir -p /home/runner/.local/bin
sudo mkdir -p /valida-toolchain/
sudo chown $(whoami):users /valida-toolchain

- name: "Download Valida binary release"
run: |
wget -nv https://github.com/lita-xyz/valida-releases/releases/latest/download/llvm-valida-${{ steps.valida-version.outputs.version }}-linux-x86_64.tar.xz
- name: Get cached Valida
uses: WarpBuilds/[email protected]
with:
enableCrossArchArchive: true
key: valida-latest
path: /valida-toolchain/

- name: "Install Valida"
run: |
mkdir -p /home/runner/.local/bin
tar -xf llvm-valida-${{ steps.valida-version.outputs.version }}-linux-x86_64.tar.xz
cd ./valida-toolchain
sudo ./install.sh
rustup toolchain link valida /valida-toolchain

- name: "Build Reva"
run: |
cd bin/host
cargo +valida build

# - name: "Run clippy lints"
# run: |
# cargo clippy --all --all-targets -- -D warnings

# tests:
# name: "Run tests"
# runs-on:
# ["runs-on", "runner=64cpu-linux-x64", "run-id=${{ github.run_id }}"]
# env:
# CARGO_NET_GIT_FETCH_WITH_CLI: "true"
# steps:
# - name: "Checkout sources"
# uses: "actions/checkout@v4"

# - name: "Install sp1up"
# run: |
# curl -L https://sp1.succinct.xyz | bash
# echo "$HOME/.sp1/bin" >> $GITHUB_PATH
cargo +valida build --target=x86_64-unknown-linux-gnu --release

# - name: "Install SP1 toolchain"
# run: |
# sp1up

# - name: "Set up test fixture"
# run: |
# git clone https://github.com/succinctlabs/reva-tests --branch 2024-09-11 --depth 1 ../reva-tests
# cd ../reva-tests/
# docker compose up -d

# - name: "Use local test fixture"
# run: |
# echo "RPC_1=http://localhost:9545/main/evm/1" >> $GITHUB_ENV
# echo "RPC_10=http://localhost:9545/main/evm/10" >> $GITHUB_ENV
# echo "RPC_59144=http://localhost:9545/main/evm/59144" >> $GITHUB_ENV

# - name: "Run tests"
# run: |
# export RUST_LOG=info
# cargo test --all -- --nocapture
- name: "Build eth-client"
run: |
cd bin/client-eth
cargo +valida build --release
1 change: 1 addition & 0 deletions .valida-pin
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
54a85da4000754c0ffde9818287db385b9a4aeda
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ To use ReVa, you must first have [the Valida tools](https://github.com/lita-xyz/
In the directory bin/host, run:

```console
cargo +valida build --release
cargo +valida build --target=x86_64-unknown-linux-gnu
```

this will build the binary `bin/host/target/release/reva` for your host architecture.
Expand Down
1 change: 0 additions & 1 deletion valida-version-pin.txt

This file was deleted.

Loading