Skip to content
This repository has been archived by the owner on Nov 5, 2023. It is now read-only.

Commit

Permalink
ci: chores (paradigmxyz#5280)
Browse files Browse the repository at this point in the history
  • Loading branch information
DaniPopes authored Nov 4, 2023
1 parent bcd8e6f commit 6e0cf0f
Show file tree
Hide file tree
Showing 17 changed files with 199 additions and 391 deletions.
11 changes: 0 additions & 11 deletions .github/SANITY_DEPS_ISSUE_TEMPLATE.md

This file was deleted.

11 changes: 8 additions & 3 deletions .github/scripts/compare_iai.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,11 @@
#!/bin/bash
#!/usr/bin/env bash

# This script should be run on the main branch, after running the iai benchmarks on the target branch.
# If the main branch has a better iai performance, exits in error.
# It ignores L2 differences, since they seem hard to stabilize across runs.

# If the main branch has a better iai performance, exits in error. It ignores L2 differences, since they seem hard to stabilize across runs.
cargo bench --package reth-db --bench iai --manifest-path pr/Cargo.toml | tee /dev/tty | awk '/((L1)|(Ins)|(RAM)|(Est))+.*\(\+[1-9]+[0-9]*\..*%\)/{f=1} END{exit f}'
set -eo pipefail

cargo bench --package reth-db --bench iai --manifest-path pr/Cargo.toml \
| tee /dev/tty \
| awk '/((L1)|(Ins)|(RAM)|(Est))+.*\(\+[1-9]+[0-9]*\..*%\)/{f=1} END{exit f}'
20 changes: 0 additions & 20 deletions .github/scripts/fuzz.sh

This file was deleted.

23 changes: 23 additions & 0 deletions .github/scripts/install_geth.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
#!/usr/bin/env bash

# Installs Geth (https://geth.ethereum.org) in $HOME/bin for x86_64 Linux.

set -eo pipefail

GETH_BUILD=${GETH_BUILD:-"1.13.4-3f907d6a"}

name="geth-linux-amd64-$GETH_BUILD"

mkdir -p "$HOME/bin"
wget "https://gethstore.blob.core.windows.net/builds/$name.tar.gz"
tar -xvf "$name.tar.gz"
rm "$name.tar.gz"
mv "$name/geth" "$HOME/bin/geth"
rm -rf "$name"
chmod +x "$HOME/bin/geth"

# Add $HOME/bin to $PATH
[[ "$PATH" != *$HOME/bin* ]] && export PATH=$HOME/bin:$PATH
[ -n "$CI" ] && echo "$HOME/bin" >> "$GITHUB_PATH"

geth version
30 changes: 7 additions & 23 deletions .github/workflows/bench.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# Runs benchmarks.

on:
pull_request:
merge_group:
Expand All @@ -20,49 +22,31 @@ jobs:
if: github.event_name != 'pull_request'
steps:
- name: Checkout main sources
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
ref: main
path: main

- name: Checkout PR sources
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
clean: false
path: pr

- name: Install Valgrind
run: |
sudo apt update && sudo apt install valgrind
- name: Install toolchain
uses: dtolnay/rust-toolchain@stable

run: sudo apt update && sudo apt install valgrind
- uses: dtolnay/rust-toolchain@stable
- uses: Swatinem/rust-cache@v2
with:
workspaces: |
main -> target
pr -> target
cache-on-failure: true

- name: Generate test vectors
run: |
cargo run --bin reth --manifest-path main/Cargo.toml -- test-vectors tables
cp -r testdata main
mv testdata pr
- name: Set main baseline
run: cargo bench --package reth-db --bench iai --features test-utils --manifest-path main/Cargo.toml

- name: Compare PR benchmark
shell: 'script -q -e -c "bash {0}"' # required to workaround /dev/tty not being available
run: |
./pr/.github/scripts/compare_iai.sh
bench-success:
if: always()
name: bench success
runs-on: ubuntu-latest
steps:
# Note: This check is a dummy because we don't have any bench checks enabled.
- run: echo OK.
run: pr/.github/scripts/compare_iai.sh
11 changes: 6 additions & 5 deletions .github/workflows/book.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
# Documentation and mdbook related jobs.

name: book

on:
push:
branches: [main]
Expand All @@ -13,7 +16,7 @@ jobs:
timeout-minutes: 60

steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4

- name: Install mdbook
run: |
Expand All @@ -36,7 +39,7 @@ jobs:
timeout-minutes: 60

steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4

- name: Install mdbook-linkcheck
run: |
Expand All @@ -53,10 +56,8 @@ jobs:
runs-on: ubuntu-latest
timeout-minutes: 60
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@nightly
with:
toolchain: nightly-2023-10-29
- name: Install mdbook
run: |
mkdir mdbook
Expand Down
5 changes: 3 additions & 2 deletions .github/workflows/deny.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# Runs `cargo-deny` when modifying `Cargo.lock`.

name: deny

on:
Expand All @@ -10,7 +12,6 @@ on:
merge_group:

env:
RUSTFLAGS: -D warnings
CARGO_TERM_COLOR: always

concurrency: deny-${{ github.head_ref || github.run_id }}
Expand All @@ -20,7 +21,7 @@ jobs:
name: deny
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- uses: EmbarkStudios/cargo-deny-action@v1
with:
command: check all
4 changes: 2 additions & 2 deletions .github/workflows/dependencies.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Automatically run `cargo update` periodically
# Runs `cargo update` periodically.

name: Update Dependencies

Expand Down Expand Up @@ -31,7 +31,7 @@ jobs:
name: Update
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@nightly

- name: cargo update
Expand Down
16 changes: 6 additions & 10 deletions .github/workflows/docker.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# Publishes the Docker image.

name: docker

on:
Expand All @@ -21,24 +23,18 @@ jobs:
packages: write
contents: read
steps:
- name: Checkout sources
uses: actions/checkout@v3
- name: Get latest version of stable Rust
run: rustup update stable
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@stable
- uses: Swatinem/rust-cache@v2
with:
cache-on-failure: true

- uses: taiki-e/install-action@cross
- name: Log in to Docker
run: |
echo "${{ secrets.GITHUB_TOKEN }}" | docker login ghcr.io --username ${DOCKER_USERNAME} --password-stdin
- name: Set up Docker builder
run: |
docker run --privileged --rm tonistiigi/binfmt --install arm64,amd64
docker buildx create --use --name cross-builder
- name: Build and push image
run: |
cargo install cross
env PROFILE=maxperf make docker-build-latest
run: make PROFILE=maxperf docker-build-latest
61 changes: 0 additions & 61 deletions .github/workflows/fuzz.yml

This file was deleted.

Loading

0 comments on commit 6e0cf0f

Please sign in to comment.