Skip to content

Commit

Permalink
Merge pull request #563 from stratum-mining/dev
Browse files Browse the repository at this point in the history
DO NOT MERGE
  • Loading branch information
Fi3 committed Jan 26, 2024
2 parents 96bf196 + cd3ab95 commit d53bdb7
Show file tree
Hide file tree
Showing 341 changed files with 23,608 additions and 9,309 deletions.
21 changes: 0 additions & 21 deletions .codecov.yaml

This file was deleted.

200 changes: 200 additions & 0 deletions .github/workflows/bencher.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,200 @@
name: Tracking benchmarks with Bencher

on:
workflow_run:
workflows: [Run and Cache Benchmarks]
types:
- completed

jobs:
track_sv1_criterion_with_bencher:
name: Track sv1 criterion benchmarks with Bencher
if: ${{ github.event.workflow_run.conclusion == 'success' }}
runs-on: ubuntu-latest
env:
BENCHER_PROJECT: stratum
BENCHER_API_TOKEN: ${{ secrets.BENCHER_API_TOKEN }}
BENCHER_ADAPTER: rust_criterion
BENCHER_TESTBED: sv1
BENCHMARK_RESULTS: criterion_sv1_benchmarks.txt
steps:
- name: Download Benchmark Results
uses: actions/github-script@v6
with:
script: |
let allArtifacts = await github.rest.actions.listWorkflowRunArtifacts({
owner: context.repo.owner,
repo: context.repo.repo,
run_id: context.payload.workflow_run.id,
});
let matchArtifact = allArtifacts.data.artifacts.filter((artifact) => {
return artifact.name == process.env.BENCHMARK_RESULTS
})[0];
let download = await github.rest.actions.downloadArtifact({
owner: context.repo.owner,
repo: context.repo.repo,
artifact_id: matchArtifact.id,
archive_format: 'zip',
});
let fs = require('fs');
fs.writeFileSync(`${process.env.GITHUB_WORKSPACE}/criterion_sv1_benchmarks.zip`, Buffer.from(download.data));
- name: Unzip Benchmark Results
run: unzip criterion_sv1_benchmarks.zip

- name: Setup Bencher
#uses: bencherdev/bencher@main
uses: baptiste0928/cargo-install@v2
with:
crate: bencher_cli
git: https://github.com/bencherdev/bencher
branch: devel

- name: Track Benchmarks with Bencher
run: |
cat criterion_sv1_benchmarks.txt | bencher run \
--github-actions ${{ secrets.GITHUB_TOKEN }}
track_sv2_criterion_with_bencher:
name: Track sv2 criterion benchmarks with Bencher
if: ${{ github.event.workflow_run.conclusion == 'success' }}
runs-on: ubuntu-latest
env:
BENCHER_PROJECT: stratum
BENCHER_API_TOKEN: ${{ secrets.BENCHER_API_TOKEN }}
BENCHER_ADAPTER: rust_criterion
BENCHER_TESTBED: sv2
BENCHMARK_RESULTS: criterion_sv2_benchmarks.txt
steps:
- name: Download Benchmark Results
uses: actions/github-script@v6
with:
script: |
let allArtifacts = await github.rest.actions.listWorkflowRunArtifacts({
owner: context.repo.owner,
repo: context.repo.repo,
run_id: context.payload.workflow_run.id,
});
let matchArtifact = allArtifacts.data.artifacts.filter((artifact) => {
return artifact.name == process.env.BENCHMARK_RESULTS
})[0];
let download = await github.rest.actions.downloadArtifact({
owner: context.repo.owner,
repo: context.repo.repo,
artifact_id: matchArtifact.id,
archive_format: 'zip',
});
let fs = require('fs');
fs.writeFileSync(`${process.env.GITHUB_WORKSPACE}/criterion_sv2_benchmarks.zip`, Buffer.from(download.data));
- name: Unzip Benchmark Results
run: unzip criterion_sv2_benchmarks.zip

