Skip to content

Commit

Permalink
Merge pull request #5 from lita-xyz/nhlita/ci-build
Browse files Browse the repository at this point in the history
CI build workflow
  • Loading branch information
morganthomas authored Jan 13, 2025
2 parents 7898e68 + 35f5d5c commit 1bf3dc1
Show file tree
Hide file tree
Showing 6 changed files with 2,714 additions and 5,027 deletions.
227 changes: 124 additions & 103 deletions .github/workflows/pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,62 +5,63 @@ on:
branches:
- "main"
pull_request:
workflow_dispatch:

concurrency:
group: "${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}"
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
# 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: "Check code format"
runs-on: ["runs-on", "runner=8cpu-linux-x64", "run-id=${{ github.run_id }}"]
name: "Run cargo fmt"
runs-on: warp-ubuntu-latest-x64-4x
steps:
- name: "Checkout sources"
uses: "actions/checkout@v4"
Expand All @@ -77,63 +78,83 @@ jobs:
run: |
cargo fmt --all -- --check
clippy:
name: "Run clippy lints"
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
# This step is necessary to generate the ELF files.
- name: "Build"
run: |
cargo build --all --all-targets
- 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"
Build:
name: "Build Reva"
runs-on: warp-custom-big-disk
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: "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: "remove default rust"
run: |
rustup self uninstall -y
- 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: Install Rust nightly toolchain
uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: nightly
components: clippy

- name: "Read Valida version"
id: valida-version
run: |
VALIDA_VERSION=$(cat valida-version-pin.txt)
echo "version=$VALIDA_VERSION" >> $GITHUB_OUTPUT
- 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: "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

# - 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
Loading

0 comments on commit 1bf3dc1

Please sign in to comment.