From 295dd81525e107a8c8fd61f5c7509d6bce3fb00b Mon Sep 17 00:00:00 2001 From: bit-aloo Date: Wed, 9 Oct 2024 18:53:34 +0530 Subject: [PATCH 01/14] add codecov upload action in coverage.yaml --- .github/workflows/coverage.yaml | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/.github/workflows/coverage.yaml b/.github/workflows/coverage.yaml index c8e18d346..c77a8ac57 100644 --- a/.github/workflows/coverage.yaml +++ b/.github/workflows/coverage.yaml @@ -48,3 +48,27 @@ jobs: protocols/cobertura.xml roles/cobertura.xml utils/cobertura.xml + + codecov: + needs: tarpaulin-test + + name: Codecov Upload + runs-on: ubuntu-latest + + steps: + + - name: Checkout repository + uses: actions/checkout@v3 + + - name: Download all workflow run artifacts + uses: actions/download-artifact@v3 + + - name: Display structure of downloaded files + run: ls -R + + - name: Upload to codecov.io + uses: codecov/codecov-action@v3 + with: + files: tarpaulin-report/*.xml + fail_ci_if_error: true + token: ${{ secrets.CODECOV_TOKEN }} \ No newline at end of file From aa497244a2002640d25792473f01a99a3b990d5d Mon Sep 17 00:00:00 2001 From: bit-aloo Date: Wed, 9 Oct 2024 22:05:13 +0530 Subject: [PATCH 02/14] test --- .github/workflows/coverage.yaml | 4 ++-- protocols/tarpaulin.toml | 4 ++-- roles/tarpaulin.toml | 2 +- scripts/tarpaulin.sh | 6 +++--- utils/tarpaulin.toml | 2 +- 5 files changed, 9 insertions(+), 9 deletions(-) diff --git a/.github/workflows/coverage.yaml b/.github/workflows/coverage.yaml index c77a8ac57..89771e0a4 100644 --- a/.github/workflows/coverage.yaml +++ b/.github/workflows/coverage.yaml @@ -48,7 +48,7 @@ jobs: protocols/cobertura.xml roles/cobertura.xml utils/cobertura.xml - + codecov: needs: tarpaulin-test @@ -69,6 +69,6 @@ jobs: - name: Upload to codecov.io uses: codecov/codecov-action@v3 with: - files: tarpaulin-report/*.xml + files: utils/*.xml roles/*.xml protocols/*.xml fail_ci_if_error: true token: ${{ secrets.CODECOV_TOKEN }} \ No newline at end of file diff --git a/protocols/tarpaulin.toml b/protocols/tarpaulin.toml index d611e2d34..d7a7d3283 100644 --- a/protocols/tarpaulin.toml +++ b/protocols/tarpaulin.toml @@ -1,8 +1,8 @@ [default] features = "disable_nopanic prop_test noise_sv2 with_buffer_pool derive_codec_sv2 binary_codec_sv2 default core" run-types = [ "Lib" ] -timeout = "120s" -fail-under = 20 +timeout = "1200s" +fail-under = 0 [report] out = ["Xml"] diff --git a/roles/tarpaulin.toml b/roles/tarpaulin.toml index 2714d685d..47e6ecba5 100644 --- a/roles/tarpaulin.toml +++ b/roles/tarpaulin.toml @@ -2,7 +2,7 @@ features = "with_buffer_pool async_std tokio with_tokio default" run-types = [ "Lib" ] timeout = "120s" -fail-under = 20 +fail-under = 0 [report] out = ["Xml"] diff --git a/scripts/tarpaulin.sh b/scripts/tarpaulin.sh index 9e0f226f3..dd45abe56 100755 --- a/scripts/tarpaulin.sh +++ b/scripts/tarpaulin.sh @@ -5,9 +5,9 @@ tarpaulin() cargo +nightly tarpaulin --verbose } -cd protocols -tarpaulin -cd ../roles +# cd protocols +# tarpaulin +cd roles tarpaulin cd ../utils tarpaulin diff --git a/utils/tarpaulin.toml b/utils/tarpaulin.toml index c704c0f94..860704720 100644 --- a/utils/tarpaulin.toml +++ b/utils/tarpaulin.toml @@ -1,7 +1,7 @@ [default] run-types = [ "Lib" ] timeout = "120s" -fail-under = 7 +fail-under = 0 [report] out = ["Xml"] From c98ec214f7755c3f7dc9e1e28ecb15944c5860f7 Mon Sep 17 00:00:00 2001 From: bit-aloo Date: Wed, 9 Oct 2024 22:17:22 +0530 Subject: [PATCH 03/14] test2 --- .gitignore | 1 - roles/cobertura.xml | 1 + utils/cobertura.xml | 1 + 3 files changed, 2 insertions(+), 1 deletion(-) create mode 100644 roles/cobertura.xml create mode 100644 utils/cobertura.xml diff --git a/.gitignore b/.gitignore index b1881a1fc..398347e3e 100644 --- a/.gitignore +++ b/.gitignore @@ -14,7 +14,6 @@ lcov.info .vscode *.py **/conf/** -cobertura.xml /roles/*/*-config.toml /examples/*/Cargo.lock /scripts/sv2.h diff --git a/roles/cobertura.xml b/roles/cobertura.xml new file mode 100644 index 000000000..ceddae7c6 --- /dev/null +++ b/roles/cobertura.xml @@ -0,0 +1 @@ +/home/shourya/stratum/roles \ No newline at end of file diff --git a/utils/cobertura.xml b/utils/cobertura.xml new file mode 100644 index 000000000..2ce6cacd4 --- /dev/null +++ b/utils/cobertura.xml @@ -0,0 +1 @@ +/home/shourya/stratum/utils \ No newline at end of file From 5e30a6f8c869d557ee319654eac7eda057c7b933 Mon Sep 17 00:00:00 2001 From: bit-aloo Date: Wed, 9 Oct 2024 22:29:26 +0530 Subject: [PATCH 04/14] test3 --- .github/workflows/coverage.yaml | 42 ++++++++++++++++----------------- 1 file changed, 21 insertions(+), 21 deletions(-) diff --git a/.github/workflows/coverage.yaml b/.github/workflows/coverage.yaml index 89771e0a4..d6dcc02e9 100644 --- a/.github/workflows/coverage.yaml +++ b/.github/workflows/coverage.yaml @@ -25,32 +25,32 @@ on: - main jobs: - tarpaulin-test: + # tarpaulin-test: - name: Tarpaulin Test - runs-on: ubuntu-latest - container: - image: xd009642/tarpaulin:0.27.1-nightly - options: --security-opt seccomp=unconfined - steps: - - name: Checkout repository - uses: actions/checkout@v4 + # name: Tarpaulin Test + # runs-on: ubuntu-latest + # container: + # image: xd009642/tarpaulin:0.27.1-nightly + # options: --security-opt seccomp=unconfined + # steps: + # - name: Checkout repository + # uses: actions/checkout@v4 - - name: Generate code coverage - run: | - ./scripts/tarpaulin.sh + # - name: Generate code coverage + # run: | + # ./scripts/tarpaulin.sh - - name: Archive Tarpaulin code coverage results - uses: actions/upload-artifact@v4 - with: - name: tarpaulin-report - path: | - protocols/cobertura.xml - roles/cobertura.xml - utils/cobertura.xml + # - name: Archive Tarpaulin code coverage results + # uses: actions/upload-artifact@v4 + # with: + # name: tarpaulin-report + # path: | + # protocols/cobertura.xml + # roles/cobertura.xml + # utils/cobertura.xml codecov: - needs: tarpaulin-test + # needs: tarpaulin-test name: Codecov Upload runs-on: ubuntu-latest From 0cb2cca56988214b492c942f5260fa3a03ad27b6 Mon Sep 17 00:00:00 2001 From: bit-aloo Date: Wed, 9 Oct 2024 22:36:55 +0530 Subject: [PATCH 05/14] test4 --- .github/workflows/coverage.yaml | 44 ++++++++++++++++----------------- 1 file changed, 22 insertions(+), 22 deletions(-) diff --git a/.github/workflows/coverage.yaml b/.github/workflows/coverage.yaml index d6dcc02e9..1a675f812 100644 --- a/.github/workflows/coverage.yaml +++ b/.github/workflows/coverage.yaml @@ -25,32 +25,32 @@ on: - main jobs: - # tarpaulin-test: + tarpaulin-test: - # name: Tarpaulin Test - # runs-on: ubuntu-latest - # container: - # image: xd009642/tarpaulin:0.27.1-nightly - # options: --security-opt seccomp=unconfined - # steps: - # - name: Checkout repository - # uses: actions/checkout@v4 + name: Tarpaulin Test + runs-on: ubuntu-latest + container: + image: xd009642/tarpaulin:0.27.1-nightly + options: --security-opt seccomp=unconfined + steps: + - name: Checkout repository + uses: actions/checkout@v4 - # - name: Generate code coverage - # run: | - # ./scripts/tarpaulin.sh + # - name: Generate code coverage + # run: | + # ./scripts/tarpaulin.sh - # - name: Archive Tarpaulin code coverage results - # uses: actions/upload-artifact@v4 - # with: - # name: tarpaulin-report - # path: | - # protocols/cobertura.xml - # roles/cobertura.xml - # utils/cobertura.xml + - name: Archive Tarpaulin code coverage results + uses: actions/upload-artifact@v4 + with: + name: tarpaulin-report + path: | + protocols/cobertura.xml + roles/cobertura.xml + utils/cobertura.xml codecov: - # needs: tarpaulin-test + needs: tarpaulin-test name: Codecov Upload runs-on: ubuntu-latest @@ -69,6 +69,6 @@ jobs: - name: Upload to codecov.io uses: codecov/codecov-action@v3 with: - files: utils/*.xml roles/*.xml protocols/*.xml + files: tarpaulin-report/*.xml fail_ci_if_error: true token: ${{ secrets.CODECOV_TOKEN }} \ No newline at end of file From 164caf4c9802f51f54e0bec3284b55137c3bb3dc Mon Sep 17 00:00:00 2001 From: bit-aloo Date: Wed, 9 Oct 2024 22:45:09 +0530 Subject: [PATCH 06/14] test5 --- .github/workflows/coverage.yaml | 36 +++++++++++++++++---------------- 1 file changed, 19 insertions(+), 17 deletions(-) diff --git a/.github/workflows/coverage.yaml b/.github/workflows/coverage.yaml index 1a675f812..0ad5d5099 100644 --- a/.github/workflows/coverage.yaml +++ b/.github/workflows/coverage.yaml @@ -48,27 +48,29 @@ jobs: protocols/cobertura.xml roles/cobertura.xml utils/cobertura.xml + + - name: Upload to codecov.io + uses: codecov/codecov-action@v3 + with: + files: utils/*.xml protocols/*.xml roles/*.xml + fail_ci_if_error: true + token: ${{ secrets.CODECOV_TOKEN }} - codecov: - needs: tarpaulin-test + # codecov: + # needs: tarpaulin-test - name: Codecov Upload - runs-on: ubuntu-latest + # name: Codecov Upload + # runs-on: ubuntu-latest - steps: + # steps: - - name: Checkout repository - uses: actions/checkout@v3 + # - name: Checkout repository + # uses: actions/checkout@v3 - - name: Download all workflow run artifacts - uses: actions/download-artifact@v3 + # - name: Download all workflow run artifacts + # uses: actions/download-artifact@v3 - - name: Display structure of downloaded files - run: ls -R + # - name: Display structure of downloaded files + # run: ls -R - - name: Upload to codecov.io - uses: codecov/codecov-action@v3 - with: - files: tarpaulin-report/*.xml - fail_ci_if_error: true - token: ${{ secrets.CODECOV_TOKEN }} \ No newline at end of file + \ No newline at end of file From 672622fc08ea0a1f2be16335acfba6350d7ee9de Mon Sep 17 00:00:00 2001 From: bit-aloo Date: Wed, 9 Oct 2024 22:47:49 +0530 Subject: [PATCH 07/14] test6 --- .github/workflows/coverage.yaml | 22 +++++++++++++--------- 1 file changed, 13 insertions(+), 9 deletions(-) diff --git a/.github/workflows/coverage.yaml b/.github/workflows/coverage.yaml index 0ad5d5099..3e6f04638 100644 --- a/.github/workflows/coverage.yaml +++ b/.github/workflows/coverage.yaml @@ -40,19 +40,23 @@ jobs: # run: | # ./scripts/tarpaulin.sh - - name: Archive Tarpaulin code coverage results - uses: actions/upload-artifact@v4 - with: - name: tarpaulin-report - path: | - protocols/cobertura.xml - roles/cobertura.xml - utils/cobertura.xml + # - name: Archive Tarpaulin code coverage results + # uses: actions/upload-artifact@v4 + # with: + # name: tarpaulin-report + # path: | + # protocols/cobertura.xml + # roles/cobertura.xml + # utils/cobertura.xml + + + - name: Display structure of downloaded files + run: ls -R - name: Upload to codecov.io uses: codecov/codecov-action@v3 with: - files: utils/*.xml protocols/*.xml roles/*.xml + files: utils/*.xml roles/*.xml fail_ci_if_error: true token: ${{ secrets.CODECOV_TOKEN }} From f24e40cf10e9ce29bff55e49f6d1857eaa623acc Mon Sep 17 00:00:00 2001 From: bit-aloo Date: Wed, 9 Oct 2024 22:55:56 +0530 Subject: [PATCH 08/14] test7 --- .github/workflows/coverage.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/coverage.yaml b/.github/workflows/coverage.yaml index 3e6f04638..48d8348d4 100644 --- a/.github/workflows/coverage.yaml +++ b/.github/workflows/coverage.yaml @@ -56,7 +56,7 @@ jobs: - name: Upload to codecov.io uses: codecov/codecov-action@v3 with: - files: utils/*.xml roles/*.xml + files: utils/cobertura.xml roles/cobertura.xml fail_ci_if_error: true token: ${{ secrets.CODECOV_TOKEN }} From d4214335242932ee45fec02a3787901e9ff8ff74 Mon Sep 17 00:00:00 2001 From: bit-aloo Date: Wed, 9 Oct 2024 22:59:17 +0530 Subject: [PATCH 09/14] test8 --- .github/workflows/coverage.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/coverage.yaml b/.github/workflows/coverage.yaml index 48d8348d4..3b2abcad0 100644 --- a/.github/workflows/coverage.yaml +++ b/.github/workflows/coverage.yaml @@ -56,7 +56,7 @@ jobs: - name: Upload to codecov.io uses: codecov/codecov-action@v3 with: - files: utils/cobertura.xml roles/cobertura.xml + files: ./utils/cobertura.xml ./roles/cobertura.xml fail_ci_if_error: true token: ${{ secrets.CODECOV_TOKEN }} From 47c345a0ba48e2f6052bdc6899cb1abbde6ad55b Mon Sep 17 00:00:00 2001 From: bit-aloo Date: Wed, 9 Oct 2024 23:04:53 +0530 Subject: [PATCH 10/14] test9 --- .github/workflows/auto-rebase.yaml | 77 ----- .github/workflows/clippy-lint.yaml | 40 --- .github/workflows/fmt.yaml | 40 --- .github/workflows/lockfiles.yaml | 28 -- .github/workflows/mg.yaml | 224 --------------- .github/workflows/release-libs.yaml | 144 ---------- .../run-and-track-benchmarks-on-main.yaml | 124 -------- .github/workflows/run-benchmarks.yaml | 124 -------- .github/workflows/rust-msrv.yaml | 35 --- .github/workflows/semver-check.yaml | 129 --------- .github/workflows/sv2-header-check.yaml | 34 --- .github/workflows/test.yaml | 91 ------ .github/workflows/track-benchmarks.yaml | 268 ------------------ 13 files changed, 1358 deletions(-) delete mode 100644 .github/workflows/auto-rebase.yaml delete mode 100644 .github/workflows/clippy-lint.yaml delete mode 100644 .github/workflows/fmt.yaml delete mode 100644 .github/workflows/lockfiles.yaml delete mode 100644 .github/workflows/mg.yaml delete mode 100644 .github/workflows/release-libs.yaml delete mode 100644 .github/workflows/run-and-track-benchmarks-on-main.yaml delete mode 100644 .github/workflows/run-benchmarks.yaml delete mode 100644 .github/workflows/rust-msrv.yaml delete mode 100644 .github/workflows/semver-check.yaml delete mode 100644 .github/workflows/sv2-header-check.yaml delete mode 100644 .github/workflows/test.yaml delete mode 100644 .github/workflows/track-benchmarks.yaml diff --git a/.github/workflows/auto-rebase.yaml b/.github/workflows/auto-rebase.yaml deleted file mode 100644 index 6e635ffba..000000000 --- a/.github/workflows/auto-rebase.yaml +++ /dev/null @@ -1,77 +0,0 @@ -name: Auto Rebase - -on: - push: - branches: - - main - workflow_dispatch: - -jobs: - rebase-outdated-prs: - runs-on: ubuntu-latest - steps: - - - name: Checkout repository - uses: actions/checkout@v4 - with: - token: ${{ secrets.PAT }} - fetch-depth: 0 # Fetch full history to have the entire commit history - - - name: Fetch open pull requests with label - run: | - gh auth setup-git - gh pr list --state open --label "ready-to-be-merged" --json number,headRepositoryOwner,headRefName --jq '.[] | "\(.number) \(.headRepositoryOwner.login) \(.headRefName)"' > pr_details.txt - env: - GITHUB_TOKEN: ${{ secrets.PAT }} - - - name: Rebase pull requests - run: | - while read pr_number pr_owner pr_branch; do - echo "Processing PR #$pr_number" - - # Add the contributor's fork as a remote - git remote add contributor https://github.com/$pr_owner/$(gh repo view --json name -q '.name').git - - # Fetch the contributor's branches - git fetch contributor - - # Create a unique branch name for this PR - unique_branch_name="contributor-branch-$pr_number" - - # Checkout the branch from the contributor's fork - git checkout -b $unique_branch_name contributor/$pr_branch - - # Set the committer name and email to match the PR author - PR_AUTHOR_NAME=$(gh pr view $pr_number --json author --jq '.author.login') - PR_AUTHOR_EMAIL="${PR_AUTHOR_NAME}@users.noreply.github.com" - - git config --global user.name "$PR_AUTHOR_NAME" - git config --global user.email "$PR_AUTHOR_EMAIL" - - # Rebase the branch on top of the main branch - git fetch origin main - if ! git rebase origin/main; then - echo "Conflict detected. Aborting rebase and continuing." - git rebase --abort - - # Post a comment on the PR to notify the author about the conflict - gh pr comment $pr_number --body "Hey @$PR_AUTHOR_NAME, your PR cannot be rebased due to conflicts. Could you resolve them, please?" - - continue - fi - - # Push the rebased branch back to the contributor's fork - git push --force-with-lease contributor $unique_branch_name:$pr_branch - - # Remove the remote - git remote remove contributor - - # Ensure we are not on the branch to be deleted - git checkout main - - # Delete the local unique branch - git branch -D $unique_branch_name - - done < pr_details.txt - env: - GITHUB_TOKEN: ${{ secrets.PAT }} \ No newline at end of file diff --git a/.github/workflows/clippy-lint.yaml b/.github/workflows/clippy-lint.yaml deleted file mode 100644 index b8d4cba36..000000000 --- a/.github/workflows/clippy-lint.yaml +++ /dev/null @@ -1,40 +0,0 @@ -on: - push: - branches: - - main - pull_request: - branches: - - main - -name: Clippy Lint - -jobs: - clippy-check: - runs-on: ${{ matrix.os }} - strategy: - matrix: - os: - - macos-latest - - ubuntu-latest - include: - - os: macos-latest - target: x86_64-apple-darwin - - os: ubuntu-latest - target: x86_64-unknown-linux-musl - - steps: - - uses: actions/checkout@v4 - - uses: actions-rs/toolchain@v1 - with: - profile: minimal - toolchain: 1.75.0 - override: true - components: clippy - - 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 diff --git a/.github/workflows/fmt.yaml b/.github/workflows/fmt.yaml deleted file mode 100644 index 181fc6088..000000000 --- a/.github/workflows/fmt.yaml +++ /dev/null @@ -1,40 +0,0 @@ -on: - push: - branches: - - main - pull_request: - branches: - - main - -name: Rustfmt - -jobs: - fmt: - runs-on: ${{ matrix.os }} - strategy: - matrix: - os: - - macos-latest - - ubuntu-latest - include: - - os: macos-latest - target: x86_64-apple-darwin - - os: ubuntu-latest - target: x86_64-unknown-linux-musl - - steps: - - uses: actions/checkout@v4 - - uses: actions-rs/toolchain@v1 - with: - profile: minimal - toolchain: nightly - override: true - components: rustfmt - - name: Run fmt in different workspaces and crates - run: | - cargo fmt --all --manifest-path=benches/Cargo.toml -- --check - cargo fmt --all --manifest-path=common/Cargo.toml -- --check - cargo fmt --all --manifest-path=protocols/Cargo.toml -- --check - cargo fmt --all --manifest-path=roles/Cargo.toml -- --check - cargo fmt --all --manifest-path=utils/Cargo.toml -- --check - cargo fmt --all --manifest-path=utils/message-generator/Cargo.toml -- --check diff --git a/.github/workflows/lockfiles.yaml b/.github/workflows/lockfiles.yaml deleted file mode 100644 index 91131bfb9..000000000 --- a/.github/workflows/lockfiles.yaml +++ /dev/null @@ -1,28 +0,0 @@ -name: Lockfiles - -# Trigger the workflow on push or pull request events for the main branch -on: - push: - branches: - - main - pull_request: - branches: - - main - -jobs: - build: - runs-on: ubuntu-latest - - steps: - - uses: actions/checkout@v2 - - - name: Install Rust - uses: actions-rs/toolchain@v1 - with: - toolchain: stable - override: true - - - name: Build with locked dependencies - run: | - cargo build --manifest-path=roles/Cargo.toml --locked - cargo build --manifest-path=utils/Cargo.toml --locked \ No newline at end of file diff --git a/.github/workflows/mg.yaml b/.github/workflows/mg.yaml deleted file mode 100644 index 0088ad021..000000000 --- a/.github/workflows/mg.yaml +++ /dev/null @@ -1,224 +0,0 @@ -# Runs all Message Generator tests in separate jobs - -name: MG Test - -on: - push: - branches: - - main - pull_request: - branches: - - main - -jobs: - bad-pool-config-test: - runs-on: ubuntu-latest - steps: - - name: Checkout repository - uses: actions/checkout@v4 - - name: Install cargo-llvm-cov - run: cargo install cargo-llvm-cov - - name: Run bad-pool-config-test - run: sh ./test/message-generator/test/bad-pool-config-test/bad-pool-config-test.sh - - interop-jd-translator: - runs-on: ubuntu-latest - steps: - - name: Checkout repository - uses: actions/checkout@v4 - - name: Run interop-jd-translator - run: sh ./test/message-generator/test/interop-jd-translator/interop-jd-translator.sh - - interop-proxy-with-multi-ups: - runs-on: ubuntu-latest - steps: - - name: Checkout repository - uses: actions/checkout@v4 - - name: Run interop-proxy-with-multi-ups - run: sh ./test/message-generator/test/interop-proxy-with-multi-ups/interop-proxy-with-multi-ups.sh - - interop-proxy-with-multi-ups-extended: - runs-on: ubuntu-latest - steps: - - name: Checkout repository - uses: actions/checkout@v4 - - name: Run interop-proxy-with-multi-ups-extended - run: sh ./test/message-generator/test/interop-proxy-with-multi-ups-extended/interop-proxy-with-multi-ups-extended.sh - - jds-do-not-fail-on-wrong-tsdatasucc: - runs-on: ubuntu-latest - steps: - - name: Checkout repository - uses: actions/checkout@v4 - - name: Run jds-do-not-fail-on-wrong-tsdatasucc - run: sh ./test/message-generator/test/jds-do-not-fail-on-wrong-tsdatasucc/jds-do-not-fail-on-wrong-tsdatasucc.sh - - jds-do-not-panic-if-jdc-close-connection: - runs-on: ubuntu-latest - steps: - - name: Checkout repository - uses: actions/checkout@v4 - - name: Run jds-do-not-panic-if-jdc-close-connection - run: sh ./test/message-generator/test/jds-do-not-panic-if-jdc-close-connection/jds-do-not-panic-if-jdc-close-connection.sh - - jds-do-not-stackoverflow-when-no-token: - runs-on: ubuntu-latest - steps: - - name: Checkout repository - uses: actions/checkout@v4 - - name: Run jds-do-not-stackoverflow-when-no-token - run: sh ./test/message-generator/test/jds-do-not-stackoverflow-when-no-token/jds-do-not-stackoverflow-when-no-token.sh - - jds-receive-solution-while-processing-declared-job: - runs-on: ubuntu-latest - steps: - - name: Checkout repository - uses: actions/checkout@v4 - - name: Install cargo-llvm-cov - run: cargo install cargo-llvm-cov - - name: Run jds-receive-solution-while-processing-declared-job - run: sh ./test/message-generator/test/jds-receive-solution-while-processing-declared-job/jds-receive-solution-while-processing-declared-job.sh - - pool-sri-test-1-standard: - runs-on: ubuntu-latest - steps: - - name: Checkout repository - uses: actions/checkout@v4 - - name: Install cargo-llvm-cov - run: cargo install cargo-llvm-cov - - name: Run pool-sri-test-1-standard - run: sh ./test/message-generator/test/pool-sri-test-1-standard/pool-sri-test-1-standard.sh - - pool-sri-test-close-channel: - runs-on: ubuntu-latest - steps: - - name: Checkout repository - uses: actions/checkout@v4 - - name: Run pool-sri-test-close-channel - run: sh ./test/message-generator/test/pool-sri-test-close-channel/pool-sri-test-close-channel.sh - - pool-sri-test-extended_0: - runs-on: ubuntu-latest - steps: - - name: Checkout repository - uses: actions/checkout@v4 - - name: Install cargo-llvm-cov - run: cargo install cargo-llvm-cov - - name: Run pool-sri-test-extended_0 - run: sh ./test/message-generator/test/pool-sri-test-extended_0/pool-sri-test-extended_0.sh - - pool-sri-test-extended_1: - runs-on: ubuntu-latest - steps: - - name: Checkout repository - uses: actions/checkout@v4 - - name: Install cargo-llvm-cov - run: cargo install cargo-llvm-cov - - name: Run pool-sri-test-extended_1 - run: sh ./test/message-generator/test/pool-sri-test-extended_1/pool-sri-test-extended_1.sh - - pool-sri-test-reject-auth: - runs-on: ubuntu-latest - steps: - - name: Checkout repository - uses: actions/checkout@v4 - - name: Install cargo-llvm-cov - run: cargo install cargo-llvm-cov - - name: Run pool-sri-test-reject-auth - run: sh ./test/message-generator/test/pool-sri-test-reject-auth/pool-sri-test-reject-auth.sh - - standard-coverage: - runs-on: ubuntu-latest - steps: - - name: Checkout repository - uses: actions/checkout@v4 - - name: Install cargo-llvm-cov - run: cargo install cargo-llvm-cov - - name: Run standard-coverage - run: sh ./test/message-generator/test/standard-coverage-test/standard-coverage-test.sh - - sv1-test: - runs-on: ubuntu-latest - timeout-minutes: 10 - steps: - - name: Checkout repository - uses: actions/checkout@v4 - - name: Run sv1-test - run: sh ./test/message-generator/test/sv1-test/sv1-test.sh - - translation-proxy-broke-pool: - runs-on: ubuntu-latest - steps: - - name: Checkout repository - uses: actions/checkout@v4 - - name: Run translation-proxy-broke-pool - run: sh ./test/message-generator/test/translation-proxy-broke-pool/translation-proxy-broke-pool.sh - - translation-proxy: - runs-on: ubuntu-latest - steps: - - name: Checkout repository - uses: actions/checkout@v4 - - name: Install cargo-llvm-cov - run: cargo install cargo-llvm-cov - - name: Run translation-proxy - run: sh ./test/message-generator/test/translation-proxy/translation-proxy.sh - - translation-proxy-old-share: - runs-on: ubuntu-latest - steps: - - name: Checkout repository - uses: actions/checkout@v4 - - name: Run translation-proxy-old-share - run: sh ./test/message-generator/test/translation-proxy-old-share/translation-proxy-old-share.sh - - mg-aggregate-results: - name: "Aggregate MG Test Results" - runs-on: ubuntu-latest - if: always() - needs: [ - bad-pool-config-test, - interop-jd-translator, - interop-proxy-with-multi-ups, - interop-proxy-with-multi-ups-extended, - jds-do-not-fail-on-wrong-tsdatasucc, - jds-do-not-panic-if-jdc-close-connection, - jds-do-not-stackoverflow-when-no-token, - jds-receive-solution-while-processing-declared-job, - pool-sri-test-1-standard, - pool-sri-test-close-channel, - pool-sri-test-extended_0, - pool-sri-test-extended_1, - pool-sri-test-reject-auth, - standard-coverage, - sv1-test, - translation-proxy-broke-pool, - translation-proxy, - translation-proxy-old-share - ] - steps: - - name: Aggregate Results - run: | - if [ "${{ needs.bad-pool-config-test.result }}" != "success" ] || - [ "${{ needs.interop-jd-translator.result }}" != "success" ] || - [ "${{ needs.interop-proxy-with-multi-ups.result }}" != "success" ] || - [ "${{ needs.interop-proxy-with-multi-ups-extended.result }}" != "success" ] || - [ "${{ needs.jds-do-not-fail-on-wrong-tsdatasucc.result }}" != "success" ] || - [ "${{ needs.jds-do-not-panic-if-jdc-close-connection.result }}" != "success" ] || - [ "${{ needs.jds-do-not-stackoverflow-when-no-token.result }}" != "success" ] || - [ "${{ needs.jds-receive-solution-while-processing-declared-job.result }}" != "success" ] || - [ "${{ needs.pool-sri-test-1-standard.result }}" != "success" ] || - [ "${{ needs.pool-sri-test-close-channel.result }}" != "success" ] || - [ "${{ needs.pool-sri-test-extended_0.result }}" != "success" ] || - [ "${{ needs.pool-sri-test-extended_1.result }}" != "success" ] || - [ "${{ needs.pool-sri-test-reject-auth.result }}" != "success" ] || - [ "${{ needs.standard-coverage.result }}" != "success" ] || - [ "${{ needs.sv1-test.result }}" != "success" ] || - [ "${{ needs.translation-proxy-broke-pool.result }}" != "success" ] || - [ "${{ needs.translation-proxy.result }}" != "success" ] || - [ "${{ needs.translation-proxy-old-share.result }}" != "success" ]; then - echo "One or more jobs failed." - exit 1 - else - echo "All MG tests completed successfully" - fi \ No newline at end of file diff --git a/.github/workflows/release-libs.yaml b/.github/workflows/release-libs.yaml deleted file mode 100644 index d6aa691a2..000000000 --- a/.github/workflows/release-libs.yaml +++ /dev/null @@ -1,144 +0,0 @@ -# This workflow is used to publish SV2 crates to crates.io -# The workflow tries to update all the library crates, so if a crate is not to updated, the step will fail -# for that each step have continue-on-error set to true. -# Since each step can fail, the output ot the action must be manually checked to make sure that all -# the library intended to be published are published. -# Running cargo release in the various workspace help to prepare the version number and everything. -# ATTENTION -# Is very important to check the output manually cause when too many crates are updated crates.io could fail -# and ask to rerun the action later - -name: Release Libs - -on: - # Manually run by going to "Actions/Release" in Github and running the workflow - workflow_dispatch: - # every time a new release tag is created - push: - tags: - - "v*.*.*" - -jobs: - libs_publish: - runs-on: ubuntu-latest - steps: - - name: Checkout code - uses: actions/checkout@v4 - - - uses: actions/checkout@v4 - - uses: actions-rs/toolchain@v1 - with: - toolchain: stable - override: true - - name: Login - run: cargo login ${{ secrets.CRATES_IO_DEPLOY_KEY }} - - name: Publish crate common - continue-on-error: true - run: | - cd common - cargo publish - - name: Publish crate buffer_sv2 - continue-on-error: true - run: | - cd utils/buffer - cargo publish - - name: Publish crate no_serde_sv2_derive_codec - continue-on-error: true - run: | - cd protocols/v2/binary-sv2/no-serde-sv2/derive_codec - cargo publish - - name: Publish crate no_serde_sv2_codec - continue-on-error: true - run: | - cd protocols/v2/binary-sv2/no-serde-sv2/codec - cargo publish - - name: Publish crate serde_sv2 - continue-on-error: true - run: | - cd protocols/v2/binary-sv2/serde-sv2 - cargo publish - - name: Publish crate binary_sv2 - continue-on-error: true - run: | - cd protocols/v2/binary-sv2/binary-sv2 - cargo publish - - name: Publish crate const_sv2 - continue-on-error: true - run: | - cd protocols/v2/const-sv2 - cargo publish - - name: Publish crate framing_sv2 - continue-on-error: true - run: | - cd protocols/v2/framing-sv2 - cargo publish - - name: Publish crate noise_sv2 - continue-on-error: true - run: | - cd protocols/v2/noise-sv2 - cargo publish - - name: Publish crate codec_sv2 - continue-on-error: true - run: | - cd protocols/v2/codec-sv2 - cargo publish - - name: Publish crate common_messages - continue-on-error: true - run: | - cd protocols/v2/subprotocols/common-messages - cargo publish - - name: Publish crate job_declaration - continue-on-error: true - run: | - cd protocols/v2/subprotocols/job-declaration - cargo publish - - name: Publish crate mining - continue-on-error: true - run: | - cd protocols/v2/subprotocols/mining - cargo publish - - name: Publish crate template_distribution - continue-on-error: true - run: | - cd protocols/v2/subprotocols/template-distribution - cargo publish - - name: Publish crate sv2_ffi - continue-on-error: true - run: | - cd protocols/v2/sv2-ffi - cargo publish --all-features - - name: Publish crate roles_logic_sv2 - continue-on-error: true - run: | - cd protocols/v2/roles-logic-sv2 - cargo publish - - name: Publish crate v1 - continue-on-error: true - run: | - cd protocols/v1 - cargo publish - - name: Publish crate bip32-key-derivation - continue-on-error: true - run: | - cd utils/bip32-key-derivation - cargo publish - - name: Publish crate error-handling - continue-on-error: true - run: | - cd utils/error-handling - cargo publish - - name: Publish crate key-utils - continue-on-error: true - run: | - cd utils/key-utils - cargo publish - - name: Publish crate network_helpers_sv2 - continue-on-error: true - run: | - cd roles/roles-utils/network-helpers - cargo publish - - name: Publish crate rpc_sv2 - continue-on-error: true - run: | - cd roles/roles-utils/rpc - cargo publish \ No newline at end of file diff --git a/.github/workflows/run-and-track-benchmarks-on-main.yaml b/.github/workflows/run-and-track-benchmarks-on-main.yaml deleted file mode 100644 index 33be08bc5..000000000 --- a/.github/workflows/run-and-track-benchmarks-on-main.yaml +++ /dev/null @@ -1,124 +0,0 @@ -name: Run and Track Benchmarks On Main - -on: - push: - branches: - - main - -jobs: - benchmark_sv1_criterion_with_bencher: - name: Track sv1 criterion benchmarks with Bencher - runs-on: ubuntu-latest - env: - BENCHER_PROJECT: stratum-v2-sri - BENCHER_API_TOKEN: ${{ secrets.BENCHER_API_TOKEN }} - BENCHER_ADAPTER: rust_criterion - BENCHER_TESTBED: sv1 - 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 - - - uses: actions/checkout@v4 - - uses: bencherdev/bencher@main - - name: Benchmark with Bencher - run: | - cd benches - bencher run \ - --github-actions ${{ secrets.GITHUB_TOKEN }} \ - "cargo bench --bench criterion_sv1_benchmark" - - benchmark_sv2_criterion_with_bencher: - name: Track sv2 criterion benchmarks with Bencher - runs-on: ubuntu-latest - env: - BENCHER_PROJECT: stratum-v2-sri - BENCHER_API_TOKEN: ${{ secrets.BENCHER_API_TOKEN }} - BENCHER_ADAPTER: rust_criterion - BENCHER_TESTBED: sv2 - 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 - - - uses: actions/checkout@v4 - - uses: bencherdev/bencher@main - - name: Benchmark with Bencher - run: | - cd benches - bencher run \ - --github-actions ${{ secrets.GITHUB_TOKEN }} \ - "cargo bench --bench criterion_sv2_benchmark" - - benchmark_sv1_iai_with_bencher: - name: Track sv1 iai benchmarks with Bencher - runs-on: ubuntu-latest - env: - BENCHER_PROJECT: stratum-v2-sri - BENCHER_API_TOKEN: ${{ secrets.BENCHER_API_TOKEN }} - BENCHER_ADAPTER: rust_iai - BENCHER_TESTBED: sv1 - 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@v4 - - name: Install Valgrind - run: | - sudo apt-get update - sudo apt-get install -y valgrind=1:3.18.1-1ubuntu2 - - - uses: actions/checkout@v4 - - uses: bencherdev/bencher@main - - name: Benchmark with Bencher - run: | - cd benches - bencher run \ - --github-actions ${{ secrets.GITHUB_TOKEN }} \ - "cargo bench --bench iai_sv1_benchmark" - - benchmark_sv2_iai_with_bencher: - name: Track sv2 iai benchmarks with Bencher - runs-on: ubuntu-latest - env: - BENCHER_PROJECT: stratum-v2-sri - BENCHER_API_TOKEN: ${{ secrets.BENCHER_API_TOKEN }} - BENCHER_ADAPTER: rust_iai - BENCHER_TESTBED: sv2 - 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 - - - uses: actions/checkout@v4 - - uses: bencherdev/bencher@main - - name: Benchmark with Bencher - run: | - cd benches - bencher run \ - --github-actions ${{ secrets.GITHUB_TOKEN }} \ - "cargo bench --bench iai_sv2_benchmark" \ No newline at end of file diff --git a/.github/workflows/run-benchmarks.yaml b/.github/workflows/run-benchmarks.yaml deleted file mode 100644 index feec5a5e6..000000000 --- a/.github/workflows/run-benchmarks.yaml +++ /dev/null @@ -1,124 +0,0 @@ -name: Run and Cache Benchmarks - -on: - pull_request: - branches: - - main - -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@v4 - - - name: Run Benchmarks - run: | - cd benches - cargo bench --bench criterion_sv1_benchmark > criterion_sv1_benchmarks.txt - - - name: Upload Benchmark Results - uses: actions/upload-artifact@v4 - 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@v4 - - - name: Run Benchmarks - run: | - cd benches - cargo bench --bench criterion_sv2_benchmark > criterion_sv2_benchmarks.txt - - - name: Upload Benchmark Results - uses: actions/upload-artifact@v4 - 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@v4 - - - name: Install Valgrind - run: | - sudo apt-get update - sudo apt-get install -y valgrind=1:3.18.1-1ubuntu2 - - - name: Run Benchmarks - run: | - cd benches - cargo bench --bench iai_sv1_benchmark > iai_sv1_benchmarks.txt - - - name: Upload Benchmark Results - uses: actions/upload-artifact@v4 - 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@v4 - - - name: Install Valgrind - run: | - sudo apt-get update - sudo apt-get install -y valgrind=1:3.18.1-1ubuntu2 - - - name: Run Benchmarks - run: | - cd benches - cargo bench --bench iai_sv2_benchmark > iai_sv2_benchmarks.txt - - - name: Upload Benchmark Results - uses: actions/upload-artifact@v4 - with: - name: iai_sv2_benchmarks.txt - path: ./benches/iai_sv2_benchmarks.txt - - - name: Upload GitHub Pull Request Event - uses: actions/upload-artifact@v4 - with: - name: event.json - path: ${{ github.event_path }} diff --git a/.github/workflows/rust-msrv.yaml b/.github/workflows/rust-msrv.yaml deleted file mode 100644 index 62ba418b1..000000000 --- a/.github/workflows/rust-msrv.yaml +++ /dev/null @@ -1,35 +0,0 @@ -on: - push: - branches: - - main - pull_request: - branches: - - main - -name: MSRV 1.75 Check - -jobs: - - build: - runs-on: ubuntu-latest - strategy: - fail-fast: false - matrix: - rust: - - 1.75.0 # MSRV - - steps: - - uses: actions/checkout@v2 - - uses: Swatinem/rust-cache@v1.2.0 - - uses: actions-rs/toolchain@v1 - with: - toolchain: ${{ matrix.rust }} - override: true - - name: Build Benches - run: cargo build --manifest-path=benches/Cargo.toml - - name: Build Protocols - run: cargo build --manifest-path=protocols/Cargo.toml - - name: Build Roles - run: cargo build --manifest-path=roles/Cargo.toml - - name: Build Utils - run: cargo build --manifest-path=utils/Cargo.toml diff --git a/.github/workflows/semver-check.yaml b/.github/workflows/semver-check.yaml deleted file mode 100644 index 6543b473d..000000000 --- a/.github/workflows/semver-check.yaml +++ /dev/null @@ -1,129 +0,0 @@ -name: Semver Check - -on: - push: - branches: - - "main" - pull_request: - branches: - - "main" - -jobs: - semver-check: - runs-on: ubuntu-latest - - steps: - - name: Checkout repository - uses: actions/checkout@v2 - - - name: Install Rust - uses: actions-rs/toolchain@v1 - with: - toolchain: stable - override: true - - - name: Cache Cargo registry - uses: actions/cache@v2 - with: - path: ~/.cargo/registry - key: ${{ runner.os }}-cargo-registry-${{ hashFiles('**/Cargo.lock') }} - restore-keys: | - ${{ runner.os }}-cargo-registry- - - - name: Cache Cargo index - uses: actions/cache@v2 - with: - path: ~/.cargo/git - key: ${{ runner.os }}-cargo-index-${{ hashFiles('**/Cargo.lock') }} - restore-keys: | - ${{ runner.os }}-cargo-index- - - - name: Install dependencies - run: sudo apt-get update && sudo apt-get install -y cmake - - - name: Install cargo-semver-checks - run: cargo install cargo-semver-checks --locked - - - name: Run semver checks for common - working-directory: common - run: cargo semver-checks - - - name: Run semver checks for utils/buffer - working-directory: utils/buffer - run: cargo semver-checks - - - name: Run semver checks for protocols/v2/binary-sv2/no-serde-sv2/codec - working-directory: protocols/v2/binary-sv2/no-serde-sv2/codec - run: cargo semver-checks - - - name: Run semver checks for protocols/v2/binary-sv2/serde-sv2 - working-directory: protocols/v2/binary-sv2/serde-sv2 - run: cargo semver-checks - - - name: Run semver checks for protocols/v2/binary-sv2/binary-sv2 - working-directory: protocols/v2/binary-sv2/binary-sv2 - run: cargo semver-checks - - - name: Run semver checks for protocols/v2/const-sv2 - working-directory: protocols/v2/const-sv2 - run: cargo semver-checks - - - name: Run semver checks for protocols/v2/framing-sv2 - working-directory: protocols/v2/framing-sv2 - run: cargo semver-checks - - - name: Run semver checks for protocols/v2/noise-sv2 - working-directory: protocols/v2/noise-sv2 - run: cargo semver-checks - - - name: Run semver checks for protocols/v2/codec-sv2 - working-directory: protocols/v2/codec-sv2 - run: cargo semver-checks - - - name: Run semver checks for protocols/v2/subprotocols/common-messages - working-directory: protocols/v2/subprotocols/common-messages - run: cargo semver-checks - - - name: Run semver checks for protocols/v2/subprotocols/job-declaration - working-directory: protocols/v2/subprotocols/job-declaration - run: cargo semver-checks - - - name: Run semver checks for protocols/v2/subprotocols/mining - working-directory: protocols/v2/subprotocols/mining - run: cargo semver-checks - - - name: Run semver checks for protocols/v2/subprotocols/template-distribution - working-directory: protocols/v2/subprotocols/template-distribution - run: cargo semver-checks - - - name: Run semver checks for protocols/v2/sv2-ffi - working-directory: protocols/v2/sv2-ffi - run: cargo semver-checks - - - name: Run semver checks for protocols/v2/roles-logic-sv2 - working-directory: protocols/v2/roles-logic-sv2 - run: cargo semver-checks --default-features - - - name: Run semver checks for protocols/v1 - working-directory: protocols/v1 - run: cargo semver-checks - - - name: Run semver checks for utils/bip32-key-derivation - working-directory: utils/bip32-key-derivation - run: cargo semver-checks - - - name: Run semver checks for utils/error-handling - working-directory: utils/error-handling - run: cargo semver-checks - - - name: Run semver checks for utils/key-utils - working-directory: utils/key-utils - run: cargo semver-checks - - - name: Run semver checks for roles/roles-utils/network-helpers - working-directory: roles/roles-utils/network-helpers - run: cargo semver-checks - - - name: Run semver checks for roles/roles-utils/rpc - working-directory: roles/roles-utils/rpc - run: cargo semver-checks \ No newline at end of file diff --git a/.github/workflows/sv2-header-check.yaml b/.github/workflows/sv2-header-check.yaml deleted file mode 100644 index b1b069a05..000000000 --- a/.github/workflows/sv2-header-check.yaml +++ /dev/null @@ -1,34 +0,0 @@ -on: - push: - branches: - - main - pull_request: - branches: - - main - -# Check sv2.h file is up to date with commit -name: sv2.h Header Check - -jobs: - sv2_header_check: - runs-on: ${{ matrix.os }} - strategy: - matrix: - os: - - ubuntu-latest - include: - - os: ubuntu-latest - target: x86_64-unknown-linux-musl - - steps: - - uses: actions/checkout@v4 - - uses: actions-rs/toolchain@v1 - - with: - profile: minimal - toolchain: 1.75.0 - override: true - - name: Check sv2 header file is up to date with commit - run: | - echo Check sv2 header file is up to date with commit - sh ./scripts/sv2-header-check.sh diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml deleted file mode 100644 index 6665a902f..000000000 --- a/.github/workflows/test.yaml +++ /dev/null @@ -1,91 +0,0 @@ -on: - push: - branches: - - main - pull_request: - branches: - - main - -name: Test, Prop Tests, Example Tests - -jobs: - ci: - runs-on: ${{ matrix.os }} - strategy: - matrix: - os: - - macos-latest - - ubuntu-latest - include: - - os: macos-latest - target: x86_64-apple-darwin - - os: ubuntu-latest - target: x86_64-unknown-linux-musl - - steps: - - name: Install stable toolchain & components - uses: actions/checkout@v4 - with: - profile: minimal - toolchain: nightly - override: true - - - name: Build - run: | - cargo build --manifest-path=benches/Cargo.toml - cargo build --manifest-path=common/Cargo.toml - cargo build --manifest-path=protocols/Cargo.toml - cargo build --manifest-path=roles/Cargo.toml - cargo build --manifest-path=utils/Cargo.toml - - - name: Run sv1-client-and-server example - run: | - cargo run --manifest-path=examples/sv1-client-and-server/Cargo.toml --bin client_and_server -- 60 - - - name: interop-test - run: | - if [ ${{ matrix.os }} == "ubuntu-latest" ]; then - ./run.sh 30 - else - echo "Skipping interop-test on ${{ matrix.os }} - not supported" - fi - working-directory: examples/interop-cpp/ - - # TODO this is only usefull if we want to build c bindings with guix - #- name: interop-no-cargo-test - # run: | - # if [ ${{ matrix.os }} == "ubuntu-latest" ]; then - # ./run.sh 30 - # else - # echo "Skipping interop-test on ${{ matrix.os }} - not supported" - # fi - # working-directory: examples/interop-cpp-no-cargo/ - - - name: fuzz tests - run: | - if [ ${{ matrix.os }} == "ubuntu-latest" ]; then - ./run.sh 30 - else - echo "Skipping fuzz test on ${{ matrix.os }} - not supported" - fi - working-directory: utils/buffer/fuzz - - - name: Test - run: | - cargo test --manifest-path=benches/Cargo.toml - cargo test --manifest-path=common/Cargo.toml - cargo test --manifest-path=protocols/Cargo.toml - cargo test --manifest-path=roles/Cargo.toml - cargo test --manifest-path=utils/Cargo.toml - - - name: Property based testing - run: | - cargo test --manifest-path=protocols/Cargo.toml --features prop_test - - - name: Run ping-pong-with-noise example - run: | - cargo run --manifest-path=examples/ping-pong-with-noise/Cargo.toml --bin ping_pong_with_noise -- 10 - - - name: Run ping-pong-without-noise example - run: | - cargo run --manifest-path=examples/ping-pong-without-noise/Cargo.toml --bin ping_pong_without_noise -- 10 diff --git a/.github/workflows/track-benchmarks.yaml b/.github/workflows/track-benchmarks.yaml deleted file mode 100644 index 1b088ad8a..000000000 --- a/.github/workflows/track-benchmarks.yaml +++ /dev/null @@ -1,268 +0,0 @@ -name: Track Benchmarks - -on: - workflow_run: - workflows: [Run and Cache Benchmarks] - types: - - completed - -jobs: - track_sv1_criterion_with_bencher: - if: github.event.workflow_run.conclusion == 'success' - runs-on: ubuntu-latest - env: - BENCHER_PROJECT: stratum-v2-sri - BENCHER_ADAPTER: rust_criterion - BENCHER_TESTBED: sv1 - BENCHMARK_RESULTS: criterion_sv1_benchmarks.txt - PR_EVENT: event.json - steps: - - name: Download Benchmark Results - uses: actions/github-script@v6 - with: - script: | - async function downloadArtifact(artifactName) { - 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 == artifactName - })[0]; - if (!matchArtifact) { - core.setFailed(`Failed to find artifact: ${artifactName}`); - } - 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}/${artifactName}.zip`, Buffer.from(download.data)); - } - await downloadArtifact(process.env.BENCHMARK_RESULTS); - await downloadArtifact(process.env.PR_EVENT); - - name: Unzip Benchmark Results - run: | - unzip $BENCHMARK_RESULTS.zip - unzip $PR_EVENT.zip - - name: Export PR Event Data - uses: actions/github-script@v6 - with: - script: | - let fs = require('fs'); - let prEvent = JSON.parse(fs.readFileSync(process.env.PR_EVENT, {encoding: 'utf8'})); - core.exportVariable("PR_HEAD", `${prEvent.number}/merge`); - core.exportVariable("PR_BASE", prEvent.pull_request.base.ref); - core.exportVariable("PR_BASE_SHA", prEvent.pull_request.base.sha); - core.exportVariable("PR_NUMBER", prEvent.number); - - uses: bencherdev/bencher@main - - name: Track Benchmarks with Bencher - run: | - bencher run \ - --branch '${{ env.PR_HEAD }}' \ - --branch-start-point '${{ env.PR_BASE }}' \ - --branch-start-point-hash '${{ env.PR_BASE_SHA }}' \ - --branch-reset \ - --ci-number '${{ env.PR_NUMBER }}' \ - --github-actions "${{ secrets.GITHUB_TOKEN }}" \ - --token "${{ secrets.BENCHER_API_TOKEN }}" \ - --err \ - --file "$BENCHMARK_RESULTS" - - track_sv2_criterion_with_bencher: - if: github.event.workflow_run.conclusion == 'success' - runs-on: ubuntu-latest - env: - BENCHER_PROJECT: stratum-v2-sri - BENCHER_ADAPTER: rust_criterion - BENCHER_TESTBED: sv2 - BENCHMARK_RESULTS: criterion_sv2_benchmarks.txt - PR_EVENT: event.json - steps: - - name: Download Benchmark Results - uses: actions/github-script@v6 - with: - script: | - async function downloadArtifact(artifactName) { - 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 == artifactName - })[0]; - if (!matchArtifact) { - core.setFailed(`Failed to find artifact: ${artifactName}`); - } - 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}/${artifactName}.zip`, Buffer.from(download.data)); - } - await downloadArtifact(process.env.BENCHMARK_RESULTS); - await downloadArtifact(process.env.PR_EVENT); - - name: Unzip Benchmark Results - run: | - unzip $BENCHMARK_RESULTS.zip - unzip $PR_EVENT.zip - - name: Export PR Event Data - uses: actions/github-script@v6 - with: - script: | - let fs = require('fs'); - let prEvent = JSON.parse(fs.readFileSync(process.env.PR_EVENT, {encoding: 'utf8'})); - core.exportVariable("PR_HEAD", `${prEvent.number}/merge`); - core.exportVariable("PR_BASE", prEvent.pull_request.base.ref); - core.exportVariable("PR_BASE_SHA", prEvent.pull_request.base.sha); - core.exportVariable("PR_NUMBER", prEvent.number); - - uses: bencherdev/bencher@main - - name: Track Benchmarks with Bencher - run: | - bencher run \ - --branch '${{ env.PR_HEAD }}' \ - --branch-start-point '${{ env.PR_BASE }}' \ - --branch-start-point-hash '${{ env.PR_BASE_SHA }}' \ - --branch-reset \ - --ci-number '${{ env.PR_NUMBER }}' \ - --github-actions "${{ secrets.GITHUB_TOKEN }}" \ - --token "${{ secrets.BENCHER_API_TOKEN }}" \ - --err \ - --file "$BENCHMARK_RESULTS" - - track_sv1_iai_with_bencher: - if: github.event.workflow_run.conclusion == 'success' - runs-on: ubuntu-latest - env: - BENCHER_PROJECT: stratum-v2-sri - BENCHER_ADAPTER: rust_iai - BENCHER_TESTBED: sv1 - BENCHMARK_RESULTS: iai_sv1_benchmarks.txt - PR_EVENT: event.json - steps: - - name: Download Benchmark Results - uses: actions/github-script@v6 - with: - script: | - async function downloadArtifact(artifactName) { - 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 == artifactName - })[0]; - if (!matchArtifact) { - core.setFailed(`Failed to find artifact: ${artifactName}`); - } - 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}/${artifactName}.zip`, Buffer.from(download.data)); - } - await downloadArtifact(process.env.BENCHMARK_RESULTS); - await downloadArtifact(process.env.PR_EVENT); - - name: Unzip Benchmark Results - run: | - unzip $BENCHMARK_RESULTS.zip - unzip $PR_EVENT.zip - - name: Export PR Event Data - uses: actions/github-script@v6 - with: - script: | - let fs = require('fs'); - let prEvent = JSON.parse(fs.readFileSync(process.env.PR_EVENT, {encoding: 'utf8'})); - core.exportVariable("PR_HEAD", `${prEvent.number}/merge`); - core.exportVariable("PR_BASE", prEvent.pull_request.base.ref); - core.exportVariable("PR_BASE_SHA", prEvent.pull_request.base.sha); - core.exportVariable("PR_NUMBER", prEvent.number); - - uses: bencherdev/bencher@main - - name: Track Benchmarks with Bencher - run: | - bencher run \ - --branch '${{ env.PR_HEAD }}' \ - --branch-start-point '${{ env.PR_BASE }}' \ - --branch-start-point-hash '${{ env.PR_BASE_SHA }}' \ - --branch-reset \ - --ci-number '${{ env.PR_NUMBER }}' \ - --github-actions "${{ secrets.GITHUB_TOKEN }}" \ - --token "${{ secrets.BENCHER_API_TOKEN }}" \ - --err \ - --file "$BENCHMARK_RESULTS" - - track_sv2_iai_with_bencher: - if: github.event.workflow_run.conclusion == 'success' - runs-on: ubuntu-latest - env: - BENCHER_PROJECT: stratum-v2-sri - BENCHER_ADAPTER: rust_iai - BENCHER_TESTBED: sv2 - BENCHMARK_RESULTS: iai_sv2_benchmarks.txt - PR_EVENT: event.json - steps: - - name: Download Benchmark Results - uses: actions/github-script@v6 - with: - script: | - async function downloadArtifact(artifactName) { - 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 == artifactName - })[0]; - if (!matchArtifact) { - core.setFailed(`Failed to find artifact: ${artifactName}`); - } - 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}/${artifactName}.zip`, Buffer.from(download.data)); - } - await downloadArtifact(process.env.BENCHMARK_RESULTS); - await downloadArtifact(process.env.PR_EVENT); - - name: Unzip Benchmark Results - run: | - unzip $BENCHMARK_RESULTS.zip - unzip $PR_EVENT.zip - - name: Export PR Event Data - uses: actions/github-script@v6 - with: - script: | - let fs = require('fs'); - let prEvent = JSON.parse(fs.readFileSync(process.env.PR_EVENT, {encoding: 'utf8'})); - core.exportVariable("PR_HEAD", `${prEvent.number}/merge`); - core.exportVariable("PR_BASE", prEvent.pull_request.base.ref); - core.exportVariable("PR_BASE_SHA", prEvent.pull_request.base.sha); - core.exportVariable("PR_NUMBER", prEvent.number); - - uses: bencherdev/bencher@main - - name: Track Benchmarks with Bencher - run: | - bencher run \ - --branch '${{ env.PR_HEAD }}' \ - --branch-start-point '${{ env.PR_BASE }}' \ - --branch-start-point-hash '${{ env.PR_BASE_SHA }}' \ - --branch-reset \ - --ci-number '${{ env.PR_NUMBER }}' \ - --github-actions "${{ secrets.GITHUB_TOKEN }}" \ - --token "${{ secrets.BENCHER_API_TOKEN }}" \ - --err \ - --file "$BENCHMARK_RESULTS" \ No newline at end of file From f8cd2fa9448649c56ca00365a09944d4a58b1be2 Mon Sep 17 00:00:00 2001 From: bit-aloo Date: Thu, 10 Oct 2024 08:47:50 +0530 Subject: [PATCH 11/14] remove protocol --- .github/workflows/coverage.yaml | 74 +++++++++++++++------------------ 1 file changed, 33 insertions(+), 41 deletions(-) diff --git a/.github/workflows/coverage.yaml b/.github/workflows/coverage.yaml index 3b2abcad0..67d68b29e 100644 --- a/.github/workflows/coverage.yaml +++ b/.github/workflows/coverage.yaml @@ -1,18 +1,17 @@ # Performs test coverage of project's libraries using cargo-tarpaulin and generates results using codecov.io. # The following flags are set inside `tarpaulin.toml`: # `features = "..."`: Includes the code with the listed features. The following features result in a -# tarpaulin error and are NOT included: derive, alloc, arbitrary-derive, attributes, and -# with_serde -# `run-types = [ "Lib" ]`: Only tests the package's library unit tests. Includes protocols, and utils (without the -# exclude-files flag, it includes this example because it contains a lib.rs file) -# `exclude-files = [ "examples/*" ]`: Excludes all projects in examples directory (specifically added to -# ignore examples that that contain a lib.rs file like interop-cpp) -# `timeout = "120s"`: If unresponsive for 120 seconds, action will fail -# `fail-under = 20`: If code coverage is less than 20%, action will fail -# `out = ["Xml"]`: Required for codecov.io to generate coverage result -# All message-generator test flags are in tests in test/message-generator/test -# This test loops through every test in test/message-generator/test, and runs each one, collecting -# code coverage data for anything in the roles/ directory that is relevant to SV2(pool, mining-proxy) +# tarpaulin error and are NOT included: derive, alloc, arbitrary-derive, attributes, and with_serde +# `run-types = [ "Lib" ]`: Only tests the package's library unit tests, including protocols and utils +# (without the exclude-files flag, it includes examples that contain a lib.rs file). +# `exclude-files = [ "examples/*" ]`: Excludes all projects in the examples directory (specifically added to +# ignore examples that contain a lib.rs file like interop-cpp). +# `timeout = "120s"`: If unresponsive for 120 seconds, the action will fail. +# `fail-under = 20`: If code coverage is less than 20%, the action will fail. +# `out = ["Xml"]`: Required for codecov.io to generate coverage results. +# All message-generator test flags are in tests in test/message-generator/test. +# This test loops through every test in test/message-generator/test, collecting code coverage data for anything +# in the roles/ directory that is relevant to SV2 (pool, mining-proxy). name: Test Coverage @@ -36,45 +35,38 @@ jobs: - name: Checkout repository uses: actions/checkout@v4 + # Uncomment the following if you need to run a script for tarpaulin. # - name: Generate code coverage # run: | # ./scripts/tarpaulin.sh - # - name: Archive Tarpaulin code coverage results - # uses: actions/upload-artifact@v4 - # with: - # name: tarpaulin-report - # path: | - # protocols/cobertura.xml - # roles/cobertura.xml - # utils/cobertura.xml + - name: Archive Tarpaulin code coverage results + uses: actions/upload-artifact@v4 + with: + name: tarpaulin-report + path: | + roles/cobertura.xml + utils/cobertura.xml + + codecov: + needs: tarpaulin-test + + name: Codecov Upload + runs-on: ubuntu-latest + steps: + - name: Checkout repository + uses: actions/checkout@v3 + + - name: Download all workflow run artifacts + uses: actions/download-artifact@v3 - name: Display structure of downloaded files run: ls -R - + - name: Upload to codecov.io uses: codecov/codecov-action@v3 with: - files: ./utils/cobertura.xml ./roles/cobertura.xml + files: tarpaulin-report/*.xml fail_ci_if_error: true token: ${{ secrets.CODECOV_TOKEN }} - - # codecov: - # needs: tarpaulin-test - - # name: Codecov Upload - # runs-on: ubuntu-latest - - # steps: - - # - name: Checkout repository - # uses: actions/checkout@v3 - - # - name: Download all workflow run artifacts - # uses: actions/download-artifact@v3 - - # - name: Display structure of downloaded files - # run: ls -R - - \ No newline at end of file From a2476105beb3e0f7f618395db9c1afb022478cc1 Mon Sep 17 00:00:00 2001 From: bit-aloo Date: Thu, 10 Oct 2024 09:18:04 +0530 Subject: [PATCH 12/14] test10 --- .github/workflows/coverage.yaml | 51 +++++++++++++++++++-------------- 1 file changed, 30 insertions(+), 21 deletions(-) diff --git a/.github/workflows/coverage.yaml b/.github/workflows/coverage.yaml index 67d68b29e..466100179 100644 --- a/.github/workflows/coverage.yaml +++ b/.github/workflows/coverage.yaml @@ -35,38 +35,47 @@ jobs: - name: Checkout repository uses: actions/checkout@v4 - # Uncomment the following if you need to run a script for tarpaulin. - # - name: Generate code coverage - # run: | - # ./scripts/tarpaulin.sh + - name: Generate code coverage + run: | + ./scripts/tarpaulin.sh + + - name: List files after tarpaulin run + run: | + echo "Checking files in protocols directory" + ls -l protocols + echo "Checking files in roles directory" + ls -l roles + echo "Checking files in utils directory" + ls -l utils - name: Archive Tarpaulin code coverage results uses: actions/upload-artifact@v4 with: name: tarpaulin-report path: | + protocols/cobertura.xml roles/cobertura.xml utils/cobertura.xml - codecov: - needs: tarpaulin-test + # codecov: + # needs: tarpaulin-test - name: Codecov Upload - runs-on: ubuntu-latest + # name: Codecov Upload + # runs-on: ubuntu-latest - steps: - - name: Checkout repository - uses: actions/checkout@v3 + # steps: + # - name: Checkout repository + # uses: actions/checkout@v3 - - name: Download all workflow run artifacts - uses: actions/download-artifact@v3 + # - name: Download all workflow run artifacts + # uses: actions/download-artifact@v3 - - name: Display structure of downloaded files - run: ls -R + # - name: Display structure of downloaded files + # run: ls -R - - name: Upload to codecov.io - uses: codecov/codecov-action@v3 - with: - files: tarpaulin-report/*.xml - fail_ci_if_error: true - token: ${{ secrets.CODECOV_TOKEN }} + # - name: Upload to codecov.io + # uses: codecov/codecov-action@v3 + # with: + # files: tarpaulin-report/*.xml + # fail_ci_if_error: true + # token: ${{ secrets.CODECOV_TOKEN }} From 8672bfe453f7a11b8cb4615f96ef2eecf07e838e Mon Sep 17 00:00:00 2001 From: bit-aloo Date: Thu, 10 Oct 2024 09:18:50 +0530 Subject: [PATCH 13/14] test10 --- .gitignore | 1 + 1 file changed, 1 insertion(+) diff --git a/.gitignore b/.gitignore index 398347e3e..b1881a1fc 100644 --- a/.gitignore +++ b/.gitignore @@ -14,6 +14,7 @@ lcov.info .vscode *.py **/conf/** +cobertura.xml /roles/*/*-config.toml /examples/*/Cargo.lock /scripts/sv2.h From 3ef87db879365ae168b5d6f18acbad247da15c47 Mon Sep 17 00:00:00 2001 From: bit-aloo Date: Thu, 10 Oct 2024 09:20:31 +0530 Subject: [PATCH 14/14] test11 --- scripts/tarpaulin.sh | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/scripts/tarpaulin.sh b/scripts/tarpaulin.sh index dd45abe56..9e0f226f3 100755 --- a/scripts/tarpaulin.sh +++ b/scripts/tarpaulin.sh @@ -5,9 +5,9 @@ tarpaulin() cargo +nightly tarpaulin --verbose } -# cd protocols -# tarpaulin -cd roles +cd protocols +tarpaulin +cd ../roles tarpaulin cd ../utils tarpaulin