- name: Setup Bencher
#uses: bencherdev/bencher@main
uses: baptiste0928/cargo-install@v2
with:
crate: bencher_cli
git: https://github.com/bencherdev/bencher
branch: devel

- name: Track Benchmarks with Bencher
run: |
cat criterion_sv2_benchmarks.txt | bencher run \
--github-actions ${{ secrets.GITHUB_TOKEN }}
track_sv1_iai_with_bencher:
name: Track sv1 iai benchmarks with Bencher
if: ${{ github.event.workflow_run.conclusion == 'success' }}
runs-on: ubuntu-latest
env:
BENCHER_PROJECT: stratum
BENCHER_API_TOKEN: ${{ secrets.BENCHER_API_TOKEN }}
BENCHER_ADAPTER: rust_iai
BENCHER_TESTBED: sv1
BENCHMARK_RESULTS: iai_sv1_benchmarks.txt
steps:
- name: Download Benchmark Results
uses: actions/github-script@v6
with:
script: |
let allArtifacts = await github.rest.actions.listWorkflowRunArtifacts({
owner: context.repo.owner,
repo: context.repo.repo,
run_id: context.payload.workflow_run.id,
});
let matchArtifact = allArtifacts.data.artifacts.filter((artifact) => {
return artifact.name == process.env.BENCHMARK_RESULTS
})[0];
let download = await github.rest.actions.downloadArtifact({
owner: context.repo.owner,
repo: context.repo.repo,
artifact_id: matchArtifact.id,
archive_format: 'zip',
});
let fs = require('fs');
fs.writeFileSync(`${process.env.GITHUB_WORKSPACE}/iai_sv1_benchmarks.zip`, Buffer.from(download.data));
- name: Unzip Benchmark Results
run: unzip iai_sv1_benchmarks.zip

- name: Setup Bencher
#uses: bencherdev/bencher@main
uses: baptiste0928/cargo-install@v2
with:
crate: bencher_cli
git: https://github.com/bencherdev/bencher
branch: devel

- name: Track Benchmarks with Bencher
run: |
cat iai_sv1_benchmarks.txt | bencher run \
--github-actions ${{ secrets.GITHUB_TOKEN }}
track_sv2_iai_with_bencher:
name: Track sv2 iai benchmarks with Bencher
if: ${{ github.event.workflow_run.conclusion == 'success' }}
runs-on: ubuntu-latest
env:
BENCHER_PROJECT: stratum
BENCHER_API_TOKEN: ${{ secrets.BENCHER_API_TOKEN }}
BENCHER_ADAPTER: rust_iai
BENCHER_TESTBED: sv2
BENCHMARK_RESULTS: iai_sv2_benchmarks.txt
steps:
- name: Download Benchmark Results
uses: actions/github-script@v6
with:
script: |
let allArtifacts = await github.rest.actions.listWorkflowRunArtifacts({
owner: context.repo.owner,
repo: context.repo.repo,
run_id: context.payload.workflow_run.id,
});
let matchArtifact = allArtifacts.data.artifacts.filter((artifact) => {
return artifact.name == process.env.BENCHMARK_RESULTS
})[0];
let download = await github.rest.actions.downloadArtifact({
owner: context.repo.owner,
repo: context.repo.repo,
artifact_id: matchArtifact.id,
archive_format: 'zip',
});
let fs = require('fs');
fs.writeFileSync(`${process.env.GITHUB_WORKSPACE}/iai_sv2_benchmarks.zip`, Buffer.from(download.data));
- name: Unzip Benchmark Results
run: unzip iai_sv2_benchmarks.zip

- name: Setup Bencher
#uses: bencherdev/bencher@main
uses: baptiste0928/cargo-install@v2
with:
crate: bencher_cli
git: https://github.com/bencherdev/bencher
branch: devel

