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: refactor and improve times #1505

Merged
merged 10 commits into from
Nov 7, 2023
53 changes: 10 additions & 43 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,14 +28,22 @@ jobs:
remove-docker-images: 'true'
- uses: actions/checkout@v3
- uses: dtolnay/rust-toolchain@stable
- uses: rui314/setup-mold@v1
- uses: Swatinem/rust-cache@v2
with:
save-if: ${{ github.event_name == 'push' && github.ref == 'refs/heads/main' }}
- uses: Noelware/[email protected]
- uses: taiki-e/install-action@nextest
- name: Compile unit tests
run: timeout 25m cargo nextest run --all-targets --all-features --workspace --locked --no-run

run: cargo nextest run --all-targets --all-features --workspace --locked --no-run --timings
- name: Run unit tests
run: timeout 10m cargo nextest run --no-fail-fast --all-targets --all-features --workspace --locked
- name: Store timings
uses: actions/upload-artifact@v3
with:
name: timings
path: target/cargo-timings/
if-no-files-found: warn

clippy:
runs-on: ubuntu-latest
Expand All @@ -44,7 +52,6 @@ jobs:
- uses: dtolnay/rust-toolchain@stable
with:
components: clippy
- uses: Swatinem/rust-cache@v2
- uses: Noelware/[email protected]
- run: cargo clippy --workspace --all-targets --all-features --locked -- -D warnings -D rust_2018_idioms

Expand All @@ -55,7 +62,6 @@ jobs:
- uses: dtolnay/rust-toolchain@stable
with:
components: rustfmt
- uses: Swatinem/rust-cache@v2
- run: cargo fmt --all -- --check

doc:
Expand All @@ -65,7 +71,6 @@ jobs:
steps:
- uses: actions/checkout@v3
- uses: dtolnay/rust-toolchain@stable
- uses: Swatinem/rust-cache@v2
- uses: Noelware/[email protected]
- run: cargo doc --no-deps --document-private-items

Expand All @@ -78,28 +83,9 @@ jobs:
with:
crate: cargo-sort
version: "^1.0.9"
- uses: Swatinem/rust-cache@v2
- run: |
cargo sort --check --workspace

msrv:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: read msrv
id: msrv
run: |
msrv=$(grep -P "rust-version =" Cargo.toml | awk '{print $3}' | tr -d '"')
echo Found msrc: $msrv
echo "MSRV=$msrv" >> "$GITHUB_OUTPUT"
- uses: dtolnay/rust-toolchain@master
with:
toolchain: ${{ steps.msrv.outputs.MSRV }}
- uses: Noelware/[email protected]
- uses: Swatinem/rust-cache@v2
- name: check
run: cargo check

fuzz_targets:
runs-on: ubuntu-latest
steps:
Expand All @@ -108,22 +94,6 @@ jobs:
with:
toolchain: nightly
- uses: rui314/setup-mold@v1
with:
mold-version: 1.4.1
make-default: false
- name: Enable mold
run: |
mkdir -p $HOME/.cargo
cat << EOF >> $HOME/.cargo/config.toml
[target.x86_64-unknown-linux-gnu]
linker = "/usr/bin/clang"
rustflags = ["-C", "link-arg=-fuse-ld=/usr/local/bin/mold"]
EOF

cat $HOME/.cargo/config.toml
- uses: Swatinem/rust-cache@v2
with:
key: "mold"
- run: cargo install cargo-fuzz
- name: stark_hash
run: cargo fuzz build
Expand All @@ -134,9 +104,6 @@ jobs:
steps:
- uses: actions/checkout@v3
- uses: dtolnay/rust-toolchain@stable
- uses: Swatinem/rust-cache@v2
with:
workspaces: "crates/load-test"
- name: cargo check
run: |
cd crates/load-test
Expand Down
27 changes: 27 additions & 0 deletions .github/workflows/msrv.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
name: MSRV

on:
workflow_dispatch:
# Daily at midnight
schedule:
- cron: '0 0 * * *'

jobs:
msrv:
runs-on: ubuntu-latest
env:
CARGO_TERM_COLOR: always
steps:
- uses: actions/checkout@v3
- name: read msrv
id: msrv
run: |
msrv=$(grep -P "rust-version =" Cargo.toml | awk '{print $3}' | tr -d '"')
echo Found msrc: $msrv
echo "MSRV=$msrv" >> "$GITHUB_OUTPUT"
- uses: dtolnay/rust-toolchain@master
with:
toolchain: ${{ steps.msrv.outputs.MSRV }}
- uses: Noelware/[email protected]
- name: check
run: cargo check
128 changes: 16 additions & 112 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -76,4 +76,4 @@ thiserror = "1.0.48"
tokio = "1.29.1"
tracing = "0.1.37"
tracing-subscriber = { version = "0.3.17", features = ["env-filter"] }
zstd = "0.12.4"
zstd = { version = "0.12.4", features = ["pkg-config"] }
2 changes: 1 addition & 1 deletion crates/ethereum/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -22,5 +22,5 @@ tokio = { workspace = true }
tracing = { workspace = true }

[dev-dependencies]
httpmock = "0.6.8"
httpmock = "0.7.0-rc.1"
tokio = { workspace = true, features = ["macros"] }