- name: Track Benchmarks with Bencher
run: |
cat iai_sv2_benchmarks.txt | bencher run \
--github-actions ${{ secrets.GITHUB_TOKEN }}
110 changes: 110 additions & 0 deletions .github/workflows/benchmark.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,110 @@
name: Run and Cache Benchmarks

on: pull_request

jobs:
benchmark_sv1_criterion:
name: Run and cache criterion sv1 benchmarks
runs-on: ubuntu-latest
steps:
- name: Set up Rust
uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: 1.75.0
override: true

- name: Checkout repository
uses: actions/checkout@v2

- name: Benchmark
run: |
cd benches
cargo bench --bench criterion_sv1_benchmark > criterion_sv1_benchmarks.txt
- uses: actions/upload-artifact@v3
with:
name: criterion_sv1_benchmarks.txt
path: ./benches/criterion_sv1_benchmarks.txt

benchmark_sv2_criterion:
name: Run and cache criterion sv2 benchmarks
runs-on: ubuntu-latest
steps:
- name: Set up Rust
uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: 1.75.0
override: true

- name: Checkout repository
uses: actions/checkout@v2

- name: Benchmark
run: |
cd benches
cargo bench --bench criterion_sv2_benchmark > criterion_sv2_benchmarks.txt
- uses: actions/upload-artifact@v3
with:
name: criterion_sv2_benchmarks.txt
path: ./benches/criterion_sv2_benchmarks.txt

benchmark_sv1_iai:
name: Run and cache iai sv1 benchmarks
runs-on: ubuntu-latest
steps:
- name: Set up Rust
uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: 1.75.0
override: true

- name: Checkout repository
uses: actions/checkout@v2

- name: Install Valgrind
run: |
sudo apt-get update
sudo apt-get install -y valgrind=1:3.18.1-1ubuntu2
- name: Benchmark
run: |
cd benches
cargo bench --bench iai_sv1_benchmark > iai_sv1_benchmarks.txt
- uses: actions/upload-artifact@v3
with:
name: iai_sv1_benchmarks.txt
path: ./benches/iai_sv1_benchmarks.txt

benchmark_sv2_iai:
name: Run and cache iai sv2 benchmarks
runs-on: ubuntu-latest
steps:
- name: Set up Rust
uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: 1.75.0
override: true

- name: Checkout repository
uses: actions/checkout@v2

- name: Install Valgrind
run: |
sudo apt-get update
sudo apt-get install -y valgrind=1:3.18.1-1ubuntu2
- name: Benchmark
run: |
cd benches
cargo bench --bench iai_sv2_benchmark > iai_sv2_benchmarks.txt
- uses: actions/upload-artifact@v3
with:
name: iai_sv2_benchmarks.txt
path: ./benches/iai_sv2_benchmarks.txt
16 changes: 11 additions & 5 deletions .github/workflows/clippy-lint.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,11 @@ on:
push:
branches:
- main
- dev
pull_request:
branches:
- main
- dev
pull_request_review:
types: [submitted]
branches: [bot/versioning]
Expand All @@ -30,10 +32,14 @@ jobs:
- uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: 1.65.0
toolchain: 1.75.0
override: true
components: clippy
- uses: actions-rs/cargo@v1
with:
command: clippy
args: -- -D warnings -A dead-code
- name: Run Clippy on different workspaces and crates
run: |
cargo clippy --manifest-path=benches/Cargo.toml -- -D warnings -A dead-code
cargo clippy --manifest-path=common/Cargo.toml -- -D warnings -A dead-code
cargo clippy --manifest-path=protocols/Cargo.toml -- -D warnings -A dead-code
cargo clippy --manifest-path=roles/Cargo.toml -- -D warnings -A dead-code
cargo clippy --manifest-path=utils/Cargo.toml -- -D warnings -A dead-code
cargo clippy --manifest-path=utils/message-generator/Cargo.toml -- -D warnings -A dead-code
Loading

0 comments on commit d53bdb7

Please sign in to comment.