From 2f565a295e7afd6f0ff99204dca659a092aeb85c Mon Sep 17 00:00:00 2001 From: Alexander Schmidt Date: Tue, 22 Oct 2024 08:39:09 +0200 Subject: [PATCH 001/124] disable swap space allocation --- .github/workflows/cargo-llvm-cov.yml | 8 ++++---- .github/workflows/codecov.yml | 8 ++++---- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/.github/workflows/cargo-llvm-cov.yml b/.github/workflows/cargo-llvm-cov.yml index c8a57156136..e953387ba85 100644 --- a/.github/workflows/cargo-llvm-cov.yml +++ b/.github/workflows/cargo-llvm-cov.yml @@ -46,10 +46,10 @@ jobs: - name: Install nextest uses: taiki-e/install-action@7e58f89e24a544d88f7a74c6eed8a3df3fd4c658 # pin@nextest - - name: Set Swap Space - uses: pierotofy/set-swap-space@49819abfb41bd9b44fb781159c033dba90353a7c # pin@master - with: - swap-size-gb: 256 + # - name: Set Swap Space + # uses: pierotofy/set-swap-space@49819abfb41bd9b44fb781159c033dba90353a7c # pin@master + # with: + # swap-size-gb: 256 - name: Install Rust run: rustup update stable diff --git a/.github/workflows/codecov.yml b/.github/workflows/codecov.yml index 1a5765f9e14..8ef86ae6ad2 100644 --- a/.github/workflows/codecov.yml +++ b/.github/workflows/codecov.yml @@ -37,10 +37,10 @@ jobs: crate: grcov locked: true - - name: Set Swap Space - uses: pierotofy/set-swap-space@master - with: - swap-size-gb: 256 + # - name: Set Swap Space + # uses: pierotofy/set-swap-space@master + # with: + # swap-size-gb: 256 - name: Build uses: actions-rs/cargo@ae10961054e4aa8b4aa7dffede299aaf087aa33b # pin@v1.0.3 From c34139cb2e8df0f38a77e4da79a2bf70a646bde9 Mon Sep 17 00:00:00 2001 From: Alexander Schmidt Date: Tue, 22 Oct 2024 16:11:21 +0200 Subject: [PATCH 002/124] update config-patch --- scripts/simtest/config-patch | 29 +++++++++++++++-------------- 1 file changed, 15 insertions(+), 14 deletions(-) diff --git a/scripts/simtest/config-patch b/scripts/simtest/config-patch index e8d748d4e47..3671b285d53 100644 --- a/scripts/simtest/config-patch +++ b/scripts/simtest/config-patch @@ -1,22 +1,23 @@ -diff --git a/.cargo/config b/.cargo/config -index ec2c459490..55985cbe9f 100644 ---- a/.cargo/config -+++ b/.cargo/config -@@ -25,4 +25,4 @@ move-clippy = [ - ] - +diff --git a/.cargo/config.toml b/.cargo/config.toml +index cc5620ecfe..d2ad8f1dac 100644 +--- a/.cargo/config.toml ++++ b/.cargo/config.toml +@@ -6,7 +6,7 @@ ci-udeps = "udeps --all-targets --backend=depinfo" + ci-udeps-external = "udeps --all-targets --manifest-path external-crates/move/Cargo.toml --backend=depinfo" + [build] -rustflags = ["-C", "force-frame-pointers=yes", "-C", "force-unwind-tables=yes"] +rustflags = ["-C", "force-frame-pointers=yes", "-C", "force-unwind-tables=yes", "--cfg", "msim"] + + # 64 bit MSVC, override default 1M stack with 8M stack + [target.x86_64-pc-windows-msvc] diff --git a/Cargo.toml b/Cargo.toml -index c0829bc1b6..4007f97d66 100644 +index 3ff13bd734..e7b820ba2b 100644 --- a/Cargo.toml +++ b/Cargo.toml -@@ -682,5 +682,7 @@ field_names = "0.2.0" - semver = "1.0.16" - spinners = "4.1.0" - include_dir = "0.7.3" -+ -+[patch.crates-io] +@@ -482,3 +482,5 @@ narwhal-types = { path = "narwhal/types" } + iota-execution = { path = "iota-execution" } + + [patch.crates-io] +tokio = { git = "ssh://git@github.com/iotaledger/iota-sim.git", rev = "8fe1939f4bf1e54d0638756c82aaa6c29212e2bb" } +futures-timer = { git = "ssh://git@github.com/iotaledger/iota-sim.git", rev = "8fe1939f4bf1e54d0638756c82aaa6c29212e2bb" } From a53a435063681bb16d1282651a7640c395093f4c Mon Sep 17 00:00:00 2001 From: Alexander Schmidt Date: Tue, 22 Oct 2024 16:38:17 +0200 Subject: [PATCH 003/124] temporarily disable report upload --- .github/workflows/cargo-llvm-cov.yml | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/.github/workflows/cargo-llvm-cov.yml b/.github/workflows/cargo-llvm-cov.yml index e953387ba85..1873b974749 100644 --- a/.github/workflows/cargo-llvm-cov.yml +++ b/.github/workflows/cargo-llvm-cov.yml @@ -57,20 +57,20 @@ jobs: - name: Run code coverage for nextest run: IOTA_SKIP_SIMTESTS=1 cargo llvm-cov --ignore-run-fail --lcov --output-path lcov.info nextest - - name: Upload report to Codecov for nextest - uses: codecov/codecov-action@b9fd7d16f6d7d1b5d2bec1a2887e65ceed900238 # pin@v4 - with: - files: lcov.info + # - name: Upload report to Codecov for nextest + # uses: codecov/codecov-action@b9fd7d16f6d7d1b5d2bec1a2887e65ceed900238 # pin@v4 + # with: + # files: lcov.info - name: Run code coverage for simtest run: | git clean -fd ./scripts/simtest/codecov.sh - - name: Upload report to Codecov for simtest - uses: codecov/codecov-action@b9fd7d16f6d7d1b5d2bec1a2887e65ceed900238 # pin@v4 - with: - files: lcov-simtest.info + # - name: Upload report to Codecov for simtest + # uses: codecov/codecov-action@b9fd7d16f6d7d1b5d2bec1a2887e65ceed900238 # pin@v4 + # with: + # files: lcov-simtest.info notify: name: Notify From 5b1e2ebbb1a2925b7b7d92c523c3f63adca9bc45 Mon Sep 17 00:00:00 2001 From: Alexander Schmidt Date: Wed, 23 Oct 2024 17:28:53 +0200 Subject: [PATCH 004/124] upload coverage reports as Github artifacts --- .github/workflows/cargo-llvm-cov.yml | 14 ++++++++++++++ .github/workflows/codecov.yml | 11 +++++++++-- 2 files changed, 23 insertions(+), 2 deletions(-) diff --git a/.github/workflows/cargo-llvm-cov.yml b/.github/workflows/cargo-llvm-cov.yml index 1873b974749..b9136cc24ab 100644 --- a/.github/workflows/cargo-llvm-cov.yml +++ b/.github/workflows/cargo-llvm-cov.yml @@ -62,6 +62,13 @@ jobs: # with: # files: lcov.info + - name: Upload nextest coverage report to Github + uses: actions/upload-artifact@b4b15b8c7c6ac21ea08fcf65892d2ee8f75cf882 # pin@v4 + with: + name: lcov.info + path: . + retention-days: 30 + - name: Run code coverage for simtest run: | git clean -fd @@ -72,6 +79,13 @@ jobs: # with: # files: lcov-simtest.info + - name: Upload simtest coverage report to Github + uses: actions/upload-artifact@b4b15b8c7c6ac21ea08fcf65892d2ee8f75cf882 # pin@v4 + with: + name: lcov-simtest.info + path: . + retention-days: 30 + notify: name: Notify needs: [cargo-llvm-cov] diff --git a/.github/workflows/codecov.yml b/.github/workflows/codecov.yml index 8ef86ae6ad2..0f1f42fcace 100644 --- a/.github/workflows/codecov.yml +++ b/.github/workflows/codecov.yml @@ -60,5 +60,12 @@ jobs: - name: Run grcov run: grcov . --binary-path target/debug/ -s . -t lcov --branch --ignore-not-existing --ignore '../**' --ignore '/*' -o coverage.lcov - - name: Upload to codecov.io - uses: codecov/codecov-action@e0b68c6749509c5f83f984dd99a76a1c1a231044 # pin v4.0.1 + # - name: Upload to codecov.io + # uses: codecov/codecov-action@e0b68c6749509c5f83f984dd99a76a1c1a231044 # pin v4.0.1 + + - name: Upload coverage report to Github + uses: actions/upload-artifact@b4b15b8c7c6ac21ea08fcf65892d2ee8f75cf882 # pin@v4 + with: + name: coverage.lcov + path: . + retention-days: 30 From bc099a0f5cbbeb8450e520d6e4034de792bef2bc Mon Sep 17 00:00:00 2001 From: Alexander Schmidt Date: Wed, 23 Oct 2024 21:02:19 +0200 Subject: [PATCH 005/124] fix path --- .github/workflows/cargo-llvm-cov.yml | 12 ++++++++---- .github/workflows/codecov.yml | 6 ++++-- 2 files changed, 12 insertions(+), 6 deletions(-) diff --git a/.github/workflows/cargo-llvm-cov.yml b/.github/workflows/cargo-llvm-cov.yml index b9136cc24ab..d1c8907fecb 100644 --- a/.github/workflows/cargo-llvm-cov.yml +++ b/.github/workflows/cargo-llvm-cov.yml @@ -62,11 +62,13 @@ jobs: # with: # files: lcov.info - - name: Upload nextest coverage report to Github + - name: Upload coverage report (nextest) uses: actions/upload-artifact@b4b15b8c7c6ac21ea08fcf65892d2ee8f75cf882 # pin@v4 + if: always() with: name: lcov.info - path: . + path: ./lcov.info + if-no-files-found: error retention-days: 30 - name: Run code coverage for simtest @@ -79,11 +81,13 @@ jobs: # with: # files: lcov-simtest.info - - name: Upload simtest coverage report to Github + - name: Upload coverage report (simtest) uses: actions/upload-artifact@b4b15b8c7c6ac21ea08fcf65892d2ee8f75cf882 # pin@v4 + if: always() with: name: lcov-simtest.info - path: . + path: ./lcov-simtest.info + if-no-files-found: error retention-days: 30 notify: diff --git a/.github/workflows/codecov.yml b/.github/workflows/codecov.yml index 0f1f42fcace..6db03d25774 100644 --- a/.github/workflows/codecov.yml +++ b/.github/workflows/codecov.yml @@ -63,9 +63,11 @@ jobs: # - name: Upload to codecov.io # uses: codecov/codecov-action@e0b68c6749509c5f83f984dd99a76a1c1a231044 # pin v4.0.1 - - name: Upload coverage report to Github + - name: Upload coverage report uses: actions/upload-artifact@b4b15b8c7c6ac21ea08fcf65892d2ee8f75cf882 # pin@v4 + if: always() with: name: coverage.lcov - path: . + path: ./coverage.lcov + if-no-files-found: error retention-days: 30 From 69585a873f4781ab9bb53e7dbb3d7a103d5848bd Mon Sep 17 00:00:00 2001 From: Alexander Schmidt Date: Wed, 23 Oct 2024 23:21:09 +0200 Subject: [PATCH 006/124] update Cargo.lock --- scripts/simtest/codecov.sh | 1 + 1 file changed, 1 insertion(+) diff --git a/scripts/simtest/codecov.sh b/scripts/simtest/codecov.sh index d0b1c57e2bb..08d3dec079d 100755 --- a/scripts/simtest/codecov.sh +++ b/scripts/simtest/codecov.sh @@ -6,6 +6,7 @@ # verify that git repo is clean if [[ -n $(git status -s) ]]; then echo "Working directory is not clean. Please commit all changes before running this script." + echo $(git status -s) exit 1 fi From 6e2797c1d51357b03f9586901139daf18a26551c Mon Sep 17 00:00:00 2001 From: Alexander Schmidt Date: Wed, 23 Oct 2024 23:55:56 +0200 Subject: [PATCH 007/124] temporarily disable slack bot notificaiton --- .github/workflows/cargo-llvm-cov.yml | 150 +++++++++++++-------------- 1 file changed, 75 insertions(+), 75 deletions(-) diff --git a/.github/workflows/cargo-llvm-cov.yml b/.github/workflows/cargo-llvm-cov.yml index d1c8907fecb..bf86acb853c 100644 --- a/.github/workflows/cargo-llvm-cov.yml +++ b/.github/workflows/cargo-llvm-cov.yml @@ -126,78 +126,78 @@ jobs: gh_job_link=$(gh api -X GET 'repos/iotaledger/iota/actions/runs/${{ github.run_id }}/jobs' --jq '.jobs.[0].html_url') echo "gh_job_link=${gh_job_link}" >> $GITHUB_ENV - - name: Get current oncall - run: | - export current_oncall=$(curl -s --request GET \ - --url 'https://api.pagerduty.com/oncalls?schedule_ids[]=PGCQ3YS' \ - --header 'Accept: application/json' \ - --header 'Authorization: Token token=${{ secrets.PAGERDUTY_ACCESS_KEY }}' \ - --header 'Content-Type: application/json' \ - | jq '.oncalls[].user.summary' | tr -d '"') - echo "current_oncall=$(echo ${current_oncall})" >> $GITHUB_ENV - - export oncall_name=$(curl -s --request GET \ - --url 'https://api.pagerduty.com/oncalls?schedule_ids[]=PGCQ3YS' \ - --header 'Accept: application/json' \ - --header 'Authorization: Token token=${{ secrets.PAGERDUTY_ACCESS_KEY }}' \ - --header 'Content-Type: application/json' \ - | jq '.oncalls[].escalation_policy.summary' | tr -d '"') - echo "oncall_name=$(echo ${oncall_name})" >> $GITHUB_ENV - - - name: Configure AWS credentials - uses: aws-actions/configure-aws-credentials@e3dd6a429d7300a6a4c196c26e071d42e0343502 # pin@v4 - with: - aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }} - aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }} - aws-region: us-west-2 - - - name: Get slack id for the oncall - run: | - export slack_id=$(aws s3 cp s3://iota-employees-dir/employees.json - | jq --arg ONCALL "${{ env.current_oncall }}" '.[] | if .name == $ONCALL then .slack_id else empty end') - echo "slack_id=$(echo ${slack_id} | tr -d '"')" >> $GITHUB_ENV - - - name: Post to slack - uses: slackapi/slack-github-action@936158bbe252e9a6062e793ea4609642c966e302 # pin@v1.21.0 - env: - SLACK_BOT_TOKEN: ${{ secrets.SLACK_BOT_TOKEN }} - IOTA_SHA: ${{ env.iota_sha }} - IOTA_BRANCH_NAME: ${{ env.iota_branch_name }} - IOTA_BRANCH_NAME_URL: ${{ env.iota_branch_name_url }} - GH_JOB_LINK: ${{ env.gh_job_link }} - SLACK_ID: ${{ env.slack_id }} - ONCALL_NAME: ${{ env.oncall_name }} - with: - channel-id: "code-coverage" - payload: | - { - "text": "*${{ github.workflow }}* workflow status: `${{ env.WORKFLOW_CONCLUSION }}`", - "blocks": [ - { - "type": "section", - "text": { - "type": "mrkdwn", - "text": "*${{ github.workflow }}* workflow status: `${{ env.WORKFLOW_CONCLUSION }}`" - } - }, - { - "type": "divider" - }, - { - "type": "section", - "text": { - "type": "mrkdwn", - "text": "IOTA commit: \nIOTA branch: `${{ env.IOTA_BRANCH_NAME }}`\nRun: <${{ env.GH_JOB_LINK }}|${{ github.run_id }}>" - } - }, - { - "type": "divider" - }, - { - "type": "section", - "text": { - "type": "mrkdwn", - "text": "<@${{ env.SLACK_ID }}>, current `${{ env.ONCALL_NAME }}` oncall, please look over the code coverage for the `${{ env.IOTA_BRANCH_NAME }}` branch in IOTA repo." - } - } - ] - } + # - name: Get current oncall + # run: | + # export current_oncall=$(curl -s --request GET \ + # --url 'https://api.pagerduty.com/oncalls?schedule_ids[]=PGCQ3YS' \ + # --header 'Accept: application/json' \ + # --header 'Authorization: Token token=${{ secrets.PAGERDUTY_ACCESS_KEY }}' \ + # --header 'Content-Type: application/json' \ + # | jq '.oncalls[].user.summary' | tr -d '"') + # echo "current_oncall=$(echo ${current_oncall})" >> $GITHUB_ENV + + # export oncall_name=$(curl -s --request GET \ + # --url 'https://api.pagerduty.com/oncalls?schedule_ids[]=PGCQ3YS' \ + # --header 'Accept: application/json' \ + # --header 'Authorization: Token token=${{ secrets.PAGERDUTY_ACCESS_KEY }}' \ + # --header 'Content-Type: application/json' \ + # | jq '.oncalls[].escalation_policy.summary' | tr -d '"') + # echo "oncall_name=$(echo ${oncall_name})" >> $GITHUB_ENV + + # - name: Configure AWS credentials + # uses: aws-actions/configure-aws-credentials@e3dd6a429d7300a6a4c196c26e071d42e0343502 # pin@v4 + # with: + # aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }} + # aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }} + # aws-region: us-west-2 + + # - name: Get slack id for the oncall + # run: | + # export slack_id=$(aws s3 cp s3://iota-employees-dir/employees.json - | jq --arg ONCALL "${{ env.current_oncall }}" '.[] | if .name == $ONCALL then .slack_id else empty end') + # echo "slack_id=$(echo ${slack_id} | tr -d '"')" >> $GITHUB_ENV + + # - name: Post to slack + # uses: slackapi/slack-github-action@936158bbe252e9a6062e793ea4609642c966e302 # pin@v1.21.0 + # env: + # SLACK_BOT_TOKEN: ${{ secrets.SLACK_BOT_TOKEN }} + # IOTA_SHA: ${{ env.iota_sha }} + # IOTA_BRANCH_NAME: ${{ env.iota_branch_name }} + # IOTA_BRANCH_NAME_URL: ${{ env.iota_branch_name_url }} + # GH_JOB_LINK: ${{ env.gh_job_link }} + # SLACK_ID: ${{ env.slack_id }} + # ONCALL_NAME: ${{ env.oncall_name }} + # with: + # channel-id: "code-coverage" + # payload: | + # { + # "text": "*${{ github.workflow }}* workflow status: `${{ env.WORKFLOW_CONCLUSION }}`", + # "blocks": [ + # { + # "type": "section", + # "text": { + # "type": "mrkdwn", + # "text": "*${{ github.workflow }}* workflow status: `${{ env.WORKFLOW_CONCLUSION }}`" + # } + # }, + # { + # "type": "divider" + # }, + # { + # "type": "section", + # "text": { + # "type": "mrkdwn", + # "text": "IOTA commit: \nIOTA branch: `${{ env.IOTA_BRANCH_NAME }}`\nRun: <${{ env.GH_JOB_LINK }}|${{ github.run_id }}>" + # } + # }, + # { + # "type": "divider" + # }, + # { + # "type": "section", + # "text": { + # "type": "mrkdwn", + # "text": "<@${{ env.SLACK_ID }}>, current `${{ env.ONCALL_NAME }}` oncall, please look over the code coverage for the `${{ env.IOTA_BRANCH_NAME }}` branch in IOTA repo." + # } + # } + # ] + # } From 4fb0695449cadd73156c0a3ef53b438d19023c2d Mon Sep 17 00:00:00 2001 From: Alexander Schmidt Date: Thu, 24 Oct 2024 09:02:45 +0200 Subject: [PATCH 008/124] update config-patch --- scripts/simtest/config-patch | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/scripts/simtest/config-patch b/scripts/simtest/config-patch index 3671b285d53..8aca33f4100 100644 --- a/scripts/simtest/config-patch +++ b/scripts/simtest/config-patch @@ -12,11 +12,11 @@ index cc5620ecfe..d2ad8f1dac 100644 # 64 bit MSVC, override default 1M stack with 8M stack [target.x86_64-pc-windows-msvc] diff --git a/Cargo.toml b/Cargo.toml -index 3ff13bd734..e7b820ba2b 100644 +index 6fd5380358..f2111d330c 100644 --- a/Cargo.toml +++ b/Cargo.toml -@@ -482,3 +482,5 @@ narwhal-types = { path = "narwhal/types" } - iota-execution = { path = "iota-execution" } +@@ -477,3 +477,5 @@ typed-store-derive = { path = "crates/typed-store-derive" } + typed-store-error = { path = "crates/typed-store-error" } [patch.crates-io] +tokio = { git = "ssh://git@github.com/iotaledger/iota-sim.git", rev = "8fe1939f4bf1e54d0638756c82aaa6c29212e2bb" } From eaf571ba46dd437714f4d122ddbaf0bbc5841983 Mon Sep 17 00:00:00 2001 From: Alexander Schmidt Date: Thu, 24 Oct 2024 11:33:09 +0200 Subject: [PATCH 009/124] clean up artifacts --- .github/workflows/cargo-llvm-cov.yml | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/.github/workflows/cargo-llvm-cov.yml b/.github/workflows/cargo-llvm-cov.yml index bf86acb853c..7680d22a0bf 100644 --- a/.github/workflows/cargo-llvm-cov.yml +++ b/.github/workflows/cargo-llvm-cov.yml @@ -54,6 +54,12 @@ jobs: - name: Install Rust run: rustup update stable + - name: Remove old coverage artifacts + run: | + if [ -d "./target/llvm-cov-target" ]; then + rm -rf ./target/llvm-cov-target + fi + - name: Run code coverage for nextest run: IOTA_SKIP_SIMTESTS=1 cargo llvm-cov --ignore-run-fail --lcov --output-path lcov.info nextest @@ -90,6 +96,9 @@ jobs: if-no-files-found: error retention-days: 30 + - name: Clean up coverage artifacts + run: rm -rf ./target/llvm-cov-target + notify: name: Notify needs: [cargo-llvm-cov] From 7e66a315e13d87a8d1eba89a57e7e9a8484b361a Mon Sep 17 00:00:00 2001 From: Alexander Schmidt Date: Thu, 24 Oct 2024 14:49:27 +0200 Subject: [PATCH 010/124] also clean in between --- .github/workflows/cargo-llvm-cov.yml | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/.github/workflows/cargo-llvm-cov.yml b/.github/workflows/cargo-llvm-cov.yml index 7680d22a0bf..3cca5548b7e 100644 --- a/.github/workflows/cargo-llvm-cov.yml +++ b/.github/workflows/cargo-llvm-cov.yml @@ -57,7 +57,9 @@ jobs: - name: Remove old coverage artifacts run: | if [ -d "./target/llvm-cov-target" ]; then + echo "Found artifacts" rm -rf ./target/llvm-cov-target + echo "Removed" fi - name: Run code coverage for nextest @@ -77,6 +79,13 @@ jobs: if-no-files-found: error retention-days: 30 + - name: Clean up coverage artifacts + run: | + if [ -d "./target/llvm-cov-target" ]; then + echo "Found artifacts" + rm -rf ./target/llvm-cov-target + echo "Removed" + - name: Run code coverage for simtest run: | git clean -fd @@ -97,7 +106,11 @@ jobs: retention-days: 30 - name: Clean up coverage artifacts - run: rm -rf ./target/llvm-cov-target + run: | + if [ -d "./target/llvm-cov-target" ]; then + echo "Found artifacts" + rm -rf ./target/llvm-cov-target + echo "Removed" notify: name: Notify From ab58f70398b53d189b35c1996ad1e37188e713d0 Mon Sep 17 00:00:00 2001 From: Alexander Schmidt Date: Thu, 24 Oct 2024 16:42:45 +0200 Subject: [PATCH 011/124] fix --- .github/workflows/cargo-llvm-cov.yml | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/.github/workflows/cargo-llvm-cov.yml b/.github/workflows/cargo-llvm-cov.yml index 3cca5548b7e..14405ff7a6a 100644 --- a/.github/workflows/cargo-llvm-cov.yml +++ b/.github/workflows/cargo-llvm-cov.yml @@ -60,6 +60,8 @@ jobs: echo "Found artifacts" rm -rf ./target/llvm-cov-target echo "Removed" + else + echo "No artifacts found" fi - name: Run code coverage for nextest @@ -82,9 +84,9 @@ jobs: - name: Clean up coverage artifacts run: | if [ -d "./target/llvm-cov-target" ]; then - echo "Found artifacts" rm -rf ./target/llvm-cov-target - echo "Removed" + echo "Previous Coverage artifacts removed" + fi - name: Run code coverage for simtest run: | @@ -108,9 +110,9 @@ jobs: - name: Clean up coverage artifacts run: | if [ -d "./target/llvm-cov-target" ]; then - echo "Found artifacts" rm -rf ./target/llvm-cov-target - echo "Removed" + echo "Previous Coverage artifacts removed" + fi notify: name: Notify From 90c47e5223a7c3b676b527bfc4434bc70dc1eb63 Mon Sep 17 00:00:00 2001 From: Alexander Schmidt Date: Thu, 24 Oct 2024 19:46:09 +0200 Subject: [PATCH 012/124] investigate seg faults during simtest --- scripts/simtest/codecov.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/simtest/codecov.sh b/scripts/simtest/codecov.sh index 08d3dec079d..749802bc324 100755 --- a/scripts/simtest/codecov.sh +++ b/scripts/simtest/codecov.sh @@ -16,7 +16,7 @@ git apply ./scripts/simtest/config-patch root_dir=$(git rev-parse --show-toplevel) export SIMTEST_STATIC_INIT_MOVE=$root_dir"/examples/move/basics" -MSIM_WATCHDOG_TIMEOUT_MS=60000 MSIM_TEST_SEED=1 cargo llvm-cov --ignore-run-fail --lcov --output-path lcov-simtest.info nextest --cargo-profile simulator +MSIM_WATCHDOG_TIMEOUT_MS=60000 MSIM_TEST_SEED=1 cargo llvm-cov --jobs 1 --ignore-run-fail --lcov --output-path lcov-simtest.info nextest --cargo-profile simulator # remove the patch git checkout .cargo/config Cargo.toml Cargo.lock From 704fb0cf02790387c0a4e6a00a1965a96a5d0184 Mon Sep 17 00:00:00 2001 From: Alexander Schmidt Date: Fri, 25 Oct 2024 10:09:05 +0200 Subject: [PATCH 013/124] run only simtest --- .github/workflows/cargo-llvm-cov.yml | 35 +++++++++++++++------------- scripts/simtest/codecov.sh | 2 +- 2 files changed, 20 insertions(+), 17 deletions(-) diff --git a/.github/workflows/cargo-llvm-cov.yml b/.github/workflows/cargo-llvm-cov.yml index 14405ff7a6a..98149b151e4 100644 --- a/.github/workflows/cargo-llvm-cov.yml +++ b/.github/workflows/cargo-llvm-cov.yml @@ -64,29 +64,32 @@ jobs: echo "No artifacts found" fi - - name: Run code coverage for nextest - run: IOTA_SKIP_SIMTESTS=1 cargo llvm-cov --ignore-run-fail --lcov --output-path lcov.info nextest + # TEMPORARILY DISABLE TO DEBUG SIMTESTS + # - name: Run code coverage for nextest + # run: IOTA_SKIP_SIMTESTS=1 cargo llvm-cov --ignore-run-fail --lcov --output-path lcov.info nextest + # DISABLED AS LONG AS REPO IS PRIVATE # - name: Upload report to Codecov for nextest # uses: codecov/codecov-action@b9fd7d16f6d7d1b5d2bec1a2887e65ceed900238 # pin@v4 # with: # files: lcov.info - - name: Upload coverage report (nextest) - uses: actions/upload-artifact@b4b15b8c7c6ac21ea08fcf65892d2ee8f75cf882 # pin@v4 - if: always() - with: - name: lcov.info - path: ./lcov.info - if-no-files-found: error - retention-days: 30 + # TEMPORARILY DISABLE TO DEBUG SIMTESTS + # - name: Upload coverage report (nextest) + # uses: actions/upload-artifact@b4b15b8c7c6ac21ea08fcf65892d2ee8f75cf882 # pin@v4 + # if: always() + # with: + # name: lcov.info + # path: ./lcov.info + # if-no-files-found: error + # retention-days: 30 - - name: Clean up coverage artifacts - run: | - if [ -d "./target/llvm-cov-target" ]; then - rm -rf ./target/llvm-cov-target - echo "Previous Coverage artifacts removed" - fi + # - name: Clean up coverage artifacts + # run: | + # if [ -d "./target/llvm-cov-target" ]; then + # rm -rf ./target/llvm-cov-target + # echo "Previous Coverage artifacts removed" + # fi - name: Run code coverage for simtest run: | diff --git a/scripts/simtest/codecov.sh b/scripts/simtest/codecov.sh index 749802bc324..08d3dec079d 100755 --- a/scripts/simtest/codecov.sh +++ b/scripts/simtest/codecov.sh @@ -16,7 +16,7 @@ git apply ./scripts/simtest/config-patch root_dir=$(git rev-parse --show-toplevel) export SIMTEST_STATIC_INIT_MOVE=$root_dir"/examples/move/basics" -MSIM_WATCHDOG_TIMEOUT_MS=60000 MSIM_TEST_SEED=1 cargo llvm-cov --jobs 1 --ignore-run-fail --lcov --output-path lcov-simtest.info nextest --cargo-profile simulator +MSIM_WATCHDOG_TIMEOUT_MS=60000 MSIM_TEST_SEED=1 cargo llvm-cov --ignore-run-fail --lcov --output-path lcov-simtest.info nextest --cargo-profile simulator # remove the patch git checkout .cargo/config Cargo.toml Cargo.lock From cdc8b9a24c755d0d83c81ae36edc34fb19b3c1d5 Mon Sep 17 00:00:00 2001 From: Alexander Schmidt Date: Mon, 28 Oct 2024 10:38:17 +0100 Subject: [PATCH 014/124] disable simtest; update grcov workflow --- .github/workflows/cargo-llvm-cov.yml | 72 ++++++++++-------------- .github/workflows/codecov.yml | 83 ++++++++++++++++++---------- 2 files changed, 83 insertions(+), 72 deletions(-) diff --git a/.github/workflows/cargo-llvm-cov.yml b/.github/workflows/cargo-llvm-cov.yml index 98149b151e4..8b7961a9b95 100644 --- a/.github/workflows/cargo-llvm-cov.yml +++ b/.github/workflows/cargo-llvm-cov.yml @@ -1,8 +1,9 @@ name: Code Coverage on: - schedule: - - cron: "0 9 * * *" # UTC timing is every day at 1am PST + # Temporarily disabled until simtest job is fixed + # schedule: + # - cron: "0 9 * * *" # UTC timing is every day at 1am PST workflow_dispatch: env: @@ -46,12 +47,7 @@ jobs: - name: Install nextest uses: taiki-e/install-action@7e58f89e24a544d88f7a74c6eed8a3df3fd4c658 # pin@nextest - # - name: Set Swap Space - # uses: pierotofy/set-swap-space@49819abfb41bd9b44fb781159c033dba90353a7c # pin@master - # with: - # swap-size-gb: 256 - - - name: Install Rust + - name: Update Rust toolchain run: rustup update stable - name: Remove old coverage artifacts @@ -64,25 +60,22 @@ jobs: echo "No artifacts found" fi - # TEMPORARILY DISABLE TO DEBUG SIMTESTS - # - name: Run code coverage for nextest - # run: IOTA_SKIP_SIMTESTS=1 cargo llvm-cov --ignore-run-fail --lcov --output-path lcov.info nextest + - name: Run code coverage for nextest + run: IOTA_SKIP_SIMTESTS=1 cargo llvm-cov --ignore-run-fail --lcov --output-path lcov.info nextest - # DISABLED AS LONG AS REPO IS PRIVATE - # - name: Upload report to Codecov for nextest - # uses: codecov/codecov-action@b9fd7d16f6d7d1b5d2bec1a2887e65ceed900238 # pin@v4 - # with: - # files: lcov.info + - name: Upload report to Codecov for nextest + uses: codecov/codecov-action@b9fd7d16f6d7d1b5d2bec1a2887e65ceed900238 # pin@v4 + with: + files: lcov.info - # TEMPORARILY DISABLE TO DEBUG SIMTESTS - # - name: Upload coverage report (nextest) - # uses: actions/upload-artifact@b4b15b8c7c6ac21ea08fcf65892d2ee8f75cf882 # pin@v4 - # if: always() - # with: - # name: lcov.info - # path: ./lcov.info - # if-no-files-found: error - # retention-days: 30 + - name: Upload coverage report (nextest) + uses: actions/upload-artifact@b4b15b8c7c6ac21ea08fcf65892d2ee8f75cf882 # pin@v4 + if: always() + with: + name: lcov.info + path: ./lcov.info + if-no-files-found: error + retention-days: 30 # - name: Clean up coverage artifacts # run: | @@ -91,30 +84,25 @@ jobs: # echo "Previous Coverage artifacts removed" # fi - - name: Run code coverage for simtest - run: | - git clean -fd - ./scripts/simtest/codecov.sh + # - name: Run code coverage for simtest + # run: | + # git clean -fd + # ./scripts/simtest/codecov.sh - # - name: Upload report to Codecov for simtest - # uses: codecov/codecov-action@b9fd7d16f6d7d1b5d2bec1a2887e65ceed900238 # pin@v4 + # - name: Upload coverage report (simtest) + # uses: actions/upload-artifact@b4b15b8c7c6ac21ea08fcf65892d2ee8f75cf882 # pin@v4 + # if: always() # with: - # files: lcov-simtest.info - - - name: Upload coverage report (simtest) - uses: actions/upload-artifact@b4b15b8c7c6ac21ea08fcf65892d2ee8f75cf882 # pin@v4 - if: always() - with: - name: lcov-simtest.info - path: ./lcov-simtest.info - if-no-files-found: error - retention-days: 30 + # name: lcov-simtest.info + # path: ./lcov-simtest.info + # if-no-files-found: error + # retention-days: 30 - name: Clean up coverage artifacts run: | if [ -d "./target/llvm-cov-target" ]; then rm -rf ./target/llvm-cov-target - echo "Previous Coverage artifacts removed" + echo "Cleaned up coverage artificats" fi notify: diff --git a/.github/workflows/codecov.yml b/.github/workflows/codecov.yml index 6db03d25774..600788cbbd4 100644 --- a/.github/workflows/codecov.yml +++ b/.github/workflows/codecov.yml @@ -1,30 +1,35 @@ name: Codecov on: - push: - branches: - - develop - pull_request: - branches: - - develop - types: [opened, reopened, synchronize, ready_for_review] + # Temporarily disabled + # push: + # branches: + # - develop + # pull_request: + # branches: + # - develop + # types: [opened, reopened, synchronize, ready_for_review] + workflow_dispatch: jobs: - diff: - if: github.event.pull_request.draft == false - runs-on: [self-hosted] - outputs: - isRust: ${{ steps.diff.outputs.isRust }} - steps: - - uses: actions/checkout@eef61447b9ff4aafe5dcd4e0bbf5d482be7e7871 # pin@v4 - - name: Detect Changes - uses: "./.github/actions/diffs" - id: diff + # Temporarily disabled + # diff: + # if: github.event.pull_request.draft == false + # runs-on: [self-hosted] + # outputs: + # isRust: ${{ steps.diff.outputs.isRust }} + # steps: + # - uses: actions/checkout@eef61447b9ff4aafe5dcd4e0bbf5d482be7e7871 # pin@v4 + # - name: Detect Changes + # uses: "./.github/actions/diffs" + # id: diff codecov-grcov: name: Generate code coverage - needs: diff - if: github.event.pull_request.draft == false && needs.diff.outputs.isRust == 'true' + # Temporarily disabled + # needs: diff + # Temporarily disabled + # if: github.event.pull_request.draft == false && needs.diff.outputs.isRust == 'true' runs-on: [self-hosted] steps: - uses: actions/checkout@eef61447b9ff4aafe5dcd4e0bbf5d482be7e7871 # pin@v4 @@ -37,10 +42,14 @@ jobs: crate: grcov locked: true - # - name: Set Swap Space - # uses: pierotofy/set-swap-space@master - # with: - # swap-size-gb: 256 + - name: Remove old coverage artifacts + run: | + if [ -d "./target/grcov-target" ]; then + rm -rf ./target/grcov-target + echo "Removed old artifacts" + else + echo "No artifacts found" + fi - name: Build uses: actions-rs/cargo@ae10961054e4aa8b4aa7dffede299aaf087aa33b # pin@v1.0.3 @@ -54,20 +63,34 @@ jobs: env: RUSTFLAGS: "-Cinstrument-coverage" RUSTDOCFLAGS: "-Cinstrument-coverage" - LLVM_PROFILE_FILE: "codecov-instrumentation-%p-%m.profraw" - run: cargo test + LLVM_PROFILE_FILE: "target/grcov-target/codecov-instrumentation-%p-%m.profraw" + run: | + mkdir target/grcov-target + cargo test - name: Run grcov - run: grcov . --binary-path target/debug/ -s . -t lcov --branch --ignore-not-existing --ignore '../**' --ignore '/*' -o coverage.lcov + run: grcov . --binary-path target/debug/ -s . -t lcov --branch --ignore-not-existing --ignore '../**' --ignore '/*' -o target/grcov-target/coverage.lcov - # - name: Upload to codecov.io - # uses: codecov/codecov-action@e0b68c6749509c5f83f984dd99a76a1c1a231044 # pin v4.0.1 + - name: Create coverage report + run: | + cd target/grcov-target + genhtml -o coverage_report coverage.lcov --verbose --ignore-errors source --synthesize-missing + tar -czf coverage_report.tgz coverage_report/ - name: Upload coverage report uses: actions/upload-artifact@b4b15b8c7c6ac21ea08fcf65892d2ee8f75cf882 # pin@v4 if: always() with: - name: coverage.lcov - path: ./coverage.lcov + name: coverage_report.tgz + path: ./target/grcov-target/coverage_report.tgz if-no-files-found: error retention-days: 30 + + - name: Clean up coverage artifacts + run: | + if [ -d "./target/grcov-target" ]; then + rm -rf ./target/grcov-target + echo "Cleaned up coverage artifacts" + fi + + \ No newline at end of file From 195f1a42d51250ea80cc8876fbbf8d4accc5e17d Mon Sep 17 00:00:00 2001 From: Alexander Schmidt Date: Mon, 28 Oct 2024 11:02:23 +0100 Subject: [PATCH 015/124] cleanup --- .github/workflows/cargo-llvm-cov.yml | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-) diff --git a/.github/workflows/cargo-llvm-cov.yml b/.github/workflows/cargo-llvm-cov.yml index 8b7961a9b95..e372bbbf421 100644 --- a/.github/workflows/cargo-llvm-cov.yml +++ b/.github/workflows/cargo-llvm-cov.yml @@ -53,21 +53,15 @@ jobs: - name: Remove old coverage artifacts run: | if [ -d "./target/llvm-cov-target" ]; then - echo "Found artifacts" rm -rf ./target/llvm-cov-target - echo "Removed" + echo "Removed old artifacts" else echo "No artifacts found" fi - - name: Run code coverage for nextest + - name: Run code coverage (nextest) run: IOTA_SKIP_SIMTESTS=1 cargo llvm-cov --ignore-run-fail --lcov --output-path lcov.info nextest - - name: Upload report to Codecov for nextest - uses: codecov/codecov-action@b9fd7d16f6d7d1b5d2bec1a2887e65ceed900238 # pin@v4 - with: - files: lcov.info - - name: Upload coverage report (nextest) uses: actions/upload-artifact@b4b15b8c7c6ac21ea08fcf65892d2ee8f75cf882 # pin@v4 if: always() @@ -84,7 +78,7 @@ jobs: # echo "Previous Coverage artifacts removed" # fi - # - name: Run code coverage for simtest + # - name: Run code coverage (simtest) # run: | # git clean -fd # ./scripts/simtest/codecov.sh From 9737f6bba7ed48d584ba385e7fdf3d8078d81aca Mon Sep 17 00:00:00 2001 From: Alexander Schmidt Date: Tue, 29 Oct 2024 08:57:06 +0100 Subject: [PATCH 016/124] clean up --- .github/workflows/cargo-llvm-cov.yml | 177 ++++----------------------- .github/workflows/codecov.yml | 67 +++++----- scripts/simtest/codecov.sh | 4 +- 3 files changed, 54 insertions(+), 194 deletions(-) diff --git a/.github/workflows/cargo-llvm-cov.yml b/.github/workflows/cargo-llvm-cov.yml index e372bbbf421..52653faf8b7 100644 --- a/.github/workflows/cargo-llvm-cov.yml +++ b/.github/workflows/cargo-llvm-cov.yml @@ -1,9 +1,8 @@ -name: Code Coverage +name: Code Coverage (llvm-cov) on: - # Temporarily disabled until simtest job is fixed - # schedule: - # - cron: "0 9 * * *" # UTC timing is every day at 1am PST + schedule: + - cron: "0 1 * * *" # UTC timing is every day at 1am UTC workflow_dispatch: env: @@ -31,8 +30,8 @@ env: RUSTDOCFLAGS: -D warnings jobs: - cargo-llvm-cov: - name: Generate code coverage + llvm-cov: + name: Generate code coverage (llvm-cov) runs-on: [self-hosted] timeout-minutes: 120 env: @@ -50,163 +49,31 @@ jobs: - name: Update Rust toolchain run: rustup update stable - - name: Remove old coverage artifacts + - name: Generate code coverage (from nextest) # ./target/llvm-cov/html run: | - if [ -d "./target/llvm-cov-target" ]; then - rm -rf ./target/llvm-cov-target - echo "Removed old artifacts" - else - echo "No artifacts found" - fi - - - name: Run code coverage (nextest) - run: IOTA_SKIP_SIMTESTS=1 cargo llvm-cov --ignore-run-fail --lcov --output-path lcov.info nextest + cargo llvm-cov clean + IOTA_SKIP_SIMTESTS=1 cargo llvm-cov --all-features --branch --ignore-run-fail --html nextest - name: Upload coverage report (nextest) uses: actions/upload-artifact@b4b15b8c7c6ac21ea08fcf65892d2ee8f75cf882 # pin@v4 if: always() with: - name: lcov.info - path: ./lcov.info + name: llvm-cov-nextest-html + path: target/llvm-cov/html if-no-files-found: error - retention-days: 30 - - # - name: Clean up coverage artifacts - # run: | - # if [ -d "./target/llvm-cov-target" ]; then - # rm -rf ./target/llvm-cov-target - # echo "Previous Coverage artifacts removed" - # fi - - # - name: Run code coverage (simtest) - # run: | - # git clean -fd - # ./scripts/simtest/codecov.sh + retention-days: 7 - # - name: Upload coverage report (simtest) - # uses: actions/upload-artifact@b4b15b8c7c6ac21ea08fcf65892d2ee8f75cf882 # pin@v4 - # if: always() - # with: - # name: lcov-simtest.info - # path: ./lcov-simtest.info - # if-no-files-found: error - # retention-days: 30 - - - name: Clean up coverage artifacts + - name: Run code coverage (simtest) run: | - if [ -d "./target/llvm-cov-target" ]; then - rm -rf ./target/llvm-cov-target - echo "Cleaned up coverage artificats" - fi - - notify: - name: Notify - needs: [cargo-llvm-cov] - runs-on: self-hosted - if: always() # always notify + git clean -fd + ./scripts/simtest/codecov.sh - steps: - - uses: technote-space/workflow-conclusion-action@45ce8e0eb155657ab8ccf346ade734257fd196a5 # pin@v3 - - - name: Checkout iota repo develop branch - uses: actions/checkout@eef61447b9ff4aafe5dcd4e0bbf5d482be7e7871 # pin@v4 - - - name: Get iota commit - env: - GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} - run: | - export iota_sha=$(git rev-parse HEAD) - echo "iota_sha=${iota_sha}" >> $GITHUB_ENV - - - name: Get a branch name for a iota commit - env: - GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} - run: | - export iota_branch_name=$(gh api -H 'Accept: application/vnd.github+json' /repos/iotaledger/iota/commits/${{ env.iota_sha }}/branches-where-head --jq '.[].name' | head -n 1) - # if the commit is not the head of the branch, get it's base branch - [[ -z $iota_branch_name ]] && export iota_branch_name=$(gh api -H 'Accept: application/vnd.github+json' /repos/iotaledger/iota/commits/${{ env.iota_sha }}/pulls --jq '.[].base.ref' | head -n 1) - echo "iota_branch_name=${iota_branch_name}" >> $GITHUB_ENV - echo "iota_branch_name_url=$(echo ${iota_branch_name} | sed 's\/\%2F\g')" >> $GITHUB_ENV - - - name: Get link to logs - env: - GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} - run: | - gh_job_link=$(gh api -X GET 'repos/iotaledger/iota/actions/runs/${{ github.run_id }}/jobs' --jq '.jobs.[0].html_url') - echo "gh_job_link=${gh_job_link}" >> $GITHUB_ENV - - # - name: Get current oncall - # run: | - # export current_oncall=$(curl -s --request GET \ - # --url 'https://api.pagerduty.com/oncalls?schedule_ids[]=PGCQ3YS' \ - # --header 'Accept: application/json' \ - # --header 'Authorization: Token token=${{ secrets.PAGERDUTY_ACCESS_KEY }}' \ - # --header 'Content-Type: application/json' \ - # | jq '.oncalls[].user.summary' | tr -d '"') - # echo "current_oncall=$(echo ${current_oncall})" >> $GITHUB_ENV - - # export oncall_name=$(curl -s --request GET \ - # --url 'https://api.pagerduty.com/oncalls?schedule_ids[]=PGCQ3YS' \ - # --header 'Accept: application/json' \ - # --header 'Authorization: Token token=${{ secrets.PAGERDUTY_ACCESS_KEY }}' \ - # --header 'Content-Type: application/json' \ - # | jq '.oncalls[].escalation_policy.summary' | tr -d '"') - # echo "oncall_name=$(echo ${oncall_name})" >> $GITHUB_ENV - - # - name: Configure AWS credentials - # uses: aws-actions/configure-aws-credentials@e3dd6a429d7300a6a4c196c26e071d42e0343502 # pin@v4 - # with: - # aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }} - # aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }} - # aws-region: us-west-2 - - # - name: Get slack id for the oncall - # run: | - # export slack_id=$(aws s3 cp s3://iota-employees-dir/employees.json - | jq --arg ONCALL "${{ env.current_oncall }}" '.[] | if .name == $ONCALL then .slack_id else empty end') - # echo "slack_id=$(echo ${slack_id} | tr -d '"')" >> $GITHUB_ENV + - name: Upload coverage report (simtest) + uses: actions/upload-artifact@b4b15b8c7c6ac21ea08fcf65892d2ee8f75cf882 # pin@v4 + if: always() + with: + name: llvm-cov-simtest-html + path: target/llvm-cov/html + if-no-files-found: error + retention-days: 7 - # - name: Post to slack - # uses: slackapi/slack-github-action@936158bbe252e9a6062e793ea4609642c966e302 # pin@v1.21.0 - # env: - # SLACK_BOT_TOKEN: ${{ secrets.SLACK_BOT_TOKEN }} - # IOTA_SHA: ${{ env.iota_sha }} - # IOTA_BRANCH_NAME: ${{ env.iota_branch_name }} - # IOTA_BRANCH_NAME_URL: ${{ env.iota_branch_name_url }} - # GH_JOB_LINK: ${{ env.gh_job_link }} - # SLACK_ID: ${{ env.slack_id }} - # ONCALL_NAME: ${{ env.oncall_name }} - # with: - # channel-id: "code-coverage" - # payload: | - # { - # "text": "*${{ github.workflow }}* workflow status: `${{ env.WORKFLOW_CONCLUSION }}`", - # "blocks": [ - # { - # "type": "section", - # "text": { - # "type": "mrkdwn", - # "text": "*${{ github.workflow }}* workflow status: `${{ env.WORKFLOW_CONCLUSION }}`" - # } - # }, - # { - # "type": "divider" - # }, - # { - # "type": "section", - # "text": { - # "type": "mrkdwn", - # "text": "IOTA commit: \nIOTA branch: `${{ env.IOTA_BRANCH_NAME }}`\nRun: <${{ env.GH_JOB_LINK }}|${{ github.run_id }}>" - # } - # }, - # { - # "type": "divider" - # }, - # { - # "type": "section", - # "text": { - # "type": "mrkdwn", - # "text": "<@${{ env.SLACK_ID }}>, current `${{ env.ONCALL_NAME }}` oncall, please look over the code coverage for the `${{ env.IOTA_BRANCH_NAME }}` branch in IOTA repo." - # } - # } - # ] - # } diff --git a/.github/workflows/codecov.yml b/.github/workflows/codecov.yml index 600788cbbd4..1cf3cb8c418 100644 --- a/.github/workflows/codecov.yml +++ b/.github/workflows/codecov.yml @@ -1,4 +1,4 @@ -name: Codecov +name: Code Coverage (grcov) on: # Temporarily disabled @@ -23,9 +23,8 @@ jobs: # - name: Detect Changes # uses: "./.github/actions/diffs" # id: diff - - codecov-grcov: - name: Generate code coverage + grcov: + name: Generate code coverage (grcov) # Temporarily disabled # needs: diff # Temporarily disabled @@ -33,23 +32,29 @@ jobs: runs-on: [self-hosted] steps: - uses: actions/checkout@eef61447b9ff4aafe5dcd4e0bbf5d482be7e7871 # pin@v4 - - run: rustup component add llvm-tools-preview - # Enable caching of the 'librocksdb-sys' crate by additionally caching the - # 'librocksdb-sys' src directory which is managed by cargo - - name: Install grcov, and cache the binary - uses: baptiste0928/cargo-install@1cd874a5478fdca35d868ccc74640c5aabbb8f1b # pin@v3.0.0 - with: - crate: grcov - locked: true + - uses: bmwill/rust-cache@fb63fcd7a959767755b88b5af2f5cbf65fb8a127 # pin@v1 + + - name: Install grcov + uses: taiki-e/install-action@grcov # pin@nextest + + - name: Install nextest + uses: taiki-e/install-action@7e58f89e24a544d88f7a74c6eed8a3df3fd4c658 # pin@nextest + + - name: Update Rust toolchain + run: rustup update stable + + - name: Install llvm-tools-preview + run: rustup component add llvm-tools-preview - name: Remove old coverage artifacts run: | - if [ -d "./target/grcov-target" ]; then - rm -rf ./target/grcov-target - echo "Removed old artifacts" - else - echo "No artifacts found" - fi + if [ -d "./target/grcov" ]; then + rm -rf ./target/grcov + echo "Removed old artifacts." + else + echo "Target directory is clean." + fi + fi - name: Build uses: actions-rs/cargo@ae10961054e4aa8b4aa7dffede299aaf087aa33b # pin@v1.0.3 @@ -63,34 +68,20 @@ jobs: env: RUSTFLAGS: "-Cinstrument-coverage" RUSTDOCFLAGS: "-Cinstrument-coverage" - LLVM_PROFILE_FILE: "target/grcov-target/codecov-instrumentation-%p-%m.profraw" + LLVM_PROFILE_FILE: "target/grcov/codecov-instrumentation-%p-%m.profraw" run: | - mkdir target/grcov-target + mkdir -p target/grcov/html cargo test - name: Run grcov - run: grcov . --binary-path target/debug/ -s . -t lcov --branch --ignore-not-existing --ignore '../**' --ignore '/*' -o target/grcov-target/coverage.lcov - - - name: Create coverage report run: | - cd target/grcov-target - genhtml -o coverage_report coverage.lcov --verbose --ignore-errors source --synthesize-missing - tar -czf coverage_report.tgz coverage_report/ + grcov . --binary-path target/debug/ -s . -t html --branch --ignore-not-existing --ignore '../**' --ignore '/*' -o target/grcov/html - name: Upload coverage report uses: actions/upload-artifact@b4b15b8c7c6ac21ea08fcf65892d2ee8f75cf882 # pin@v4 if: always() with: - name: coverage_report.tgz - path: ./target/grcov-target/coverage_report.tgz + name: grcov-html + path: ./target/grcov/html if-no-files-found: error - retention-days: 30 - - - name: Clean up coverage artifacts - run: | - if [ -d "./target/grcov-target" ]; then - rm -rf ./target/grcov-target - echo "Cleaned up coverage artifacts" - fi - - \ No newline at end of file + retention-days: 7 diff --git a/scripts/simtest/codecov.sh b/scripts/simtest/codecov.sh index 08d3dec079d..d3d25759edf 100755 --- a/scripts/simtest/codecov.sh +++ b/scripts/simtest/codecov.sh @@ -16,7 +16,9 @@ git apply ./scripts/simtest/config-patch root_dir=$(git rev-parse --show-toplevel) export SIMTEST_STATIC_INIT_MOVE=$root_dir"/examples/move/basics" -MSIM_WATCHDOG_TIMEOUT_MS=60000 MSIM_TEST_SEED=1 cargo llvm-cov --ignore-run-fail --lcov --output-path lcov-simtest.info nextest --cargo-profile simulator +cargo llvm-cov clean + +MSIM_WATCHDOG_TIMEOUT_MS=60000 MSIM_TEST_SEED=1 cargo llvm-cov --all-features --branch --ignore-run-fail --html nextest --cargo-profile simulator # remove the patch git checkout .cargo/config Cargo.toml Cargo.lock From c9b36b31af094e65071242104ffa33768895c1c1 Mon Sep 17 00:00:00 2001 From: Alexander Schmidt Date: Tue, 29 Oct 2024 14:01:46 +0100 Subject: [PATCH 017/124] nightly why not --- .github/workflows/cargo-llvm-cov.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/cargo-llvm-cov.yml b/.github/workflows/cargo-llvm-cov.yml index 52653faf8b7..23e7a8dfcb3 100644 --- a/.github/workflows/cargo-llvm-cov.yml +++ b/.github/workflows/cargo-llvm-cov.yml @@ -49,10 +49,10 @@ jobs: - name: Update Rust toolchain run: rustup update stable - - name: Generate code coverage (from nextest) # ./target/llvm-cov/html + - name: Generate code coverage (nextest) # ./target/llvm-cov/html run: | cargo llvm-cov clean - IOTA_SKIP_SIMTESTS=1 cargo llvm-cov --all-features --branch --ignore-run-fail --html nextest + IOTA_SKIP_SIMTESTS=1 cargo +nightly llvm-cov --all-features --branch --ignore-run-fail --html nextest - name: Upload coverage report (nextest) uses: actions/upload-artifact@b4b15b8c7c6ac21ea08fcf65892d2ee8f75cf882 # pin@v4 From 2eb87465c2ac674d061eb9b42d59085dc4f55097 Mon Sep 17 00:00:00 2001 From: Alexander Schmidt Date: Tue, 29 Oct 2024 16:57:00 +0100 Subject: [PATCH 018/124] archive html coverage report --- .github/workflows/cargo-llvm-cov.yml | 34 ++++++++++------------------ 1 file changed, 12 insertions(+), 22 deletions(-) diff --git a/.github/workflows/cargo-llvm-cov.yml b/.github/workflows/cargo-llvm-cov.yml index 23e7a8dfcb3..06b6e058456 100644 --- a/.github/workflows/cargo-llvm-cov.yml +++ b/.github/workflows/cargo-llvm-cov.yml @@ -49,31 +49,21 @@ jobs: - name: Update Rust toolchain run: rustup update stable - - name: Generate code coverage (nextest) # ./target/llvm-cov/html + - name: Generate code coverage (nextest) run: | cargo llvm-cov clean - IOTA_SKIP_SIMTESTS=1 cargo +nightly llvm-cov --all-features --branch --ignore-run-fail --html nextest + RUSTFLAGS="-C debuginfo=0" IOTA_SKIP_SIMTESTS=1 cargo llvm-cov --ignore-run-fail --html nextest -vv -E '!package(iota-bridge)' - - name: Upload coverage report (nextest) - uses: actions/upload-artifact@b4b15b8c7c6ac21ea08fcf65892d2ee8f75cf882 # pin@v4 - if: always() - with: - name: llvm-cov-nextest-html - path: target/llvm-cov/html - if-no-files-found: error - retention-days: 7 - - - name: Run code coverage (simtest) + - name: Create compressed archive run: | - git clean -fd - ./scripts/simtest/codecov.sh + tar -czf nextest_coverage_report.tgz target/llvm-cov/html/ - - name: Upload coverage report (simtest) - uses: actions/upload-artifact@b4b15b8c7c6ac21ea08fcf65892d2ee8f75cf882 # pin@v4 - if: always() - with: - name: llvm-cov-simtest-html - path: target/llvm-cov/html - if-no-files-found: error - retention-days: 7 + # Temporarily disabled until sim tests are no longer segfaulting + # - name: Run code coverage (simtest) + # run: | + # git clean -fd + # ./scripts/simtest/codecov.sh + # - name: Create compressed archive + # run: | + # tar -czf simtest_coverage_report.tgz target/llvm-cov/html/ From 01876b678ca7240b4711885819fe5113862b19c2 Mon Sep 17 00:00:00 2001 From: Alexander Schmidt Date: Wed, 30 Oct 2024 10:39:31 +0100 Subject: [PATCH 019/124] test archiving --- .github/workflows/cargo-llvm-cov.yml | 35 +++++++++++++++++++++------- scripts/simtest/codecov.sh | 2 +- 2 files changed, 28 insertions(+), 9 deletions(-) diff --git a/.github/workflows/cargo-llvm-cov.yml b/.github/workflows/cargo-llvm-cov.yml index 06b6e058456..1ca38e94d4c 100644 --- a/.github/workflows/cargo-llvm-cov.yml +++ b/.github/workflows/cargo-llvm-cov.yml @@ -58,12 +58,31 @@ jobs: run: | tar -czf nextest_coverage_report.tgz target/llvm-cov/html/ - # Temporarily disabled until sim tests are no longer segfaulting - # - name: Run code coverage (simtest) - # run: | - # git clean -fd - # ./scripts/simtest/codecov.sh + # TEMP + - name: Upload coverage report + uses: actions/upload-artifact@b4b15b8c7c6ac21ea08fcf65892d2ee8f75cf882 # pin@v4 + if: always() + with: + name: nextest_coverage_report.tgz + path: . + if-no-files-found: error + retention-days: 1 - # - name: Create compressed archive - # run: | - # tar -czf simtest_coverage_report.tgz target/llvm-cov/html/ + - name: Run code coverage (simtest) + run: | + git clean -fd + ./scripts/simtest/codecov.sh + + - name: Create compressed archive + run: | + tar -czf simtest_coverage_report.tgz target/llvm-cov/html/ + + # TEMP + - name: Upload coverage report + uses: actions/upload-artifact@b4b15b8c7c6ac21ea08fcf65892d2ee8f75cf882 # pin@v4 + if: always() + with: + name: simtest_coverage_report.tgz + path: . + if-no-files-found: error + retention-days: 1 diff --git a/scripts/simtest/codecov.sh b/scripts/simtest/codecov.sh index d3d25759edf..c7405a42e56 100755 --- a/scripts/simtest/codecov.sh +++ b/scripts/simtest/codecov.sh @@ -18,7 +18,7 @@ export SIMTEST_STATIC_INIT_MOVE=$root_dir"/examples/move/basics" cargo llvm-cov clean -MSIM_WATCHDOG_TIMEOUT_MS=60000 MSIM_TEST_SEED=1 cargo llvm-cov --all-features --branch --ignore-run-fail --html nextest --cargo-profile simulator +RUSTFLAGS="-C debuginfo=0" MSIM_WATCHDOG_TIMEOUT_MS=60000 MSIM_TEST_SEED=1 cargo llvm-cov --ignore-run-fail --html nextest --cargo-profile simulator # remove the patch git checkout .cargo/config Cargo.toml Cargo.lock From 41e70949a6225b2d4b168e6b1d03485ab8f80bea Mon Sep 17 00:00:00 2001 From: Alexander Schmidt Date: Wed, 30 Oct 2024 11:57:31 +0100 Subject: [PATCH 020/124] restructure --- .github/workflows/cargo_llvm_cov.yml | 45 ++++++++++++++++++---------- 1 file changed, 30 insertions(+), 15 deletions(-) diff --git a/.github/workflows/cargo_llvm_cov.yml b/.github/workflows/cargo_llvm_cov.yml index 1ca38e94d4c..92538b2275d 100644 --- a/.github/workflows/cargo_llvm_cov.yml +++ b/.github/workflows/cargo_llvm_cov.yml @@ -30,9 +30,9 @@ env: RUSTDOCFLAGS: -D warnings jobs: - llvm-cov: - name: Generate code coverage (llvm-cov) - runs-on: [self-hosted] + llvm-cov-nextest: + name: Generate code coverage (nextest) + runs-on: self-hosted timeout-minutes: 120 env: CARGO_TERM_COLOR: always @@ -49,40 +49,55 @@ jobs: - name: Update Rust toolchain run: rustup update stable - - name: Generate code coverage (nextest) + - name: Generate code coverage run: | cargo llvm-cov clean RUSTFLAGS="-C debuginfo=0" IOTA_SKIP_SIMTESTS=1 cargo llvm-cov --ignore-run-fail --html nextest -vv -E '!package(iota-bridge)' - - name: Create compressed archive - run: | - tar -czf nextest_coverage_report.tgz target/llvm-cov/html/ + report-nextest: + name: Upload report (nextest) + needs: llvm-cov-nextest + runs-on: self-hosted + if: always() + steps: + - name: Pack report + run: tar -czvf nextest_coverage_report.tgz target/llvm-cov/html/ # TEMP - - name: Upload coverage report + - name: Upload report uses: actions/upload-artifact@b4b15b8c7c6ac21ea08fcf65892d2ee8f75cf882 # pin@v4 if: always() with: name: nextest_coverage_report.tgz - path: . + path: ./nextest_coverage_report.tgz if-no-files-found: error retention-days: 1 - - name: Run code coverage (simtest) + llvm-cov-simtest: + name: Generate code coverage (simtest) + needs: report-nextest + runs-on: self-hosted + steps: + - name: Generate code coverage run: | git clean -fd ./scripts/simtest/codecov.sh - - name: Create compressed archive - run: | - tar -czf simtest_coverage_report.tgz target/llvm-cov/html/ + report-simtest: + name: Upload report (simtest) + needs: llvm-cov-simtest + runs-on: self-hosted + if: always() + steps: + - name: Pack report + run: tar -czvf simtest_coverage_report.tgz target/llvm-cov/html/ # TEMP - - name: Upload coverage report + - name: Upload report uses: actions/upload-artifact@b4b15b8c7c6ac21ea08fcf65892d2ee8f75cf882 # pin@v4 if: always() with: name: simtest_coverage_report.tgz - path: . + path: ./simtest_coverage_report.tgz if-no-files-found: error retention-days: 1 From 716dd4c2907dfc3970df882ee07758ecef60217c Mon Sep 17 00:00:00 2001 From: Alexander Schmidt Date: Wed, 30 Oct 2024 13:55:40 +0100 Subject: [PATCH 021/124] try release build --- .github/workflows/cargo_llvm_cov.yml | 4 +--- scripts/simtest/codecov.sh | 2 +- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/.github/workflows/cargo_llvm_cov.yml b/.github/workflows/cargo_llvm_cov.yml index 92538b2275d..76e034aa086 100644 --- a/.github/workflows/cargo_llvm_cov.yml +++ b/.github/workflows/cargo_llvm_cov.yml @@ -52,13 +52,12 @@ jobs: - name: Generate code coverage run: | cargo llvm-cov clean - RUSTFLAGS="-C debuginfo=0" IOTA_SKIP_SIMTESTS=1 cargo llvm-cov --ignore-run-fail --html nextest -vv -E '!package(iota-bridge)' + RUSTFLAGS="-C debuginfo=0" IOTA_SKIP_SIMTESTS=1 cargo llvm-cov --release --ignore-run-fail --html nextest -vv -E '!package(iota-bridge)' report-nextest: name: Upload report (nextest) needs: llvm-cov-nextest runs-on: self-hosted - if: always() steps: - name: Pack report run: tar -czvf nextest_coverage_report.tgz target/llvm-cov/html/ @@ -87,7 +86,6 @@ jobs: name: Upload report (simtest) needs: llvm-cov-simtest runs-on: self-hosted - if: always() steps: - name: Pack report run: tar -czvf simtest_coverage_report.tgz target/llvm-cov/html/ diff --git a/scripts/simtest/codecov.sh b/scripts/simtest/codecov.sh index c7405a42e56..53f99e09d7a 100755 --- a/scripts/simtest/codecov.sh +++ b/scripts/simtest/codecov.sh @@ -18,7 +18,7 @@ export SIMTEST_STATIC_INIT_MOVE=$root_dir"/examples/move/basics" cargo llvm-cov clean -RUSTFLAGS="-C debuginfo=0" MSIM_WATCHDOG_TIMEOUT_MS=60000 MSIM_TEST_SEED=1 cargo llvm-cov --ignore-run-fail --html nextest --cargo-profile simulator +RUSTFLAGS="-C debuginfo=0" MSIM_WATCHDOG_TIMEOUT_MS=60000 MSIM_TEST_SEED=1 cargo llvm-cov --release --ignore-run-fail --html nextest --cargo-profile simulator # remove the patch git checkout .cargo/config Cargo.toml Cargo.lock From 4ea7fe9de1f49bb8f846e157775e63f1a91ef2e0 Mon Sep 17 00:00:00 2001 From: Alexander Schmidt Date: Wed, 30 Oct 2024 15:03:25 +0100 Subject: [PATCH 022/124] undo release build, undo restructure --- .github/workflows/cargo_llvm_cov.yml | 25 ++++--------------------- scripts/simtest/codecov.sh | 2 +- 2 files changed, 5 insertions(+), 22 deletions(-) diff --git a/.github/workflows/cargo_llvm_cov.yml b/.github/workflows/cargo_llvm_cov.yml index 76e034aa086..5997844bfd7 100644 --- a/.github/workflows/cargo_llvm_cov.yml +++ b/.github/workflows/cargo_llvm_cov.yml @@ -52,48 +52,31 @@ jobs: - name: Generate code coverage run: | cargo llvm-cov clean - RUSTFLAGS="-C debuginfo=0" IOTA_SKIP_SIMTESTS=1 cargo llvm-cov --release --ignore-run-fail --html nextest -vv -E '!package(iota-bridge)' + IOTA_SKIP_SIMTESTS=1 cargo llvm-cov --ignore-run-fail --html nextest -vv -E '!package(iota-bridge)' - report-nextest: - name: Upload report (nextest) - needs: llvm-cov-nextest - runs-on: self-hosted - steps: - name: Pack report run: tar -czvf nextest_coverage_report.tgz target/llvm-cov/html/ # TEMP - name: Upload report uses: actions/upload-artifact@b4b15b8c7c6ac21ea08fcf65892d2ee8f75cf882 # pin@v4 - if: always() with: name: nextest_coverage_report.tgz path: ./nextest_coverage_report.tgz if-no-files-found: error retention-days: 1 - llvm-cov-simtest: - name: Generate code coverage (simtest) - needs: report-nextest - runs-on: self-hosted - steps: - - name: Generate code coverage + - name: Generate code coverage (simtest) run: | git clean -fd ./scripts/simtest/codecov.sh - report-simtest: - name: Upload report (simtest) - needs: llvm-cov-simtest - runs-on: self-hosted - steps: - - name: Pack report + - name: Pack report (simtest) run: tar -czvf simtest_coverage_report.tgz target/llvm-cov/html/ # TEMP - - name: Upload report + - name: Upload report (simtest) uses: actions/upload-artifact@b4b15b8c7c6ac21ea08fcf65892d2ee8f75cf882 # pin@v4 - if: always() with: name: simtest_coverage_report.tgz path: ./simtest_coverage_report.tgz diff --git a/scripts/simtest/codecov.sh b/scripts/simtest/codecov.sh index 53f99e09d7a..6ea0f24a891 100755 --- a/scripts/simtest/codecov.sh +++ b/scripts/simtest/codecov.sh @@ -18,7 +18,7 @@ export SIMTEST_STATIC_INIT_MOVE=$root_dir"/examples/move/basics" cargo llvm-cov clean -RUSTFLAGS="-C debuginfo=0" MSIM_WATCHDOG_TIMEOUT_MS=60000 MSIM_TEST_SEED=1 cargo llvm-cov --release --ignore-run-fail --html nextest --cargo-profile simulator +MSIM_WATCHDOG_TIMEOUT_MS=60000 MSIM_TEST_SEED=1 cargo llvm-cov --ignore-run-fail --html nextest --cargo-profile simulator # remove the patch git checkout .cargo/config Cargo.toml Cargo.lock From 344a3b689eae6fa27d2d6d6279370480804e2ee6 Mon Sep 17 00:00:00 2001 From: Alexander Schmidt Date: Wed, 30 Oct 2024 17:22:28 +0100 Subject: [PATCH 023/124] try the hippie --- .github/workflows/cargo_llvm_cov.yml | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/.github/workflows/cargo_llvm_cov.yml b/.github/workflows/cargo_llvm_cov.yml index 5997844bfd7..e26cba773e5 100644 --- a/.github/workflows/cargo_llvm_cov.yml +++ b/.github/workflows/cargo_llvm_cov.yml @@ -46,16 +46,21 @@ jobs: - name: Install nextest uses: taiki-e/install-action@7e58f89e24a544d88f7a74c6eed8a3df3fd4c658 # pin@nextest + - name: Set Swap Space + uses: actionhippie/swap-space@v1 + with: + size: 256G + - name: Update Rust toolchain run: rustup update stable - name: Generate code coverage run: | cargo llvm-cov clean - IOTA_SKIP_SIMTESTS=1 cargo llvm-cov --ignore-run-fail --html nextest -vv -E '!package(iota-bridge)' + IOTA_SKIP_SIMTESTS=1 cargo +nightly llvm-cov --ignore-run-fail --branch --html nextest -vv -E '!package(iota-bridge)' - name: Pack report - run: tar -czvf nextest_coverage_report.tgz target/llvm-cov/html/ + run: cd target/llvm-cov && tar -czvf nextest_coverage_report.tgz ./html/ # TEMP - name: Upload report @@ -72,7 +77,7 @@ jobs: ./scripts/simtest/codecov.sh - name: Pack report (simtest) - run: tar -czvf simtest_coverage_report.tgz target/llvm-cov/html/ + run: cd target/llvm-cov && tar -czvf simtest_coverage_report.tgz ./html/ # TEMP - name: Upload report (simtest) From 07e005b06765bcd7b18869b92be697c6c90cce6f Mon Sep 17 00:00:00 2001 From: Alexander Schmidt Date: Wed, 30 Oct 2024 18:12:28 +0100 Subject: [PATCH 024/124] fix path; include branch coverage again --- .github/workflows/cargo_llvm_cov.yml | 8 ++++---- scripts/simtest/codecov.sh | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/.github/workflows/cargo_llvm_cov.yml b/.github/workflows/cargo_llvm_cov.yml index e26cba773e5..fb157913f9f 100644 --- a/.github/workflows/cargo_llvm_cov.yml +++ b/.github/workflows/cargo_llvm_cov.yml @@ -60,14 +60,14 @@ jobs: IOTA_SKIP_SIMTESTS=1 cargo +nightly llvm-cov --ignore-run-fail --branch --html nextest -vv -E '!package(iota-bridge)' - name: Pack report - run: cd target/llvm-cov && tar -czvf nextest_coverage_report.tgz ./html/ + run: cd target/llvm-cov/html && tar -czvf ../nextest_coverage_report.tgz ./ # TEMP - name: Upload report uses: actions/upload-artifact@b4b15b8c7c6ac21ea08fcf65892d2ee8f75cf882 # pin@v4 with: name: nextest_coverage_report.tgz - path: ./nextest_coverage_report.tgz + path: ./target/llvm-cov/nextest_coverage_report.tgz if-no-files-found: error retention-days: 1 @@ -77,13 +77,13 @@ jobs: ./scripts/simtest/codecov.sh - name: Pack report (simtest) - run: cd target/llvm-cov && tar -czvf simtest_coverage_report.tgz ./html/ + run: cd target/llvm-cov/html && tar -czvf ../simtest_coverage_report.tgz ./ # TEMP - name: Upload report (simtest) uses: actions/upload-artifact@b4b15b8c7c6ac21ea08fcf65892d2ee8f75cf882 # pin@v4 with: name: simtest_coverage_report.tgz - path: ./simtest_coverage_report.tgz + path: ./target/llvm-cov/simtest_coverage_report.tgz if-no-files-found: error retention-days: 1 diff --git a/scripts/simtest/codecov.sh b/scripts/simtest/codecov.sh index 6ea0f24a891..0d628954879 100755 --- a/scripts/simtest/codecov.sh +++ b/scripts/simtest/codecov.sh @@ -18,7 +18,7 @@ export SIMTEST_STATIC_INIT_MOVE=$root_dir"/examples/move/basics" cargo llvm-cov clean -MSIM_WATCHDOG_TIMEOUT_MS=60000 MSIM_TEST_SEED=1 cargo llvm-cov --ignore-run-fail --html nextest --cargo-profile simulator +MSIM_WATCHDOG_TIMEOUT_MS=60000 MSIM_TEST_SEED=1 cargo +nightly llvm-cov --ignore-run-fail --branch --html nextest --cargo-profile simulator # remove the patch git checkout .cargo/config Cargo.toml Cargo.lock From e4a587e6cfd55070bb213b4f8ddebd32a59c3ce7 Mon Sep 17 00:00:00 2001 From: Alexander Schmidt Date: Wed, 30 Oct 2024 21:21:25 +0100 Subject: [PATCH 025/124] only simtests one-by-one --- .github/workflows/cargo_llvm_cov.yml | 28 ++++++++++++++-------------- scripts/simtest/codecov.sh | 2 +- 2 files changed, 15 insertions(+), 15 deletions(-) diff --git a/.github/workflows/cargo_llvm_cov.yml b/.github/workflows/cargo_llvm_cov.yml index fb157913f9f..d0c6a5791e3 100644 --- a/.github/workflows/cargo_llvm_cov.yml +++ b/.github/workflows/cargo_llvm_cov.yml @@ -54,22 +54,22 @@ jobs: - name: Update Rust toolchain run: rustup update stable - - name: Generate code coverage - run: | - cargo llvm-cov clean - IOTA_SKIP_SIMTESTS=1 cargo +nightly llvm-cov --ignore-run-fail --branch --html nextest -vv -E '!package(iota-bridge)' + # - name: Generate code coverage + # run: | + # cargo llvm-cov clean + # IOTA_SKIP_SIMTESTS=1 cargo +nightly llvm-cov --ignore-run-fail --branch --html nextest -vv -E '!package(iota-bridge)' - - name: Pack report - run: cd target/llvm-cov/html && tar -czvf ../nextest_coverage_report.tgz ./ + # - name: Pack report + # run: cd target/llvm-cov/html && tar -czvf ../nextest_coverage_report.tgz ./ - # TEMP - - name: Upload report - uses: actions/upload-artifact@b4b15b8c7c6ac21ea08fcf65892d2ee8f75cf882 # pin@v4 - with: - name: nextest_coverage_report.tgz - path: ./target/llvm-cov/nextest_coverage_report.tgz - if-no-files-found: error - retention-days: 1 + # # TEMP + # - name: Upload report + # uses: actions/upload-artifact@b4b15b8c7c6ac21ea08fcf65892d2ee8f75cf882 # pin@v4 + # with: + # name: nextest_coverage_report.tgz + # path: ./target/llvm-cov/nextest_coverage_report.tgz + # if-no-files-found: error + # retention-days: 1 - name: Generate code coverage (simtest) run: | diff --git a/scripts/simtest/codecov.sh b/scripts/simtest/codecov.sh index 0d628954879..4c4b2d90462 100755 --- a/scripts/simtest/codecov.sh +++ b/scripts/simtest/codecov.sh @@ -18,7 +18,7 @@ export SIMTEST_STATIC_INIT_MOVE=$root_dir"/examples/move/basics" cargo llvm-cov clean -MSIM_WATCHDOG_TIMEOUT_MS=60000 MSIM_TEST_SEED=1 cargo +nightly llvm-cov --ignore-run-fail --branch --html nextest --cargo-profile simulator +MSIM_WATCHDOG_TIMEOUT_MS=60000 MSIM_TEST_SEED=1 cargo +nightly llvm-cov --ignore-run-fail --branch --html nextest --cargo-profile simulator --test-threads 1 # remove the patch git checkout .cargo/config Cargo.toml Cargo.lock From 41c09c6716568e3787cab4a1aefa10081ea57d8c Mon Sep 17 00:00:00 2001 From: Alexander Schmidt Date: Wed, 30 Oct 2024 21:32:50 +0100 Subject: [PATCH 026/124] only simtests one-by-one 2; increase retries --- .config/nextest.toml | 4 +++- scripts/simtest/codecov.sh | 2 +- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/.config/nextest.toml b/.config/nextest.toml index ac86fb09cfb..d1d2c198cdd 100644 --- a/.config/nextest.toml +++ b/.config/nextest.toml @@ -8,9 +8,11 @@ failure-output = "immediate" # Show skipped tests in the CI output. status-level = "skip" # Retry failing tests in order to not block builds on flaky tests -retries = 1 +retries = 3 # Timeout tests after 4 minutes slow-timeout = { period = "60s", terminate-after = 4 } +# temporary +test-threads = 1 [profile.simtestnightly] # Print out output for failing tests as soon as they fail, and also at the end diff --git a/scripts/simtest/codecov.sh b/scripts/simtest/codecov.sh index 4c4b2d90462..0d628954879 100755 --- a/scripts/simtest/codecov.sh +++ b/scripts/simtest/codecov.sh @@ -18,7 +18,7 @@ export SIMTEST_STATIC_INIT_MOVE=$root_dir"/examples/move/basics" cargo llvm-cov clean -MSIM_WATCHDOG_TIMEOUT_MS=60000 MSIM_TEST_SEED=1 cargo +nightly llvm-cov --ignore-run-fail --branch --html nextest --cargo-profile simulator --test-threads 1 +MSIM_WATCHDOG_TIMEOUT_MS=60000 MSIM_TEST_SEED=1 cargo +nightly llvm-cov --ignore-run-fail --branch --html nextest --cargo-profile simulator # remove the patch git checkout .cargo/config Cargo.toml Cargo.lock From 701611246efcf0183a6e942f3afc154284f7dce3 Mon Sep 17 00:00:00 2001 From: Alexander Schmidt Date: Thu, 31 Oct 2024 11:03:40 +0100 Subject: [PATCH 027/124] exclude segfaulting crates from coverage --- .github/workflows/cargo_llvm_cov.yml | 2 +- scripts/simtest/codecov.sh | 6 +++++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/.github/workflows/cargo_llvm_cov.yml b/.github/workflows/cargo_llvm_cov.yml index d0c6a5791e3..ffeaa6063af 100644 --- a/.github/workflows/cargo_llvm_cov.yml +++ b/.github/workflows/cargo_llvm_cov.yml @@ -57,7 +57,7 @@ jobs: # - name: Generate code coverage # run: | # cargo llvm-cov clean - # IOTA_SKIP_SIMTESTS=1 cargo +nightly llvm-cov --ignore-run-fail --branch --html nextest -vv -E '!package(iota-bridge)' + # IOTA_SKIP_SIMTESTS=1 cargo +nightly llvm-cov --ignore-run-fail --branch --html nextest -vv # - name: Pack report # run: cd target/llvm-cov/html && tar -czvf ../nextest_coverage_report.tgz ./ diff --git a/scripts/simtest/codecov.sh b/scripts/simtest/codecov.sh index 0d628954879..9ae9e87c3a4 100755 --- a/scripts/simtest/codecov.sh +++ b/scripts/simtest/codecov.sh @@ -18,7 +18,11 @@ export SIMTEST_STATIC_INIT_MOVE=$root_dir"/examples/move/basics" cargo llvm-cov clean -MSIM_WATCHDOG_TIMEOUT_MS=60000 MSIM_TEST_SEED=1 cargo +nightly llvm-cov --ignore-run-fail --branch --html nextest --cargo-profile simulator +MSIM_WATCHDOG_TIMEOUT_MS=60000 MSIM_TEST_SEED=1 cargo +nightly llvm-cov --ignore-run-fail --branch --html nextest \ + --cargo-profile simulator \ + -vv \ + -E '!package(iota-e2e-tests)' \ + -E '!package(iota-json-rpc-tests)' # remove the patch git checkout .cargo/config Cargo.toml Cargo.lock From fe2d008feb5a8b619a5a3b7da725c84eacb1ced4 Mon Sep 17 00:00:00 2001 From: Alexander Schmidt Date: Thu, 31 Oct 2024 12:33:12 +0100 Subject: [PATCH 028/124] really exclude segfaulting crates --- .github/workflows/cargo_llvm_cov.yml | 2 -- scripts/simtest/codecov.sh | 6 +++--- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/.github/workflows/cargo_llvm_cov.yml b/.github/workflows/cargo_llvm_cov.yml index ffeaa6063af..bbe651617a0 100644 --- a/.github/workflows/cargo_llvm_cov.yml +++ b/.github/workflows/cargo_llvm_cov.yml @@ -62,7 +62,6 @@ jobs: # - name: Pack report # run: cd target/llvm-cov/html && tar -czvf ../nextest_coverage_report.tgz ./ - # # TEMP # - name: Upload report # uses: actions/upload-artifact@b4b15b8c7c6ac21ea08fcf65892d2ee8f75cf882 # pin@v4 # with: @@ -79,7 +78,6 @@ jobs: - name: Pack report (simtest) run: cd target/llvm-cov/html && tar -czvf ../simtest_coverage_report.tgz ./ - # TEMP - name: Upload report (simtest) uses: actions/upload-artifact@b4b15b8c7c6ac21ea08fcf65892d2ee8f75cf882 # pin@v4 with: diff --git a/scripts/simtest/codecov.sh b/scripts/simtest/codecov.sh index 9ae9e87c3a4..89a518cf0b3 100755 --- a/scripts/simtest/codecov.sh +++ b/scripts/simtest/codecov.sh @@ -20,9 +20,9 @@ cargo llvm-cov clean MSIM_WATCHDOG_TIMEOUT_MS=60000 MSIM_TEST_SEED=1 cargo +nightly llvm-cov --ignore-run-fail --branch --html nextest \ --cargo-profile simulator \ - -vv \ - -E '!package(iota-e2e-tests)' \ - -E '!package(iota-json-rpc-tests)' + --exclude iota-e2e-tests \ + --exclude iota-json-rpc-tests \ + --exclude iota-faucet # remove the patch git checkout .cargo/config Cargo.toml Cargo.lock From 92e4b16bf5677098b84b049b16c65241c948b515 Mon Sep 17 00:00:00 2001 From: Alexander Schmidt Date: Thu, 31 Oct 2024 12:36:43 +0100 Subject: [PATCH 029/124] bad docs --- scripts/simtest/codecov.sh | 1 + 1 file changed, 1 insertion(+) diff --git a/scripts/simtest/codecov.sh b/scripts/simtest/codecov.sh index 89a518cf0b3..31e2ca78b14 100755 --- a/scripts/simtest/codecov.sh +++ b/scripts/simtest/codecov.sh @@ -20,6 +20,7 @@ cargo llvm-cov clean MSIM_WATCHDOG_TIMEOUT_MS=60000 MSIM_TEST_SEED=1 cargo +nightly llvm-cov --ignore-run-fail --branch --html nextest \ --cargo-profile simulator \ + --workspace \ --exclude iota-e2e-tests \ --exclude iota-json-rpc-tests \ --exclude iota-faucet From 5630216200d2ec5513ea83437d2c08d9c48dd368 Mon Sep 17 00:00:00 2001 From: Alexander Schmidt Date: Thu, 31 Oct 2024 12:38:24 +0100 Subject: [PATCH 030/124] disable swap --- .github/workflows/cargo_llvm_cov.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/cargo_llvm_cov.yml b/.github/workflows/cargo_llvm_cov.yml index bbe651617a0..feab5645f79 100644 --- a/.github/workflows/cargo_llvm_cov.yml +++ b/.github/workflows/cargo_llvm_cov.yml @@ -46,10 +46,10 @@ jobs: - name: Install nextest uses: taiki-e/install-action@7e58f89e24a544d88f7a74c6eed8a3df3fd4c658 # pin@nextest - - name: Set Swap Space - uses: actionhippie/swap-space@v1 - with: - size: 256G + # - name: Set Swap Space + # uses: actionhippie/swap-space@v1 + # with: + # size: 256G - name: Update Rust toolchain run: rustup update stable From 9d6c8dbadfb41a729df1296400d678398d99a196 Mon Sep 17 00:00:00 2001 From: Alexander Schmidt Date: Thu, 31 Oct 2024 13:20:07 +0100 Subject: [PATCH 031/124] ensure report creation --- .config/nextest.toml | 4 +--- .github/workflows/cargo_llvm_cov.yml | 16 ++++++++++++++-- 2 files changed, 15 insertions(+), 5 deletions(-) diff --git a/.config/nextest.toml b/.config/nextest.toml index d1d2c198cdd..ac86fb09cfb 100644 --- a/.config/nextest.toml +++ b/.config/nextest.toml @@ -8,11 +8,9 @@ failure-output = "immediate" # Show skipped tests in the CI output. status-level = "skip" # Retry failing tests in order to not block builds on flaky tests -retries = 3 +retries = 1 # Timeout tests after 4 minutes slow-timeout = { period = "60s", terminate-after = 4 } -# temporary -test-threads = 1 [profile.simtestnightly] # Print out output for failing tests as soon as they fail, and also at the end diff --git a/.github/workflows/cargo_llvm_cov.yml b/.github/workflows/cargo_llvm_cov.yml index feab5645f79..7b21b811c7d 100644 --- a/.github/workflows/cargo_llvm_cov.yml +++ b/.github/workflows/cargo_llvm_cov.yml @@ -60,7 +60,13 @@ jobs: # IOTA_SKIP_SIMTESTS=1 cargo +nightly llvm-cov --ignore-run-fail --branch --html nextest -vv # - name: Pack report - # run: cd target/llvm-cov/html && tar -czvf ../nextest_coverage_report.tgz ./ + # if: always() + # run: | + # if [ ! -d "target/llvm-cov/html" ]; then + # echo "Error: No coverage report created in previous step." + # exit 1 + # fi + # cd target/llvm-cov/html && tar -czvf ../nextest_coverage_report.tgz ./ # - name: Upload report # uses: actions/upload-artifact@b4b15b8c7c6ac21ea08fcf65892d2ee8f75cf882 # pin@v4 @@ -76,7 +82,13 @@ jobs: ./scripts/simtest/codecov.sh - name: Pack report (simtest) - run: cd target/llvm-cov/html && tar -czvf ../simtest_coverage_report.tgz ./ + if: always() + run: | + if [ ! -d "target/llvm-cov/html" ]; then + echo "Error: No coverage report created in previous step." + exit 1 + fi + cd target/llvm-cov/html && tar -czvf ../simtest_coverage_report.tgz ./ - name: Upload report (simtest) uses: actions/upload-artifact@b4b15b8c7c6ac21ea08fcf65892d2ee8f75cf882 # pin@v4 From c2ed8730118c114d5ebf37c47b6a8f6ab5903525 Mon Sep 17 00:00:00 2001 From: Alexander Schmidt Date: Thu, 31 Oct 2024 14:12:12 +0100 Subject: [PATCH 032/124] force success if report was generated --- .github/workflows/cargo_llvm_cov.yml | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/.github/workflows/cargo_llvm_cov.yml b/.github/workflows/cargo_llvm_cov.yml index 7b21b811c7d..ed56f26a06d 100644 --- a/.github/workflows/cargo_llvm_cov.yml +++ b/.github/workflows/cargo_llvm_cov.yml @@ -79,16 +79,17 @@ jobs: - name: Generate code coverage (simtest) run: | git clean -fd + set +e ./scripts/simtest/codecov.sh - - - name: Pack report (simtest) - if: always() - run: | - if [ ! -d "target/llvm-cov/html" ]; then - echo "Error: No coverage report created in previous step." + if [ -d "target/llvm-cov/html" ]; then + exit 0 + else + echo "Fatal Error: Failed to create coverage report." exit 1 fi - cd target/llvm-cov/html && tar -czvf ../simtest_coverage_report.tgz ./ + + - name: Pack report (simtest) + run: cd target/llvm-cov/html && tar -czvf ../simtest_coverage_report.tgz ./ - name: Upload report (simtest) uses: actions/upload-artifact@b4b15b8c7c6ac21ea08fcf65892d2ee8f75cf882 # pin@v4 From c88c6690c81519343ae48377a3b22fcc36d1107e Mon Sep 17 00:00:00 2001 From: Alexander Schmidt Date: Thu, 31 Oct 2024 15:08:55 +0100 Subject: [PATCH 033/124] clean up the mess --- .github/workflows/cargo_llvm_cov.yml | 40 +++++++++++++++------------- scripts/simtest/codecov.sh | 9 +------ 2 files changed, 22 insertions(+), 27 deletions(-) diff --git a/.github/workflows/cargo_llvm_cov.yml b/.github/workflows/cargo_llvm_cov.yml index ed56f26a06d..9c9c03875e6 100644 --- a/.github/workflows/cargo_llvm_cov.yml +++ b/.github/workflows/cargo_llvm_cov.yml @@ -54,31 +54,33 @@ jobs: - name: Update Rust toolchain run: rustup update stable - # - name: Generate code coverage - # run: | - # cargo llvm-cov clean - # IOTA_SKIP_SIMTESTS=1 cargo +nightly llvm-cov --ignore-run-fail --branch --html nextest -vv + - name: Generate code coverage + run: | + cargo llvm-cov clean + set +e + IOTA_SKIP_SIMTESTS=1 cargo +nightly llvm-cov --ignore-run-fail --branch --html nextest + if [ -d "target/llvm-cov/html" ]; then + exit 0 + else + echo "Fatal Error: Failed to create coverage report." + exit 1 + fi - # - name: Pack report - # if: always() - # run: | - # if [ ! -d "target/llvm-cov/html" ]; then - # echo "Error: No coverage report created in previous step." - # exit 1 - # fi - # cd target/llvm-cov/html && tar -czvf ../nextest_coverage_report.tgz ./ + - name: Pack report + run: cd target/llvm-cov/html && tar -czvf ../nextest_coverage_report.tgz ./ - # - name: Upload report - # uses: actions/upload-artifact@b4b15b8c7c6ac21ea08fcf65892d2ee8f75cf882 # pin@v4 - # with: - # name: nextest_coverage_report.tgz - # path: ./target/llvm-cov/nextest_coverage_report.tgz - # if-no-files-found: error - # retention-days: 1 + - name: Upload report + uses: actions/upload-artifact@b4b15b8c7c6ac21ea08fcf65892d2ee8f75cf882 # pin@v4 + with: + name: nextest_coverage_report.tgz + path: ./target/llvm-cov/nextest_coverage_report.tgz + if-no-files-found: error + retention-days: 1 - name: Generate code coverage (simtest) run: | git clean -fd + cargo llvm-cov clean set +e ./scripts/simtest/codecov.sh if [ -d "target/llvm-cov/html" ]; then diff --git a/scripts/simtest/codecov.sh b/scripts/simtest/codecov.sh index 31e2ca78b14..c8aba0a6ac8 100755 --- a/scripts/simtest/codecov.sh +++ b/scripts/simtest/codecov.sh @@ -16,14 +16,7 @@ git apply ./scripts/simtest/config-patch root_dir=$(git rev-parse --show-toplevel) export SIMTEST_STATIC_INIT_MOVE=$root_dir"/examples/move/basics" -cargo llvm-cov clean - -MSIM_WATCHDOG_TIMEOUT_MS=60000 MSIM_TEST_SEED=1 cargo +nightly llvm-cov --ignore-run-fail --branch --html nextest \ - --cargo-profile simulator \ - --workspace \ - --exclude iota-e2e-tests \ - --exclude iota-json-rpc-tests \ - --exclude iota-faucet +MSIM_WATCHDOG_TIMEOUT_MS=60000 MSIM_TEST_SEED=1 cargo +nightly llvm-cov --ignore-run-fail --branch --html nextest --cargo-profile simulator # remove the patch git checkout .cargo/config Cargo.toml Cargo.lock From bd14b7b6bc147e6728df83625ded6636b9db3abd Mon Sep 17 00:00:00 2001 From: Alexander Schmidt Date: Thu, 31 Oct 2024 15:58:52 +0100 Subject: [PATCH 034/124] remove grcov coverage workflow --- .github/workflows/codecov.yml | 87 ----------------------------------- 1 file changed, 87 deletions(-) delete mode 100644 .github/workflows/codecov.yml diff --git a/.github/workflows/codecov.yml b/.github/workflows/codecov.yml deleted file mode 100644 index 1cf3cb8c418..00000000000 --- a/.github/workflows/codecov.yml +++ /dev/null @@ -1,87 +0,0 @@ -name: Code Coverage (grcov) - -on: - # Temporarily disabled - # push: - # branches: - # - develop - # pull_request: - # branches: - # - develop - # types: [opened, reopened, synchronize, ready_for_review] - workflow_dispatch: - -jobs: - # Temporarily disabled - # diff: - # if: github.event.pull_request.draft == false - # runs-on: [self-hosted] - # outputs: - # isRust: ${{ steps.diff.outputs.isRust }} - # steps: - # - uses: actions/checkout@eef61447b9ff4aafe5dcd4e0bbf5d482be7e7871 # pin@v4 - # - name: Detect Changes - # uses: "./.github/actions/diffs" - # id: diff - grcov: - name: Generate code coverage (grcov) - # Temporarily disabled - # needs: diff - # Temporarily disabled - # if: github.event.pull_request.draft == false && needs.diff.outputs.isRust == 'true' - runs-on: [self-hosted] - steps: - - uses: actions/checkout@eef61447b9ff4aafe5dcd4e0bbf5d482be7e7871 # pin@v4 - - uses: bmwill/rust-cache@fb63fcd7a959767755b88b5af2f5cbf65fb8a127 # pin@v1 - - - name: Install grcov - uses: taiki-e/install-action@grcov # pin@nextest - - - name: Install nextest - uses: taiki-e/install-action@7e58f89e24a544d88f7a74c6eed8a3df3fd4c658 # pin@nextest - - - name: Update Rust toolchain - run: rustup update stable - - - name: Install llvm-tools-preview - run: rustup component add llvm-tools-preview - - - name: Remove old coverage artifacts - run: | - if [ -d "./target/grcov" ]; then - rm -rf ./target/grcov - echo "Removed old artifacts." - else - echo "Target directory is clean." - fi - fi - - - name: Build - uses: actions-rs/cargo@ae10961054e4aa8b4aa7dffede299aaf087aa33b # pin@v1.0.3 - with: - command: build - env: - RUSTFLAGS: "-Cinstrument-coverage" - RUSTDOCFLAGS: "-Cinstrument-coverage" - - - name: Run tests - env: - RUSTFLAGS: "-Cinstrument-coverage" - RUSTDOCFLAGS: "-Cinstrument-coverage" - LLVM_PROFILE_FILE: "target/grcov/codecov-instrumentation-%p-%m.profraw" - run: | - mkdir -p target/grcov/html - cargo test - - - name: Run grcov - run: | - grcov . --binary-path target/debug/ -s . -t html --branch --ignore-not-existing --ignore '../**' --ignore '/*' -o target/grcov/html - - - name: Upload coverage report - uses: actions/upload-artifact@b4b15b8c7c6ac21ea08fcf65892d2ee8f75cf882 # pin@v4 - if: always() - with: - name: grcov-html - path: ./target/grcov/html - if-no-files-found: error - retention-days: 7 From 136cb5291ea307bf9dd0611399b31e275198d176 Mon Sep 17 00:00:00 2001 From: Alexander Schmidt Date: Thu, 31 Oct 2024 16:04:10 +0100 Subject: [PATCH 035/124] more clean up --- .github/workflows/cargo_llvm_cov.yml | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/.github/workflows/cargo_llvm_cov.yml b/.github/workflows/cargo_llvm_cov.yml index 9c9c03875e6..9865eafb11a 100644 --- a/.github/workflows/cargo_llvm_cov.yml +++ b/.github/workflows/cargo_llvm_cov.yml @@ -2,7 +2,7 @@ name: Code Coverage (llvm-cov) on: schedule: - - cron: "0 1 * * *" # UTC timing is every day at 1am UTC + - cron: "0 1 * * *" # every day at 1am (UTC) workflow_dispatch: env: @@ -46,10 +46,10 @@ jobs: - name: Install nextest uses: taiki-e/install-action@7e58f89e24a544d88f7a74c6eed8a3df3fd4c658 # pin@nextest - # - name: Set Swap Space - # uses: actionhippie/swap-space@v1 - # with: - # size: 256G + - name: Set Swap Space + uses: actionhippie/swap-space@v1 + with: + size: 256G - name: Update Rust toolchain run: rustup update stable From 90647317a357a50718e433894b6f150d3c62f828 Mon Sep 17 00:00:00 2001 From: Alexander Schmidt Date: Thu, 31 Oct 2024 17:03:43 +0100 Subject: [PATCH 036/124] nit --- .github/workflows/cargo_llvm_cov.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/cargo_llvm_cov.yml b/.github/workflows/cargo_llvm_cov.yml index 9865eafb11a..6bf2f7c1918 100644 --- a/.github/workflows/cargo_llvm_cov.yml +++ b/.github/workflows/cargo_llvm_cov.yml @@ -30,8 +30,8 @@ env: RUSTDOCFLAGS: -D warnings jobs: - llvm-cov-nextest: - name: Generate code coverage (nextest) + llvm-cov: + name: Generate code coverage runs-on: self-hosted timeout-minutes: 120 env: From a18c799c720472a322a74745c92b27747766167d Mon Sep 17 00:00:00 2001 From: Alexander Schmidt Date: Thu, 31 Oct 2024 21:13:10 +0100 Subject: [PATCH 037/124] merge nextest and simtest coverage --- .github/workflows/cargo_llvm_cov.yml | 45 +++++++++---------- .../simtest/{codecov.sh => simtest-cov.sh} | 3 +- 2 files changed, 22 insertions(+), 26 deletions(-) rename scripts/simtest/{codecov.sh => simtest-cov.sh} (84%) diff --git a/.github/workflows/cargo_llvm_cov.yml b/.github/workflows/cargo_llvm_cov.yml index 6bf2f7c1918..43c4449a32b 100644 --- a/.github/workflows/cargo_llvm_cov.yml +++ b/.github/workflows/cargo_llvm_cov.yml @@ -37,6 +37,10 @@ jobs: env: CARGO_TERM_COLOR: always steps: + # can be removed when actions are available on the image already + - name: Update Rust toolchain + run: rustup update stable + - uses: actions/checkout@eef61447b9ff4aafe5dcd4e0bbf5d482be7e7871 # pin@v4 - uses: bmwill/rust-cache@fb63fcd7a959767755b88b5af2f5cbf65fb8a127 # pin@v1 @@ -51,52 +55,43 @@ jobs: with: size: 256G - - name: Update Rust toolchain - run: rustup update stable - - - name: Generate code coverage + - name: Generate code coverage (nextest) run: | cargo llvm-cov clean set +e - IOTA_SKIP_SIMTESTS=1 cargo +nightly llvm-cov --ignore-run-fail --branch --html nextest - if [ -d "target/llvm-cov/html" ]; then + IOTA_SKIP_SIMTESTS=1 cargo +nightly llvm-cov --ignore-run-fail --branch --lcov --output-path target/nextest.lcov nextest + if [ -f "target/nextest.lcov" ]; then exit 0 else - echo "Fatal Error: Failed to create coverage report." + echo "Fatal Error: Failed to create nextest coverage report." exit 1 fi - - name: Pack report - run: cd target/llvm-cov/html && tar -czvf ../nextest_coverage_report.tgz ./ - - - name: Upload report - uses: actions/upload-artifact@b4b15b8c7c6ac21ea08fcf65892d2ee8f75cf882 # pin@v4 - with: - name: nextest_coverage_report.tgz - path: ./target/llvm-cov/nextest_coverage_report.tgz - if-no-files-found: error - retention-days: 1 - - name: Generate code coverage (simtest) run: | git clean -fd cargo llvm-cov clean set +e - ./scripts/simtest/codecov.sh - if [ -d "target/llvm-cov/html" ]; then + ./scripts/simtest/simtest-cov.sh + if [ -f "target/simtest.lcov" ]; then exit 0 else - echo "Fatal Error: Failed to create coverage report." + echo "Fatal Error: Failed to create simtest coverage report." exit 1 fi - - name: Pack report (simtest) - run: cd target/llvm-cov/html && tar -czvf ../simtest_coverage_report.tgz ./ + - name: Create report + run: | + apt install -yy lcov + genhtml -o target/coverage_report --branch-coverage target/nextest.lcov target/simtest.lcov + + - name: Pack report + run: cd target && tar -czvf coverage_report.tgz ./coverage_report - name: Upload report (simtest) uses: actions/upload-artifact@b4b15b8c7c6ac21ea08fcf65892d2ee8f75cf882 # pin@v4 with: - name: simtest_coverage_report.tgz - path: ./target/llvm-cov/simtest_coverage_report.tgz + name: coverage_report.tgz + path: ./target/coverage_report.tgz if-no-files-found: error retention-days: 1 diff --git a/scripts/simtest/codecov.sh b/scripts/simtest/simtest-cov.sh similarity index 84% rename from scripts/simtest/codecov.sh rename to scripts/simtest/simtest-cov.sh index c8aba0a6ac8..91f13a1660e 100755 --- a/scripts/simtest/codecov.sh +++ b/scripts/simtest/simtest-cov.sh @@ -16,7 +16,8 @@ git apply ./scripts/simtest/config-patch root_dir=$(git rev-parse --show-toplevel) export SIMTEST_STATIC_INIT_MOVE=$root_dir"/examples/move/basics" -MSIM_WATCHDOG_TIMEOUT_MS=60000 MSIM_TEST_SEED=1 cargo +nightly llvm-cov --ignore-run-fail --branch --html nextest --cargo-profile simulator +MSIM_WATCHDOG_TIMEOUT_MS=60000 MSIM_TEST_SEED=1 cargo +nightly llvm-cov --ignore-run-fail --branch --lcov --output-path target/simtest.lcov \ + nextest --cargo-profile simulator # remove the patch git checkout .cargo/config Cargo.toml Cargo.lock From f47ef7ab481b6e5b5fa06f2d286feb89f87c3c4b Mon Sep 17 00:00:00 2001 From: Alexander Schmidt Date: Thu, 31 Oct 2024 21:26:14 +0100 Subject: [PATCH 038/124] add llvm-cov dir --- .github/workflows/cargo_llvm_cov.yml | 14 +++++++------- scripts/simtest/simtest-cov.sh | 2 +- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/.github/workflows/cargo_llvm_cov.yml b/.github/workflows/cargo_llvm_cov.yml index 43c4449a32b..a8493204054 100644 --- a/.github/workflows/cargo_llvm_cov.yml +++ b/.github/workflows/cargo_llvm_cov.yml @@ -59,8 +59,8 @@ jobs: run: | cargo llvm-cov clean set +e - IOTA_SKIP_SIMTESTS=1 cargo +nightly llvm-cov --ignore-run-fail --branch --lcov --output-path target/nextest.lcov nextest - if [ -f "target/nextest.lcov" ]; then + IOTA_SKIP_SIMTESTS=1 cargo +nightly llvm-cov --ignore-run-fail --branch --lcov --output-path target/llvm-cov/nextest.lcov nextest + if [ -f "target/llvm-cov/nextest.lcov" ]; then exit 0 else echo "Fatal Error: Failed to create nextest coverage report." @@ -73,7 +73,7 @@ jobs: cargo llvm-cov clean set +e ./scripts/simtest/simtest-cov.sh - if [ -f "target/simtest.lcov" ]; then + if [ -f "target/llvm-cov/simtest.lcov" ]; then exit 0 else echo "Fatal Error: Failed to create simtest coverage report." @@ -83,15 +83,15 @@ jobs: - name: Create report run: | apt install -yy lcov - genhtml -o target/coverage_report --branch-coverage target/nextest.lcov target/simtest.lcov + genhtml -o target/llvm-cov/coverage_report --branch-coverage target/llvm-cov/nextest.lcov target/llvm-cov/simtest.lcov - name: Pack report - run: cd target && tar -czvf coverage_report.tgz ./coverage_report + run: cd target/llvm-cov && tar -czvf coverage_report.tgz ./coverage_report - - name: Upload report (simtest) + - name: Upload report uses: actions/upload-artifact@b4b15b8c7c6ac21ea08fcf65892d2ee8f75cf882 # pin@v4 with: name: coverage_report.tgz - path: ./target/coverage_report.tgz + path: ./target/llvm-cov/coverage_report.tgz if-no-files-found: error retention-days: 1 diff --git a/scripts/simtest/simtest-cov.sh b/scripts/simtest/simtest-cov.sh index 91f13a1660e..1b2a1cda203 100755 --- a/scripts/simtest/simtest-cov.sh +++ b/scripts/simtest/simtest-cov.sh @@ -16,7 +16,7 @@ git apply ./scripts/simtest/config-patch root_dir=$(git rev-parse --show-toplevel) export SIMTEST_STATIC_INIT_MOVE=$root_dir"/examples/move/basics" -MSIM_WATCHDOG_TIMEOUT_MS=60000 MSIM_TEST_SEED=1 cargo +nightly llvm-cov --ignore-run-fail --branch --lcov --output-path target/simtest.lcov \ +MSIM_WATCHDOG_TIMEOUT_MS=60000 MSIM_TEST_SEED=1 cargo +nightly llvm-cov --ignore-run-fail --branch --lcov --output-path target/llvm-cov/simtest.lcov \ nextest --cargo-profile simulator # remove the patch From 44f04ac03204840a840887072e2fb7e0cd27ce92 Mon Sep 17 00:00:00 2001 From: Alexander Schmidt Date: Mon, 4 Nov 2024 10:43:40 +0100 Subject: [PATCH 039/124] remove possibly corrupted .profraw files before report generation --- .github/workflows/cargo_llvm_cov.yml | 30 ++++++++++++++++++---------- scripts/simtest/simtest-cov.sh | 14 +++++++++++-- 2 files changed, 31 insertions(+), 13 deletions(-) diff --git a/.github/workflows/cargo_llvm_cov.yml b/.github/workflows/cargo_llvm_cov.yml index a8493204054..5d213f8cc9f 100644 --- a/.github/workflows/cargo_llvm_cov.yml +++ b/.github/workflows/cargo_llvm_cov.yml @@ -55,40 +55,48 @@ jobs: with: size: 256G - - name: Generate code coverage (nextest) + - name: Generate code coverage report (nextest.info) run: | cargo llvm-cov clean set +e - IOTA_SKIP_SIMTESTS=1 cargo +nightly llvm-cov --ignore-run-fail --branch --lcov --output-path target/llvm-cov/nextest.lcov nextest - if [ -f "target/llvm-cov/nextest.lcov" ]; then + IOTA_SKIP_SIMTESTS=1 cargo llvm-cov --ignore-run-fail --no-report nextest -vv + find target/llvm-cov-target -name '*.profraw' | while read file; do + if ! llvm-profdata show "$file" > /dev/null 2>&1; then + echo "Removing corrupted file: $file" + rm "$file" + fi + done + cargo llvm-cov --no-run --lcov --output-path target/llvm-cov/nextest.info + if [ -f "target/llvm-cov/nextest.info" ]; then + echo "Nextest coverage created." exit 0 else echo "Fatal Error: Failed to create nextest coverage report." exit 1 fi - - name: Generate code coverage (simtest) + - name: Generate code coverage report (simtest.info) run: | git clean -fd cargo llvm-cov clean set +e ./scripts/simtest/simtest-cov.sh - if [ -f "target/llvm-cov/simtest.lcov" ]; then + if [ -f "target/llvm-cov/simtest.info" ]; then + echo "Simtest coverage created." exit 0 else echo "Fatal Error: Failed to create simtest coverage report." exit 1 fi - - name: Create report + - name: Merge reports and prepare for upload run: | apt install -yy lcov - genhtml -o target/llvm-cov/coverage_report --branch-coverage target/llvm-cov/nextest.lcov target/llvm-cov/simtest.lcov + #genhtml -o target/llvm-cov/coverage_report --branch-coverage target/llvm-cov/nextest.info target/llvm-cov/simtest.info + genhtml -o target/llvm-cov/coverage_report target/llvm-cov/nextest.info target/llvm-cov/simtest.info + cd target/llvm-cov && tar -czvf coverage_report.tgz ./coverage_report - - name: Pack report - run: cd target/llvm-cov && tar -czvf coverage_report.tgz ./coverage_report - - - name: Upload report + - name: Upload uses: actions/upload-artifact@b4b15b8c7c6ac21ea08fcf65892d2ee8f75cf882 # pin@v4 with: name: coverage_report.tgz diff --git a/scripts/simtest/simtest-cov.sh b/scripts/simtest/simtest-cov.sh index 1b2a1cda203..9f75b08a357 100755 --- a/scripts/simtest/simtest-cov.sh +++ b/scripts/simtest/simtest-cov.sh @@ -16,8 +16,18 @@ git apply ./scripts/simtest/config-patch root_dir=$(git rev-parse --show-toplevel) export SIMTEST_STATIC_INIT_MOVE=$root_dir"/examples/move/basics" -MSIM_WATCHDOG_TIMEOUT_MS=60000 MSIM_TEST_SEED=1 cargo +nightly llvm-cov --ignore-run-fail --branch --lcov --output-path target/llvm-cov/simtest.lcov \ - nextest --cargo-profile simulator +# MSIM_WATCHDOG_TIMEOUT_MS=60000 MSIM_TEST_SEED=1 cargo +nightly llvm-cov --ignore-run-fail --branch --lcov --output-path simtest.info \ +# nextest -vv --cargo-profile simulator + +MSIM_WATCHDOG_TIMEOUT_MS=60000 MSIM_TEST_SEED=1 cargo llvm-cov --ignore-run-fail --no-report nextest -vv --cargo-profile simulator + +find target/llvm-cov-target -name '*.profraw' | while read file; do + if ! llvm-profdata show "$file" > /dev/null 2>&1; then + echo "Removing corrupted file: $file" + rm "$file" + fi + +cargo llvm-cov --no-run --lcov --output-path target/llvm-cov/simtest.info # remove the patch git checkout .cargo/config Cargo.toml Cargo.lock From ed1b9f68707c2b2419c5d5eee39d1057df16cc34 Mon Sep 17 00:00:00 2001 From: Alexander Schmidt Date: Mon, 4 Nov 2024 12:09:21 +0100 Subject: [PATCH 040/124] use llvm-profdata tool installed by rustup --- .github/workflows/cargo_llvm_cov.yml | 11 ++++++----- scripts/simtest/simtest-cov.sh | 3 ++- 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/.github/workflows/cargo_llvm_cov.yml b/.github/workflows/cargo_llvm_cov.yml index 5d213f8cc9f..45445171a5e 100644 --- a/.github/workflows/cargo_llvm_cov.yml +++ b/.github/workflows/cargo_llvm_cov.yml @@ -61,12 +61,12 @@ jobs: set +e IOTA_SKIP_SIMTESTS=1 cargo llvm-cov --ignore-run-fail --no-report nextest -vv find target/llvm-cov-target -name '*.profraw' | while read file; do - if ! llvm-profdata show "$file" > /dev/null 2>&1; then + if ! "$HOME/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/bin/llvm-profdata" show "$file" > /dev/null 2>&1; then echo "Removing corrupted file: $file" rm "$file" fi done - cargo llvm-cov --no-run --lcov --output-path target/llvm-cov/nextest.info + cargo llvm-cov --report --lcov --output-path target/llvm-cov/nextest.info if [ -f "target/llvm-cov/nextest.info" ]; then echo "Nextest coverage created." exit 0 @@ -92,9 +92,10 @@ jobs: - name: Merge reports and prepare for upload run: | apt install -yy lcov - #genhtml -o target/llvm-cov/coverage_report --branch-coverage target/llvm-cov/nextest.info target/llvm-cov/simtest.info - genhtml -o target/llvm-cov/coverage_report target/llvm-cov/nextest.info target/llvm-cov/simtest.info - cd target/llvm-cov && tar -czvf coverage_report.tgz ./coverage_report + cd target/llvm-cov + #genhtml -o coverage_report --branch-coverage nextest.info simtest.info + genhtml -o coverage_report nextest.info simtest.info + tar -czvf coverage_report.tgz ./coverage_report - name: Upload uses: actions/upload-artifact@b4b15b8c7c6ac21ea08fcf65892d2ee8f75cf882 # pin@v4 diff --git a/scripts/simtest/simtest-cov.sh b/scripts/simtest/simtest-cov.sh index 9f75b08a357..cc8efe31a0b 100755 --- a/scripts/simtest/simtest-cov.sh +++ b/scripts/simtest/simtest-cov.sh @@ -22,10 +22,11 @@ export SIMTEST_STATIC_INIT_MOVE=$root_dir"/examples/move/basics" MSIM_WATCHDOG_TIMEOUT_MS=60000 MSIM_TEST_SEED=1 cargo llvm-cov --ignore-run-fail --no-report nextest -vv --cargo-profile simulator find target/llvm-cov-target -name '*.profraw' | while read file; do - if ! llvm-profdata show "$file" > /dev/null 2>&1; then + if ! "$HOME/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/bin/llvm-profdata" show "$file" > /dev/null 2>&1; then echo "Removing corrupted file: $file" rm "$file" fi +done cargo llvm-cov --no-run --lcov --output-path target/llvm-cov/simtest.info From 3ae990d082ba3800e960af035b2d3854fb0850ef Mon Sep 17 00:00:00 2001 From: Alexander Schmidt Date: Mon, 4 Nov 2024 12:29:54 +0100 Subject: [PATCH 041/124] report subcommand --- .github/workflows/cargo_llvm_cov.yml | 2 +- scripts/simtest/simtest-cov.sh | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/cargo_llvm_cov.yml b/.github/workflows/cargo_llvm_cov.yml index 45445171a5e..c623d4547b8 100644 --- a/.github/workflows/cargo_llvm_cov.yml +++ b/.github/workflows/cargo_llvm_cov.yml @@ -66,7 +66,7 @@ jobs: rm "$file" fi done - cargo llvm-cov --report --lcov --output-path target/llvm-cov/nextest.info + cargo llvm-cov report --lcov --output-path target/llvm-cov/nextest.info if [ -f "target/llvm-cov/nextest.info" ]; then echo "Nextest coverage created." exit 0 diff --git a/scripts/simtest/simtest-cov.sh b/scripts/simtest/simtest-cov.sh index cc8efe31a0b..477270cfa16 100755 --- a/scripts/simtest/simtest-cov.sh +++ b/scripts/simtest/simtest-cov.sh @@ -28,7 +28,7 @@ find target/llvm-cov-target -name '*.profraw' | while read file; do fi done -cargo llvm-cov --no-run --lcov --output-path target/llvm-cov/simtest.info +cargo llvm-cov report --lcov --output-path target/llvm-cov/simtest.info # remove the patch git checkout .cargo/config Cargo.toml Cargo.lock From ebee8807779f40c1a1e6027cc5f83dbaf08f3922 Mon Sep 17 00:00:00 2001 From: Alexander Schmidt Date: Mon, 4 Nov 2024 13:03:40 +0100 Subject: [PATCH 042/124] check llvm-profdata version --- .github/workflows/cargo_llvm_cov.yml | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/.github/workflows/cargo_llvm_cov.yml b/.github/workflows/cargo_llvm_cov.yml index c623d4547b8..1508a286f4a 100644 --- a/.github/workflows/cargo_llvm_cov.yml +++ b/.github/workflows/cargo_llvm_cov.yml @@ -40,7 +40,6 @@ jobs: # can be removed when actions are available on the image already - name: Update Rust toolchain run: rustup update stable - - uses: actions/checkout@eef61447b9ff4aafe5dcd4e0bbf5d482be7e7871 # pin@v4 - uses: bmwill/rust-cache@fb63fcd7a959767755b88b5af2f5cbf65fb8a127 # pin@v1 @@ -58,10 +57,17 @@ jobs: - name: Generate code coverage report (nextest.info) run: | cargo llvm-cov clean + LLVM_PROFDATA="$HOME/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/bin/llvm-profdata" + if [[ -x "$LLVM_PROFDATA" ]]; then + $LLVM_PROFDATA --version + else + echo "Error: llvm-profdata not found or not executable at $LLVM_PROFDATA" + exit 1 + fi set +e IOTA_SKIP_SIMTESTS=1 cargo llvm-cov --ignore-run-fail --no-report nextest -vv find target/llvm-cov-target -name '*.profraw' | while read file; do - if ! "$HOME/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/bin/llvm-profdata" show "$file" > /dev/null 2>&1; then + if ! $LLVM_PROFDATA show "$file" > /dev/null 2>&1; then echo "Removing corrupted file: $file" rm "$file" fi From 2d7005a01eb6a8eac78af6b43ce58eb8309e13c5 Mon Sep 17 00:00:00 2001 From: Alexander Schmidt Date: Mon, 4 Nov 2024 13:35:27 +0100 Subject: [PATCH 043/124] nightly please --- .github/workflows/cargo_llvm_cov.yml | 4 ++-- scripts/simtest/simtest-cov.sh | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/cargo_llvm_cov.yml b/.github/workflows/cargo_llvm_cov.yml index 1508a286f4a..a140f2c64e0 100644 --- a/.github/workflows/cargo_llvm_cov.yml +++ b/.github/workflows/cargo_llvm_cov.yml @@ -57,7 +57,7 @@ jobs: - name: Generate code coverage report (nextest.info) run: | cargo llvm-cov clean - LLVM_PROFDATA="$HOME/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/bin/llvm-profdata" + LLVM_PROFDATA="$HOME/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/bin/llvm-profdata" if [[ -x "$LLVM_PROFDATA" ]]; then $LLVM_PROFDATA --version else @@ -65,7 +65,7 @@ jobs: exit 1 fi set +e - IOTA_SKIP_SIMTESTS=1 cargo llvm-cov --ignore-run-fail --no-report nextest -vv + IOTA_SKIP_SIMTESTS=1 cargo +nightly llvm-cov --ignore-run-fail --no-report nextest -vv find target/llvm-cov-target -name '*.profraw' | while read file; do if ! $LLVM_PROFDATA show "$file" > /dev/null 2>&1; then echo "Removing corrupted file: $file" diff --git a/scripts/simtest/simtest-cov.sh b/scripts/simtest/simtest-cov.sh index 477270cfa16..9f2f86788a5 100755 --- a/scripts/simtest/simtest-cov.sh +++ b/scripts/simtest/simtest-cov.sh @@ -19,7 +19,7 @@ export SIMTEST_STATIC_INIT_MOVE=$root_dir"/examples/move/basics" # MSIM_WATCHDOG_TIMEOUT_MS=60000 MSIM_TEST_SEED=1 cargo +nightly llvm-cov --ignore-run-fail --branch --lcov --output-path simtest.info \ # nextest -vv --cargo-profile simulator -MSIM_WATCHDOG_TIMEOUT_MS=60000 MSIM_TEST_SEED=1 cargo llvm-cov --ignore-run-fail --no-report nextest -vv --cargo-profile simulator +MSIM_WATCHDOG_TIMEOUT_MS=60000 MSIM_TEST_SEED=1 cargo +nightly llvm-cov --ignore-run-fail --no-report nextest -vv --cargo-profile simulator find target/llvm-cov-target -name '*.profraw' | while read file; do if ! "$HOME/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/bin/llvm-profdata" show "$file" > /dev/null 2>&1; then @@ -28,7 +28,7 @@ find target/llvm-cov-target -name '*.profraw' | while read file; do fi done -cargo llvm-cov report --lcov --output-path target/llvm-cov/simtest.info +cargo +nightly llvm-cov report --lcov --output-path target/llvm-cov/simtest.info # remove the patch git checkout .cargo/config Cargo.toml Cargo.lock From 6f3b9b4c1a0fe73720bc80decca14c3279594aca Mon Sep 17 00:00:00 2001 From: Alexander Schmidt Date: Mon, 4 Nov 2024 13:41:17 +0100 Subject: [PATCH 044/124] . --- .github/workflows/cargo_llvm_cov.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/cargo_llvm_cov.yml b/.github/workflows/cargo_llvm_cov.yml index a140f2c64e0..367b639973e 100644 --- a/.github/workflows/cargo_llvm_cov.yml +++ b/.github/workflows/cargo_llvm_cov.yml @@ -57,7 +57,7 @@ jobs: - name: Generate code coverage report (nextest.info) run: | cargo llvm-cov clean - LLVM_PROFDATA="$HOME/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/bin/llvm-profdata" + LLVM_PROFDATA=".$HOME/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/bin/llvm-profdata" if [[ -x "$LLVM_PROFDATA" ]]; then $LLVM_PROFDATA --version else From 08ed5d8d3ce240182ec3d3fb56eda072859ee97d Mon Sep 17 00:00:00 2001 From: Alexander Schmidt Date: Mon, 4 Nov 2024 14:03:25 +0100 Subject: [PATCH 045/124] bash fun --- .github/workflows/cargo_llvm_cov.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/cargo_llvm_cov.yml b/.github/workflows/cargo_llvm_cov.yml index 367b639973e..e4b49b25f11 100644 --- a/.github/workflows/cargo_llvm_cov.yml +++ b/.github/workflows/cargo_llvm_cov.yml @@ -57,7 +57,8 @@ jobs: - name: Generate code coverage report (nextest.info) run: | cargo llvm-cov clean - LLVM_PROFDATA=".$HOME/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/bin/llvm-profdata" + # LLVM_PROFDATA="$HOME/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/bin/llvm-profdata" + LLVM_PROFDATA=$(find . -iname "llvm-profdata" -print -quit) if [[ -x "$LLVM_PROFDATA" ]]; then $LLVM_PROFDATA --version else From f72dbc20c7c1fc41309aadd978380d129130af2a Mon Sep 17 00:00:00 2001 From: Alexander Schmidt Date: Mon, 4 Nov 2024 14:18:40 +0100 Subject: [PATCH 046/124] funny commits --- .github/workflows/cargo_llvm_cov.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/cargo_llvm_cov.yml b/.github/workflows/cargo_llvm_cov.yml index e4b49b25f11..9b89406912f 100644 --- a/.github/workflows/cargo_llvm_cov.yml +++ b/.github/workflows/cargo_llvm_cov.yml @@ -58,7 +58,7 @@ jobs: run: | cargo llvm-cov clean # LLVM_PROFDATA="$HOME/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/bin/llvm-profdata" - LLVM_PROFDATA=$(find . -iname "llvm-profdata" -print -quit) + LLVM_PROFDATA=$(find "$HOME" -iname "llvm-profdata" -print -quit) if [[ -x "$LLVM_PROFDATA" ]]; then $LLVM_PROFDATA --version else From 20c4296094cc403ccbf30f693ddd0f9c949d8a4c Mon Sep 17 00:00:00 2001 From: Alexander Schmidt Date: Mon, 4 Nov 2024 14:36:54 +0100 Subject: [PATCH 047/124] hopefully fixed --- .github/workflows/cargo_llvm_cov.yml | 10 ++++------ scripts/simtest/simtest-cov.sh | 6 +++--- 2 files changed, 7 insertions(+), 9 deletions(-) diff --git a/.github/workflows/cargo_llvm_cov.yml b/.github/workflows/cargo_llvm_cov.yml index 9b89406912f..4d7f3b1f8f8 100644 --- a/.github/workflows/cargo_llvm_cov.yml +++ b/.github/workflows/cargo_llvm_cov.yml @@ -56,9 +56,8 @@ jobs: - name: Generate code coverage report (nextest.info) run: | - cargo llvm-cov clean - # LLVM_PROFDATA="$HOME/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/bin/llvm-profdata" - LLVM_PROFDATA=$(find "$HOME" -iname "llvm-profdata" -print -quit) + rustup component add llvm-tools --toolchain stable + LLVM_PROFDATA="$HOME/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/bin/llvm-profdata" if [[ -x "$LLVM_PROFDATA" ]]; then $LLVM_PROFDATA --version else @@ -66,9 +65,9 @@ jobs: exit 1 fi set +e - IOTA_SKIP_SIMTESTS=1 cargo +nightly llvm-cov --ignore-run-fail --no-report nextest -vv + IOTA_SKIP_SIMTESTS=1 cargo llvm-cov --ignore-run-fail --no-report nextest -vv find target/llvm-cov-target -name '*.profraw' | while read file; do - if ! $LLVM_PROFDATA show "$file" > /dev/null 2>&1; then + if ! "$LLVM_PROFDATA" show "$file" > /dev/null 2>&1; then echo "Removing corrupted file: $file" rm "$file" fi @@ -85,7 +84,6 @@ jobs: - name: Generate code coverage report (simtest.info) run: | git clean -fd - cargo llvm-cov clean set +e ./scripts/simtest/simtest-cov.sh if [ -f "target/llvm-cov/simtest.info" ]; then diff --git a/scripts/simtest/simtest-cov.sh b/scripts/simtest/simtest-cov.sh index 9f2f86788a5..c002ce757cb 100755 --- a/scripts/simtest/simtest-cov.sh +++ b/scripts/simtest/simtest-cov.sh @@ -16,10 +16,10 @@ git apply ./scripts/simtest/config-patch root_dir=$(git rev-parse --show-toplevel) export SIMTEST_STATIC_INIT_MOVE=$root_dir"/examples/move/basics" -# MSIM_WATCHDOG_TIMEOUT_MS=60000 MSIM_TEST_SEED=1 cargo +nightly llvm-cov --ignore-run-fail --branch --lcov --output-path simtest.info \ +# MSIM_WATCHDOG_TIMEOUT_MS=60000 MSIM_TEST_SEED=1 cargo llvm-cov --ignore-run-fail --branch --lcov --output-path simtest.info \ # nextest -vv --cargo-profile simulator -MSIM_WATCHDOG_TIMEOUT_MS=60000 MSIM_TEST_SEED=1 cargo +nightly llvm-cov --ignore-run-fail --no-report nextest -vv --cargo-profile simulator +MSIM_WATCHDOG_TIMEOUT_MS=60000 MSIM_TEST_SEED=1 cargo llvm-cov --ignore-run-fail --no-report nextest -vv --cargo-profile simulator find target/llvm-cov-target -name '*.profraw' | while read file; do if ! "$HOME/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/bin/llvm-profdata" show "$file" > /dev/null 2>&1; then @@ -28,7 +28,7 @@ find target/llvm-cov-target -name '*.profraw' | while read file; do fi done -cargo +nightly llvm-cov report --lcov --output-path target/llvm-cov/simtest.info +cargo llvm-cov report --lcov --output-path target/llvm-cov/simtest.info # remove the patch git checkout .cargo/config Cargo.toml Cargo.lock From 19ad03fd233238f9fdf89d56e12850209660695a Mon Sep 17 00:00:00 2001 From: Alexander Schmidt Date: Mon, 4 Nov 2024 16:28:20 +0100 Subject: [PATCH 048/124] more debug, increase retention --- .github/workflows/cargo_llvm_cov.yml | 31 +++++++++++++++++++++------- 1 file changed, 23 insertions(+), 8 deletions(-) diff --git a/.github/workflows/cargo_llvm_cov.yml b/.github/workflows/cargo_llvm_cov.yml index 4d7f3b1f8f8..c9ce8297537 100644 --- a/.github/workflows/cargo_llvm_cov.yml +++ b/.github/workflows/cargo_llvm_cov.yml @@ -67,10 +67,13 @@ jobs: set +e IOTA_SKIP_SIMTESTS=1 cargo llvm-cov --ignore-run-fail --no-report nextest -vv find target/llvm-cov-target -name '*.profraw' | while read file; do - if ! "$LLVM_PROFDATA" show "$file" > /dev/null 2>&1; then - echo "Removing corrupted file: $file" - rm "$file" - fi + # TEMP + echo "Checking $file" + "$LLVM_PROFDATA" show "$file" + # if ! "$LLVM_PROFDATA" show "$file" > /dev/null 2>&1; then + # echo "Removing corrupted file: $file" + # rm "$file" + # fi done cargo llvm-cov report --lcov --output-path target/llvm-cov/nextest.info if [ -f "target/llvm-cov/nextest.info" ]; then @@ -81,6 +84,15 @@ jobs: exit 1 fi + - name: Upload .profraw dir (temp) + uses: actions/upload-artifact@b4b15b8c7c6ac21ea08fcf65892d2ee8f75cf882 # pin@v4 + if: always() + with: + name: llvm-cov-target + path: ./target/llvm-cov-target + if-no-files-found: error + retention-days: 1 + - name: Generate code coverage report (simtest.info) run: | git clean -fd @@ -102,10 +114,13 @@ jobs: genhtml -o coverage_report nextest.info simtest.info tar -czvf coverage_report.tgz ./coverage_report - - name: Upload + # TODO + #- name: Update coverage webpage + + - name: Upload backup uses: actions/upload-artifact@b4b15b8c7c6ac21ea08fcf65892d2ee8f75cf882 # pin@v4 with: - name: coverage_report.tgz - path: ./target/llvm-cov/coverage_report.tgz + name: coverage_report + path: ./target/llvm-cov/coverage_report if-no-files-found: error - retention-days: 1 + retention-days: 30 From 40d45e58be2be22968b71386c8c9d536abaea97c Mon Sep 17 00:00:00 2001 From: Alexander Schmidt Date: Mon, 4 Nov 2024 17:25:20 +0100 Subject: [PATCH 049/124] ensure correct toolchain --- .github/workflows/cargo_llvm_cov.yml | 14 +++----------- scripts/simtest/simtest-cov.sh | 6 +++--- 2 files changed, 6 insertions(+), 14 deletions(-) diff --git a/.github/workflows/cargo_llvm_cov.yml b/.github/workflows/cargo_llvm_cov.yml index c9ce8297537..ff6b6a0a380 100644 --- a/.github/workflows/cargo_llvm_cov.yml +++ b/.github/workflows/cargo_llvm_cov.yml @@ -56,8 +56,9 @@ jobs: - name: Generate code coverage report (nextest.info) run: | - rustup component add llvm-tools --toolchain stable - LLVM_PROFDATA="$HOME/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/bin/llvm-profdata" + TOOLCHAIN=$(rustup show active-toolchain | awk '{print $1}') + rustup component add llvm-tools --toolchain "$TOOLCHAIN" + LLVM_PROFDATA="$HOME/.rustup/toolchains/$TOOLCHAIN/lib/rustlib/x86_64-unknown-linux-gnu/bin/llvm-profdata" if [[ -x "$LLVM_PROFDATA" ]]; then $LLVM_PROFDATA --version else @@ -84,15 +85,6 @@ jobs: exit 1 fi - - name: Upload .profraw dir (temp) - uses: actions/upload-artifact@b4b15b8c7c6ac21ea08fcf65892d2ee8f75cf882 # pin@v4 - if: always() - with: - name: llvm-cov-target - path: ./target/llvm-cov-target - if-no-files-found: error - retention-days: 1 - - name: Generate code coverage report (simtest.info) run: | git clean -fd diff --git a/scripts/simtest/simtest-cov.sh b/scripts/simtest/simtest-cov.sh index c002ce757cb..8d4939fb7d2 100755 --- a/scripts/simtest/simtest-cov.sh +++ b/scripts/simtest/simtest-cov.sh @@ -16,13 +16,13 @@ git apply ./scripts/simtest/config-patch root_dir=$(git rev-parse --show-toplevel) export SIMTEST_STATIC_INIT_MOVE=$root_dir"/examples/move/basics" -# MSIM_WATCHDOG_TIMEOUT_MS=60000 MSIM_TEST_SEED=1 cargo llvm-cov --ignore-run-fail --branch --lcov --output-path simtest.info \ -# nextest -vv --cargo-profile simulator +TOOLCHAIN=$(rustup show active-toolchain | awk '{print $1}') +LLVM_PROFDATA="$HOME/.rustup/toolchains/$TOOLCHAIN/lib/rustlib/x86_64-unknown-linux-gnu/bin/llvm-profdata" MSIM_WATCHDOG_TIMEOUT_MS=60000 MSIM_TEST_SEED=1 cargo llvm-cov --ignore-run-fail --no-report nextest -vv --cargo-profile simulator find target/llvm-cov-target -name '*.profraw' | while read file; do - if ! "$HOME/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/bin/llvm-profdata" show "$file" > /dev/null 2>&1; then + if ! "$LLVM_PROFDATA" show "$file" > /dev/null 2>&1; then echo "Removing corrupted file: $file" rm "$file" fi From 7f8e79d186c71c8ff98a51c27e52197bf6c0ba23 Mon Sep 17 00:00:00 2001 From: Alexander Schmidt Date: Mon, 4 Nov 2024 18:01:51 +0100 Subject: [PATCH 050/124] clean up --- .github/workflows/cargo_llvm_cov.yml | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/.github/workflows/cargo_llvm_cov.yml b/.github/workflows/cargo_llvm_cov.yml index ff6b6a0a380..39d48fb3b7e 100644 --- a/.github/workflows/cargo_llvm_cov.yml +++ b/.github/workflows/cargo_llvm_cov.yml @@ -68,13 +68,10 @@ jobs: set +e IOTA_SKIP_SIMTESTS=1 cargo llvm-cov --ignore-run-fail --no-report nextest -vv find target/llvm-cov-target -name '*.profraw' | while read file; do - # TEMP - echo "Checking $file" - "$LLVM_PROFDATA" show "$file" - # if ! "$LLVM_PROFDATA" show "$file" > /dev/null 2>&1; then - # echo "Removing corrupted file: $file" - # rm "$file" - # fi + if ! "$LLVM_PROFDATA" show "$file" > /dev/null 2>&1; then + echo "Removing corrupted file: $file" + rm "$file" + fi done cargo llvm-cov report --lcov --output-path target/llvm-cov/nextest.info if [ -f "target/llvm-cov/nextest.info" ]; then @@ -102,7 +99,6 @@ jobs: run: | apt install -yy lcov cd target/llvm-cov - #genhtml -o coverage_report --branch-coverage nextest.info simtest.info genhtml -o coverage_report nextest.info simtest.info tar -czvf coverage_report.tgz ./coverage_report From 18998747af30100fba6834814e9daaf35897877c Mon Sep 17 00:00:00 2001 From: Alexander Schmidt Date: Mon, 4 Nov 2024 18:53:44 +0100 Subject: [PATCH 051/124] fix output dir --- .github/workflows/cargo_llvm_cov.yml | 10 +++++----- scripts/simtest/simtest-cov.sh | 2 +- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/.github/workflows/cargo_llvm_cov.yml b/.github/workflows/cargo_llvm_cov.yml index 39d48fb3b7e..37a9b35cb15 100644 --- a/.github/workflows/cargo_llvm_cov.yml +++ b/.github/workflows/cargo_llvm_cov.yml @@ -73,8 +73,8 @@ jobs: rm "$file" fi done - cargo llvm-cov report --lcov --output-path target/llvm-cov/nextest.info - if [ -f "target/llvm-cov/nextest.info" ]; then + cargo llvm-cov report --lcov --output-path target/llvm-cov-target/nextest.info + if [ -f "target/llvm-cov-target/nextest.info" ]; then echo "Nextest coverage created." exit 0 else @@ -87,7 +87,7 @@ jobs: git clean -fd set +e ./scripts/simtest/simtest-cov.sh - if [ -f "target/llvm-cov/simtest.info" ]; then + if [ -f "target/llvm-cov-target/simtest.info" ]; then echo "Simtest coverage created." exit 0 else @@ -98,7 +98,7 @@ jobs: - name: Merge reports and prepare for upload run: | apt install -yy lcov - cd target/llvm-cov + cd target/llvm-cov-target genhtml -o coverage_report nextest.info simtest.info tar -czvf coverage_report.tgz ./coverage_report @@ -109,6 +109,6 @@ jobs: uses: actions/upload-artifact@b4b15b8c7c6ac21ea08fcf65892d2ee8f75cf882 # pin@v4 with: name: coverage_report - path: ./target/llvm-cov/coverage_report + path: ./target/llvm-cov-target/coverage_report if-no-files-found: error retention-days: 30 diff --git a/scripts/simtest/simtest-cov.sh b/scripts/simtest/simtest-cov.sh index 8d4939fb7d2..7c695d074f4 100755 --- a/scripts/simtest/simtest-cov.sh +++ b/scripts/simtest/simtest-cov.sh @@ -28,7 +28,7 @@ find target/llvm-cov-target -name '*.profraw' | while read file; do fi done -cargo llvm-cov report --lcov --output-path target/llvm-cov/simtest.info +cargo llvm-cov report --lcov --output-path target/llvm-cov-target/simtest.info # remove the patch git checkout .cargo/config Cargo.toml Cargo.lock From 3127a0db7e2eb86633275b7ebf033b7b26b676f3 Mon Sep 17 00:00:00 2001 From: Alexander Schmidt Date: Mon, 4 Nov 2024 21:41:42 +0100 Subject: [PATCH 052/124] clean llvm-cov-target --- .github/workflows/cargo_llvm_cov.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/cargo_llvm_cov.yml b/.github/workflows/cargo_llvm_cov.yml index 37a9b35cb15..a7475bba664 100644 --- a/.github/workflows/cargo_llvm_cov.yml +++ b/.github/workflows/cargo_llvm_cov.yml @@ -56,6 +56,7 @@ jobs: - name: Generate code coverage report (nextest.info) run: | + cargo llvm-cov clean TOOLCHAIN=$(rustup show active-toolchain | awk '{print $1}') rustup component add llvm-tools --toolchain "$TOOLCHAIN" LLVM_PROFDATA="$HOME/.rustup/toolchains/$TOOLCHAIN/lib/rustlib/x86_64-unknown-linux-gnu/bin/llvm-profdata" @@ -84,6 +85,7 @@ jobs: - name: Generate code coverage report (simtest.info) run: | + cargo llvm-cov clean git clean -fd set +e ./scripts/simtest/simtest-cov.sh From a6ad3927f7610f07ffe6480debfc5dadd512b561 Mon Sep 17 00:00:00 2001 From: Alexander Schmidt Date: Tue, 5 Nov 2024 09:53:34 +0100 Subject: [PATCH 053/124] increase workflow timeout --- .github/workflows/cargo_llvm_cov.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/cargo_llvm_cov.yml b/.github/workflows/cargo_llvm_cov.yml index a7475bba664..c8f589b8686 100644 --- a/.github/workflows/cargo_llvm_cov.yml +++ b/.github/workflows/cargo_llvm_cov.yml @@ -33,7 +33,7 @@ jobs: llvm-cov: name: Generate code coverage runs-on: self-hosted - timeout-minutes: 120 + timeout-minutes: 180 env: CARGO_TERM_COLOR: always steps: From 2273e3b2b365729e455481d232389d4205e4d3a5 Mon Sep 17 00:00:00 2001 From: Thomas Shufps Date: Tue, 5 Nov 2024 10:55:47 +0100 Subject: [PATCH 054/124] Upload code coverage report (#3896) --- .github/workflows/cargo_llvm_cov.yml | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/.github/workflows/cargo_llvm_cov.yml b/.github/workflows/cargo_llvm_cov.yml index c8f589b8686..21619cdad57 100644 --- a/.github/workflows/cargo_llvm_cov.yml +++ b/.github/workflows/cargo_llvm_cov.yml @@ -73,7 +73,7 @@ jobs: echo "Removing corrupted file: $file" rm "$file" fi - done + done cargo llvm-cov report --lcov --output-path target/llvm-cov-target/nextest.info if [ -f "target/llvm-cov-target/nextest.info" ]; then echo "Nextest coverage created." @@ -104,6 +104,11 @@ jobs: genhtml -o coverage_report nextest.info simtest.info tar -czvf coverage_report.tgz ./coverage_report + - name: Upload code coverage report and trigger update + run: | + rsync -av coverage_report.tgz ${{ secrets.CODEGOV_REPORT_HOST }}:transfer/cargo-llvm-cov/ + ssh ${{ secrets.CODEGOV_REPORT_HOST }} + # TODO #- name: Update coverage webpage From a25e2c3a2f3a1ff1106c5e221096ccc5c6281471 Mon Sep 17 00:00:00 2001 From: Alexander Schmidt Date: Tue, 5 Nov 2024 10:57:32 +0100 Subject: [PATCH 055/124] remove comment --- .github/workflows/cargo_llvm_cov.yml | 3 --- 1 file changed, 3 deletions(-) diff --git a/.github/workflows/cargo_llvm_cov.yml b/.github/workflows/cargo_llvm_cov.yml index 21619cdad57..49a21b05c49 100644 --- a/.github/workflows/cargo_llvm_cov.yml +++ b/.github/workflows/cargo_llvm_cov.yml @@ -109,9 +109,6 @@ jobs: rsync -av coverage_report.tgz ${{ secrets.CODEGOV_REPORT_HOST }}:transfer/cargo-llvm-cov/ ssh ${{ secrets.CODEGOV_REPORT_HOST }} - # TODO - #- name: Update coverage webpage - - name: Upload backup uses: actions/upload-artifact@b4b15b8c7c6ac21ea08fcf65892d2ee8f75cf882 # pin@v4 with: From fcd80a432cd57ff202c764c502121370f85408e6 Mon Sep 17 00:00:00 2001 From: Alexander Schmidt Date: Tue, 5 Nov 2024 11:05:58 +0100 Subject: [PATCH 056/124] fix path --- .github/workflows/cargo_llvm_cov.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/cargo_llvm_cov.yml b/.github/workflows/cargo_llvm_cov.yml index 49a21b05c49..603eb8917b6 100644 --- a/.github/workflows/cargo_llvm_cov.yml +++ b/.github/workflows/cargo_llvm_cov.yml @@ -106,13 +106,13 @@ jobs: - name: Upload code coverage report and trigger update run: | - rsync -av coverage_report.tgz ${{ secrets.CODEGOV_REPORT_HOST }}:transfer/cargo-llvm-cov/ + rsync -av target/llvm-cov-target/coverage_report.tgz ${{ secrets.CODEGOV_REPORT_HOST }}:transfer/cargo-llvm-cov/ ssh ${{ secrets.CODEGOV_REPORT_HOST }} - name: Upload backup uses: actions/upload-artifact@b4b15b8c7c6ac21ea08fcf65892d2ee8f75cf882 # pin@v4 with: name: coverage_report - path: ./target/llvm-cov-target/coverage_report + path: target/llvm-cov-target/coverage_report if-no-files-found: error retention-days: 30 From 370a023a289f5f9a26f6d5f4c5f2a281f2a515de Mon Sep 17 00:00:00 2001 From: Alexander Schmidt Date: Tue, 5 Nov 2024 12:25:59 +0100 Subject: [PATCH 057/124] clean up --- .github/workflows/cargo_llvm_cov.yml | 36 ++++++++++++++++------------ scripts/simtest/simtest-cov.sh | 2 +- 2 files changed, 22 insertions(+), 16 deletions(-) diff --git a/.github/workflows/cargo_llvm_cov.yml b/.github/workflows/cargo_llvm_cov.yml index 603eb8917b6..884423ba448 100644 --- a/.github/workflows/cargo_llvm_cov.yml +++ b/.github/workflows/cargo_llvm_cov.yml @@ -54,7 +54,7 @@ jobs: with: size: 256G - - name: Generate code coverage report (nextest.info) + - name: Compute code coverage and create report (nextest.info) run: | cargo llvm-cov clean TOOLCHAIN=$(rustup show active-toolchain | awk '{print $1}') @@ -74,8 +74,8 @@ jobs: rm "$file" fi done - cargo llvm-cov report --lcov --output-path target/llvm-cov-target/nextest.info - if [ -f "target/llvm-cov-target/nextest.info" ]; then + cargo llvm-cov report --lcov --output-path target/nextest.info + if [ -f "target/nextest.info" ]; then echo "Nextest coverage created." exit 0 else @@ -83,13 +83,13 @@ jobs: exit 1 fi - - name: Generate code coverage report (simtest.info) + - name: Compute code coverage and create report (simtest.info) run: | cargo llvm-cov clean git clean -fd set +e ./scripts/simtest/simtest-cov.sh - if [ -f "target/llvm-cov-target/simtest.info" ]; then + if [ -f "target/simtest.info" ]; then echo "Simtest coverage created." exit 0 else @@ -97,22 +97,28 @@ jobs: exit 1 fi - - name: Merge reports and prepare for upload + - name: Create combined html report (report.tgz) run: | - apt install -yy lcov - cd target/llvm-cov-target - genhtml -o coverage_report nextest.info simtest.info - tar -czvf coverage_report.tgz ./coverage_report + if ! command -v lcov &> /dev/null; then + apt install -y lcov + fi + cd target || exit 1 + if [ -d "report" ]; then + rm -rf report + fi + genhtml -o report nextest.info simtest.info + tar -czvf report.tgz report - - name: Upload code coverage report and trigger update + - name: Publish html report and trigger update run: | - rsync -av target/llvm-cov-target/coverage_report.tgz ${{ secrets.CODEGOV_REPORT_HOST }}:transfer/cargo-llvm-cov/ + cd target || exit 1 + rsync -av report.tgz ${{ secrets.CODEGOV_REPORT_HOST }}:transfer/cargo-llvm-cov/ ssh ${{ secrets.CODEGOV_REPORT_HOST }} - - name: Upload backup + - name: Backup html report uses: actions/upload-artifact@b4b15b8c7c6ac21ea08fcf65892d2ee8f75cf882 # pin@v4 with: - name: coverage_report - path: target/llvm-cov-target/coverage_report + name: report + path: target/report.tgz if-no-files-found: error retention-days: 30 diff --git a/scripts/simtest/simtest-cov.sh b/scripts/simtest/simtest-cov.sh index 7c695d074f4..a286c02051e 100755 --- a/scripts/simtest/simtest-cov.sh +++ b/scripts/simtest/simtest-cov.sh @@ -28,7 +28,7 @@ find target/llvm-cov-target -name '*.profraw' | while read file; do fi done -cargo llvm-cov report --lcov --output-path target/llvm-cov-target/simtest.info +cargo llvm-cov report --lcov --output-path target/simtest.info # remove the patch git checkout .cargo/config Cargo.toml Cargo.lock From e4616c23cb3d58b19cf49c7d128aa92c96672da6 Mon Sep 17 00:00:00 2001 From: Alexander Schmidt Date: Tue, 5 Nov 2024 15:31:16 +0100 Subject: [PATCH 058/124] profraw-only --- .github/workflows/cargo_llvm_cov.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/cargo_llvm_cov.yml b/.github/workflows/cargo_llvm_cov.yml index 884423ba448..02b71473c02 100644 --- a/.github/workflows/cargo_llvm_cov.yml +++ b/.github/workflows/cargo_llvm_cov.yml @@ -56,7 +56,7 @@ jobs: - name: Compute code coverage and create report (nextest.info) run: | - cargo llvm-cov clean + cargo llvm-cov clean --profraw-only TOOLCHAIN=$(rustup show active-toolchain | awk '{print $1}') rustup component add llvm-tools --toolchain "$TOOLCHAIN" LLVM_PROFDATA="$HOME/.rustup/toolchains/$TOOLCHAIN/lib/rustlib/x86_64-unknown-linux-gnu/bin/llvm-profdata" @@ -85,7 +85,7 @@ jobs: - name: Compute code coverage and create report (simtest.info) run: | - cargo llvm-cov clean + cargo llvm-cov clean --profraw-only git clean -fd set +e ./scripts/simtest/simtest-cov.sh From 21ed31bdbe21d53afedf5b0f4a3433e00ae52769 Mon Sep 17 00:00:00 2001 From: Alexander Schmidt Date: Tue, 5 Nov 2024 18:17:24 +0100 Subject: [PATCH 059/124] temp disable simtest coverage --- .github/workflows/cargo_llvm_cov.yml | 29 ++++++++++++++-------------- 1 file changed, 15 insertions(+), 14 deletions(-) diff --git a/.github/workflows/cargo_llvm_cov.yml b/.github/workflows/cargo_llvm_cov.yml index 02b71473c02..87205795717 100644 --- a/.github/workflows/cargo_llvm_cov.yml +++ b/.github/workflows/cargo_llvm_cov.yml @@ -83,19 +83,19 @@ jobs: exit 1 fi - - name: Compute code coverage and create report (simtest.info) - run: | - cargo llvm-cov clean --profraw-only - git clean -fd - set +e - ./scripts/simtest/simtest-cov.sh - if [ -f "target/simtest.info" ]; then - echo "Simtest coverage created." - exit 0 - else - echo "Fatal Error: Failed to create simtest coverage report." - exit 1 - fi + # - name: Compute code coverage and create report (simtest.info) + # run: | + # cargo llvm-cov clean --profraw-only + # git clean -fd + # set +e + # ./scripts/simtest/simtest-cov.sh + # if [ -f "target/simtest.info" ]; then + # echo "Simtest coverage created." + # exit 0 + # else + # echo "Fatal Error: Failed to create simtest coverage report." + # exit 1 + # fi - name: Create combined html report (report.tgz) run: | @@ -106,7 +106,8 @@ jobs: if [ -d "report" ]; then rm -rf report fi - genhtml -o report nextest.info simtest.info + # genhtml -o report nextest.info simtest.info + genhtml -o report nextest.info tar -czvf report.tgz report - name: Publish html report and trigger update From 105efa0d4a8517fee820f04ce71c97f8773709f7 Mon Sep 17 00:00:00 2001 From: Alexander Schmidt Date: Tue, 5 Nov 2024 20:51:56 +0100 Subject: [PATCH 060/124] try to improve runtime speed during coverage computation --- .github/workflows/cargo_llvm_cov.yml | 19 ++++++++----------- 1 file changed, 8 insertions(+), 11 deletions(-) diff --git a/.github/workflows/cargo_llvm_cov.yml b/.github/workflows/cargo_llvm_cov.yml index 87205795717..9fe27a84ed8 100644 --- a/.github/workflows/cargo_llvm_cov.yml +++ b/.github/workflows/cargo_llvm_cov.yml @@ -7,18 +7,15 @@ on: env: CARGO_TERM_COLOR: always - # Disable incremental compilation. - # - # Incremental compilation is useful as part of an edit-build-test-edit cycle, - # as it lets the compiler avoid recompiling code that hasn't changed. However, - # on CI, we're not making small edits; we're almost always building the entire - # project from scratch. Thus, incremental compilation on CI actually - # introduces *additional* overhead to support making future builds - # faster...but no future builds will ever occur in any given CI environment. - # - # See https://matklad.github.io/2021/09/04/fast-rust-builds.html#ci-workflow - # for details. CARGO_INCREMENTAL: 0 + # Find a good balance between performance and coverage metadata + CARGO_PROFILE_TEST_OPT_LEVEL: 2 + CARGO_PROFILE_TEST_DEBUG: true + CARGO_PROFILE_TEST_DEBUG_ASSERTIONS: true + CARGO_PROFILE_TEST_OVERFLOW_CHECKS: false + CARGO_PROFILE_TEST_LTO: off + CARGO_PROFILE_TEST_CODEGEN_UNITS: 1 + CARGO_PROFILE_TEST_PANIC: abort # Allow more retries for network requests in cargo (downloading crates) and # rustup (installing toolchains). This should help to reduce flaky CI failures # from transient network timeouts or other issues. From 4c66b80f9e251a4a7c02858dacb8a03a0f18a4b3 Mon Sep 17 00:00:00 2001 From: Alexander Schmidt Date: Tue, 5 Nov 2024 21:59:09 +0100 Subject: [PATCH 061/124] sudo apt-get --- .github/workflows/cargo_llvm_cov.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/cargo_llvm_cov.yml b/.github/workflows/cargo_llvm_cov.yml index 9fe27a84ed8..7048dfd7ad2 100644 --- a/.github/workflows/cargo_llvm_cov.yml +++ b/.github/workflows/cargo_llvm_cov.yml @@ -97,7 +97,7 @@ jobs: - name: Create combined html report (report.tgz) run: | if ! command -v lcov &> /dev/null; then - apt install -y lcov + sudo apt-get install -y lcov fi cd target || exit 1 if [ -d "report" ]; then From e5665b1cc86cfe23c5d5f1354b8aaa85d210bbdc Mon Sep 17 00:00:00 2001 From: Alexander Schmidt Date: Tue, 5 Nov 2024 22:03:22 +0100 Subject: [PATCH 062/124] validity check notification --- .github/workflows/cargo_llvm_cov.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/cargo_llvm_cov.yml b/.github/workflows/cargo_llvm_cov.yml index 7048dfd7ad2..f1f69f41550 100644 --- a/.github/workflows/cargo_llvm_cov.yml +++ b/.github/workflows/cargo_llvm_cov.yml @@ -66,6 +66,7 @@ jobs: set +e IOTA_SKIP_SIMTESTS=1 cargo llvm-cov --ignore-run-fail --no-report nextest -vv find target/llvm-cov-target -name '*.profraw' | while read file; do + echo "Checking validity of: $file" if ! "$LLVM_PROFDATA" show "$file" > /dev/null 2>&1; then echo "Removing corrupted file: $file" rm "$file" From ecc69861e413d4128c86634a3d97bea3e53844c6 Mon Sep 17 00:00:00 2001 From: Alexander Schmidt Date: Wed, 6 Nov 2024 00:26:17 +0100 Subject: [PATCH 063/124] simplify --- .github/workflows/cargo_llvm_cov.yml | 32 ++++++++++++---------------- scripts/simtest/simtest-cov.sh | 2 ++ 2 files changed, 16 insertions(+), 18 deletions(-) diff --git a/.github/workflows/cargo_llvm_cov.yml b/.github/workflows/cargo_llvm_cov.yml index f1f69f41550..7ee2d8acc91 100644 --- a/.github/workflows/cargo_llvm_cov.yml +++ b/.github/workflows/cargo_llvm_cov.yml @@ -57,45 +57,36 @@ jobs: TOOLCHAIN=$(rustup show active-toolchain | awk '{print $1}') rustup component add llvm-tools --toolchain "$TOOLCHAIN" LLVM_PROFDATA="$HOME/.rustup/toolchains/$TOOLCHAIN/lib/rustlib/x86_64-unknown-linux-gnu/bin/llvm-profdata" - if [[ -x "$LLVM_PROFDATA" ]]; then + if [ -x "$LLVM_PROFDATA" ]; then $LLVM_PROFDATA --version else echo "Error: llvm-profdata not found or not executable at $LLVM_PROFDATA" exit 1 fi set +e + echo "Computing code coverage." IOTA_SKIP_SIMTESTS=1 cargo llvm-cov --ignore-run-fail --no-report nextest -vv + echo "Checking validity of generated .profraw files." find target/llvm-cov-target -name '*.profraw' | while read file; do - echo "Checking validity of: $file" if ! "$LLVM_PROFDATA" show "$file" > /dev/null 2>&1; then echo "Removing corrupted file: $file" rm "$file" fi done + echo "Creating nextest report." cargo llvm-cov report --lcov --output-path target/nextest.info - if [ -f "target/nextest.info" ]; then - echo "Nextest coverage created." - exit 0 - else - echo "Fatal Error: Failed to create nextest coverage report." - exit 1 - fi + [ -f "target/nextest.info" ] || exit 1 # - name: Compute code coverage and create report (simtest.info) # run: | # cargo llvm-cov clean --profraw-only # git clean -fd # set +e + # echo "Computing code coverage." # ./scripts/simtest/simtest-cov.sh - # if [ -f "target/simtest.info" ]; then - # echo "Simtest coverage created." - # exit 0 - # else - # echo "Fatal Error: Failed to create simtest coverage report." - # exit 1 - # fi + # [ -f "target/simtest.info" ] || exit 1 - - name: Create combined html report (report.tgz) + - name: Create html report (report.tgz) run: | if ! command -v lcov &> /dev/null; then sudo apt-get install -y lcov @@ -104,9 +95,13 @@ jobs: if [ -d "report" ]; then rm -rf report fi + echo "Creating html report." # genhtml -o report nextest.info simtest.info genhtml -o report nextest.info - tar -czvf report.tgz report + [ -d "report" ] || exit 1 + echo "Packaging html report." + tar -czf report.tgz report + [ -f "report.tgz" ] || exit 1 - name: Publish html report and trigger update run: | @@ -116,6 +111,7 @@ jobs: - name: Backup html report uses: actions/upload-artifact@b4b15b8c7c6ac21ea08fcf65892d2ee8f75cf882 # pin@v4 + if: always() with: name: report path: target/report.tgz diff --git a/scripts/simtest/simtest-cov.sh b/scripts/simtest/simtest-cov.sh index a286c02051e..bc6b062f83a 100755 --- a/scripts/simtest/simtest-cov.sh +++ b/scripts/simtest/simtest-cov.sh @@ -21,6 +21,7 @@ LLVM_PROFDATA="$HOME/.rustup/toolchains/$TOOLCHAIN/lib/rustlib/x86_64-unknown-li MSIM_WATCHDOG_TIMEOUT_MS=60000 MSIM_TEST_SEED=1 cargo llvm-cov --ignore-run-fail --no-report nextest -vv --cargo-profile simulator +echo "Checking validity of generated .profraw files." find target/llvm-cov-target -name '*.profraw' | while read file; do if ! "$LLVM_PROFDATA" show "$file" > /dev/null 2>&1; then echo "Removing corrupted file: $file" @@ -28,6 +29,7 @@ find target/llvm-cov-target -name '*.profraw' | while read file; do fi done +echo "Creating simtest report." cargo llvm-cov report --lcov --output-path target/simtest.info # remove the patch From b46600a13c06ec030394857aa51561a90d998a3a Mon Sep 17 00:00:00 2001 From: Alexander Schmidt Date: Wed, 6 Nov 2024 02:03:17 +0100 Subject: [PATCH 064/124] re-enable simtest --- .github/workflows/cargo_llvm_cov.yml | 19 +++++++++---------- 1 file changed, 9 insertions(+), 10 deletions(-) diff --git a/.github/workflows/cargo_llvm_cov.yml b/.github/workflows/cargo_llvm_cov.yml index 7ee2d8acc91..40fc7674205 100644 --- a/.github/workflows/cargo_llvm_cov.yml +++ b/.github/workflows/cargo_llvm_cov.yml @@ -77,14 +77,14 @@ jobs: cargo llvm-cov report --lcov --output-path target/nextest.info [ -f "target/nextest.info" ] || exit 1 - # - name: Compute code coverage and create report (simtest.info) - # run: | - # cargo llvm-cov clean --profraw-only - # git clean -fd - # set +e - # echo "Computing code coverage." - # ./scripts/simtest/simtest-cov.sh - # [ -f "target/simtest.info" ] || exit 1 + - name: Compute code coverage and create report (simtest.info) + run: | + cargo llvm-cov clean --profraw-only + git clean -fd + set +e + echo "Computing code coverage." + ./scripts/simtest/simtest-cov.sh + [ -f "target/simtest.info" ] || exit 1 - name: Create html report (report.tgz) run: | @@ -96,8 +96,7 @@ jobs: rm -rf report fi echo "Creating html report." - # genhtml -o report nextest.info simtest.info - genhtml -o report nextest.info + genhtml -o report nextest.info simtest.info [ -d "report" ] || exit 1 echo "Packaging html report." tar -czf report.tgz report From cdcd2bf26016428f2f2af788abb5d202b75562c9 Mon Sep 17 00:00:00 2001 From: Alexander Schmidt Date: Wed, 6 Nov 2024 09:42:36 +0100 Subject: [PATCH 065/124] only simtest --- .github/workflows/cargo_llvm_cov.yml | 53 ++++++++++++++-------------- 1 file changed, 27 insertions(+), 26 deletions(-) diff --git a/.github/workflows/cargo_llvm_cov.yml b/.github/workflows/cargo_llvm_cov.yml index 40fc7674205..e132fe7a4a6 100644 --- a/.github/workflows/cargo_llvm_cov.yml +++ b/.github/workflows/cargo_llvm_cov.yml @@ -51,31 +51,31 @@ jobs: with: size: 256G - - name: Compute code coverage and create report (nextest.info) - run: | - cargo llvm-cov clean --profraw-only - TOOLCHAIN=$(rustup show active-toolchain | awk '{print $1}') - rustup component add llvm-tools --toolchain "$TOOLCHAIN" - LLVM_PROFDATA="$HOME/.rustup/toolchains/$TOOLCHAIN/lib/rustlib/x86_64-unknown-linux-gnu/bin/llvm-profdata" - if [ -x "$LLVM_PROFDATA" ]; then - $LLVM_PROFDATA --version - else - echo "Error: llvm-profdata not found or not executable at $LLVM_PROFDATA" - exit 1 - fi - set +e - echo "Computing code coverage." - IOTA_SKIP_SIMTESTS=1 cargo llvm-cov --ignore-run-fail --no-report nextest -vv - echo "Checking validity of generated .profraw files." - find target/llvm-cov-target -name '*.profraw' | while read file; do - if ! "$LLVM_PROFDATA" show "$file" > /dev/null 2>&1; then - echo "Removing corrupted file: $file" - rm "$file" - fi - done - echo "Creating nextest report." - cargo llvm-cov report --lcov --output-path target/nextest.info - [ -f "target/nextest.info" ] || exit 1 + # - name: Compute code coverage and create report (nextest.info) + # run: | + # cargo llvm-cov clean --profraw-only + # TOOLCHAIN=$(rustup show active-toolchain | awk '{print $1}') + # rustup component add llvm-tools --toolchain "$TOOLCHAIN" + # LLVM_PROFDATA="$HOME/.rustup/toolchains/$TOOLCHAIN/lib/rustlib/x86_64-unknown-linux-gnu/bin/llvm-profdata" + # if [ -x "$LLVM_PROFDATA" ]; then + # $LLVM_PROFDATA --version + # else + # echo "Error: llvm-profdata not found or not executable at $LLVM_PROFDATA" + # exit 1 + # fi + # set +e + # echo "Computing code coverage." + # IOTA_SKIP_SIMTESTS=1 cargo llvm-cov --ignore-run-fail --no-report nextest -vv + # echo "Checking validity of generated .profraw files." + # find target/llvm-cov-target -name '*.profraw' | while read file; do + # if ! "$LLVM_PROFDATA" show "$file" > /dev/null 2>&1; then + # echo "Removing corrupted file: $file" + # rm "$file" + # fi + # done + # echo "Creating nextest report." + # cargo llvm-cov report --lcov --output-path target/nextest.info + # [ -f "target/nextest.info" ] || exit 1 - name: Compute code coverage and create report (simtest.info) run: | @@ -96,7 +96,8 @@ jobs: rm -rf report fi echo "Creating html report." - genhtml -o report nextest.info simtest.info + # genhtml -o report nextest.info simtest.info + genhtml -o report simtest.info [ -d "report" ] || exit 1 echo "Packaging html report." tar -czf report.tgz report From 4548eaff5b26debf97d215f44e164d808c96f3ee Mon Sep 17 00:00:00 2001 From: Alexander Schmidt Date: Wed, 6 Nov 2024 10:55:24 +0100 Subject: [PATCH 066/124] clean env vars --- .github/workflows/cargo_llvm_cov.yml | 77 +++++++++++++--------------- 1 file changed, 37 insertions(+), 40 deletions(-) diff --git a/.github/workflows/cargo_llvm_cov.yml b/.github/workflows/cargo_llvm_cov.yml index e132fe7a4a6..38771c185a4 100644 --- a/.github/workflows/cargo_llvm_cov.yml +++ b/.github/workflows/cargo_llvm_cov.yml @@ -6,33 +6,30 @@ on: workflow_dispatch: env: + # Don't emit giant backtraces in the CI logs. + RUST_BACKTRACE: short + # Rustup + RUSTUP_MAX_RETRIES: 10 + # Cargo CARGO_TERM_COLOR: always CARGO_INCREMENTAL: 0 - # Find a good balance between performance and coverage metadata + # Find a good balance between runtime performance and accurate code coverage analysis. CARGO_PROFILE_TEST_OPT_LEVEL: 2 CARGO_PROFILE_TEST_DEBUG: true CARGO_PROFILE_TEST_DEBUG_ASSERTIONS: true CARGO_PROFILE_TEST_OVERFLOW_CHECKS: false CARGO_PROFILE_TEST_LTO: off CARGO_PROFILE_TEST_CODEGEN_UNITS: 1 - CARGO_PROFILE_TEST_PANIC: abort # Allow more retries for network requests in cargo (downloading crates) and # rustup (installing toolchains). This should help to reduce flaky CI failures # from transient network timeouts or other issues. CARGO_NET_RETRY: 10 - RUSTUP_MAX_RETRIES: 10 - # Don't emit giant backtraces in the CI logs. - RUST_BACKTRACE: short - # RUSTFLAGS: -D warnings - RUSTDOCFLAGS: -D warnings jobs: llvm-cov: name: Generate code coverage runs-on: self-hosted timeout-minutes: 180 - env: - CARGO_TERM_COLOR: always steps: # can be removed when actions are available on the image already - name: Update Rust toolchain @@ -51,40 +48,40 @@ jobs: with: size: 256G - # - name: Compute code coverage and create report (nextest.info) - # run: | - # cargo llvm-cov clean --profraw-only - # TOOLCHAIN=$(rustup show active-toolchain | awk '{print $1}') - # rustup component add llvm-tools --toolchain "$TOOLCHAIN" - # LLVM_PROFDATA="$HOME/.rustup/toolchains/$TOOLCHAIN/lib/rustlib/x86_64-unknown-linux-gnu/bin/llvm-profdata" - # if [ -x "$LLVM_PROFDATA" ]; then - # $LLVM_PROFDATA --version - # else - # echo "Error: llvm-profdata not found or not executable at $LLVM_PROFDATA" - # exit 1 - # fi - # set +e - # echo "Computing code coverage." - # IOTA_SKIP_SIMTESTS=1 cargo llvm-cov --ignore-run-fail --no-report nextest -vv - # echo "Checking validity of generated .profraw files." - # find target/llvm-cov-target -name '*.profraw' | while read file; do - # if ! "$LLVM_PROFDATA" show "$file" > /dev/null 2>&1; then - # echo "Removing corrupted file: $file" - # rm "$file" - # fi - # done - # echo "Creating nextest report." - # cargo llvm-cov report --lcov --output-path target/nextest.info - # [ -f "target/nextest.info" ] || exit 1 - - - name: Compute code coverage and create report (simtest.info) + - name: Compute code coverage and create report (nextest.info) run: | cargo llvm-cov clean --profraw-only - git clean -fd + TOOLCHAIN=$(rustup show active-toolchain | awk '{print $1}') + rustup component add llvm-tools --toolchain "$TOOLCHAIN" + LLVM_PROFDATA="$HOME/.rustup/toolchains/$TOOLCHAIN/lib/rustlib/x86_64-unknown-linux-gnu/bin/llvm-profdata" + if [ -x "$LLVM_PROFDATA" ]; then + $LLVM_PROFDATA --version + else + echo "Error: llvm-profdata not found or not executable at $LLVM_PROFDATA" + exit 1 + fi set +e echo "Computing code coverage." - ./scripts/simtest/simtest-cov.sh - [ -f "target/simtest.info" ] || exit 1 + IOTA_SKIP_SIMTESTS=1 cargo llvm-cov --ignore-run-fail --no-report nextest -vv + echo "Checking validity of generated .profraw files." + find target/llvm-cov-target -name '*.profraw' | while read file; do + if ! "$LLVM_PROFDATA" show "$file" > /dev/null 2>&1; then + echo "Removing corrupted file: $file" + rm "$file" + fi + done + echo "Creating nextest report." + cargo llvm-cov report --lcov --output-path target/nextest.info + [ -f "target/nextest.info" ] || exit 1 + + # - name: Compute code coverage and create report (simtest.info) + # run: | + # cargo llvm-cov clean --profraw-only + # git clean -fd + # set +e + # echo "Computing code coverage." + # ./scripts/simtest/simtest-cov.sh + # [ -f "target/simtest.info" ] || exit 1 - name: Create html report (report.tgz) run: | @@ -97,7 +94,7 @@ jobs: fi echo "Creating html report." # genhtml -o report nextest.info simtest.info - genhtml -o report simtest.info + genhtml -o report nextest.info [ -d "report" ] || exit 1 echo "Packaging html report." tar -czf report.tgz report From fd18d03735058dc8545e28a099af65a71b26e1af Mon Sep 17 00:00:00 2001 From: Alexander Schmidt Date: Thu, 7 Nov 2024 10:13:59 +0100 Subject: [PATCH 067/124] nits --- .github/workflows/cargo_llvm_cov.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/cargo_llvm_cov.yml b/.github/workflows/cargo_llvm_cov.yml index 38771c185a4..3ccb17a604b 100644 --- a/.github/workflows/cargo_llvm_cov.yml +++ b/.github/workflows/cargo_llvm_cov.yml @@ -34,6 +34,7 @@ jobs: # can be removed when actions are available on the image already - name: Update Rust toolchain run: rustup update stable + - uses: actions/checkout@eef61447b9ff4aafe5dcd4e0bbf5d482be7e7871 # pin@v4 - uses: bmwill/rust-cache@fb63fcd7a959767755b88b5af2f5cbf65fb8a127 # pin@v1 @@ -102,8 +103,7 @@ jobs: - name: Publish html report and trigger update run: | - cd target || exit 1 - rsync -av report.tgz ${{ secrets.CODEGOV_REPORT_HOST }}:transfer/cargo-llvm-cov/ + rsync -av target/report.tgz ${{ secrets.CODEGOV_REPORT_HOST }}:transfer/cargo-llvm-cov/ ssh ${{ secrets.CODEGOV_REPORT_HOST }} - name: Backup html report From c00dfa5cd8c9a6d4080df330a0e3790d99fd6e1f Mon Sep 17 00:00:00 2001 From: Alexander Schmidt Date: Thu, 7 Nov 2024 10:55:04 +0100 Subject: [PATCH 068/124] only code-coverage for workspace crates --- .github/workflows/cargo_llvm_cov.yml | 17 +++++++++-------- scripts/simtest/simtest-cov.sh | 2 +- 2 files changed, 10 insertions(+), 9 deletions(-) diff --git a/.github/workflows/cargo_llvm_cov.yml b/.github/workflows/cargo_llvm_cov.yml index 3ccb17a604b..a54af1be6ac 100644 --- a/.github/workflows/cargo_llvm_cov.yml +++ b/.github/workflows/cargo_llvm_cov.yml @@ -31,10 +31,6 @@ jobs: runs-on: self-hosted timeout-minutes: 180 steps: - # can be removed when actions are available on the image already - - name: Update Rust toolchain - run: rustup update stable - - uses: actions/checkout@eef61447b9ff4aafe5dcd4e0bbf5d482be7e7871 # pin@v4 - uses: bmwill/rust-cache@fb63fcd7a959767755b88b5af2f5cbf65fb8a127 # pin@v1 @@ -63,7 +59,7 @@ jobs: fi set +e echo "Computing code coverage." - IOTA_SKIP_SIMTESTS=1 cargo llvm-cov --ignore-run-fail --no-report nextest -vv + IOTA_SKIP_SIMTESTS=1 cargo llvm-cov --workspace --ignore-run-fail --no-report nextest -vv echo "Checking validity of generated .profraw files." find target/llvm-cov-target -name '*.profraw' | while read file; do if ! "$LLVM_PROFDATA" show "$file" > /dev/null 2>&1; then @@ -82,7 +78,9 @@ jobs: # set +e # echo "Computing code coverage." # ./scripts/simtest/simtest-cov.sh - # [ -f "target/simtest.info" ] || exit 1 + # # For now we accept failing simtest coverage + # # [ -f "target/simtest.info" ] || exit 1 + # exit 0 - name: Create html report (report.tgz) run: | @@ -94,8 +92,11 @@ jobs: rm -rf report fi echo "Creating html report." - # genhtml -o report nextest.info simtest.info - genhtml -o report nextest.info + if [ -f "simtest.info" ]; then + genhtml -o report nextest.info simtest.info + else + genhtml -o report nextest.info + fi [ -d "report" ] || exit 1 echo "Packaging html report." tar -czf report.tgz report diff --git a/scripts/simtest/simtest-cov.sh b/scripts/simtest/simtest-cov.sh index bc6b062f83a..c458cf4ed40 100755 --- a/scripts/simtest/simtest-cov.sh +++ b/scripts/simtest/simtest-cov.sh @@ -19,7 +19,7 @@ export SIMTEST_STATIC_INIT_MOVE=$root_dir"/examples/move/basics" TOOLCHAIN=$(rustup show active-toolchain | awk '{print $1}') LLVM_PROFDATA="$HOME/.rustup/toolchains/$TOOLCHAIN/lib/rustlib/x86_64-unknown-linux-gnu/bin/llvm-profdata" -MSIM_WATCHDOG_TIMEOUT_MS=60000 MSIM_TEST_SEED=1 cargo llvm-cov --ignore-run-fail --no-report nextest -vv --cargo-profile simulator +MSIM_WATCHDOG_TIMEOUT_MS=60000 MSIM_TEST_SEED=1 cargo llvm-cov --workspace --ignore-run-fail --no-report nextest -vv --cargo-profile simulator echo "Checking validity of generated .profraw files." find target/llvm-cov-target -name '*.profraw' | while read file; do From 380b69ec337b23d43375175f60d34f398bc0f54d Mon Sep 17 00:00:00 2001 From: Alexander Schmidt Date: Thu, 7 Nov 2024 11:02:10 +0100 Subject: [PATCH 069/124] optimize --- .github/workflows/cargo_llvm_cov.yml | 41 ++++++++++++++-------------- 1 file changed, 20 insertions(+), 21 deletions(-) diff --git a/.github/workflows/cargo_llvm_cov.yml b/.github/workflows/cargo_llvm_cov.yml index a54af1be6ac..409e4e2be69 100644 --- a/.github/workflows/cargo_llvm_cov.yml +++ b/.github/workflows/cargo_llvm_cov.yml @@ -5,31 +5,30 @@ on: - cron: "0 1 * * *" # every day at 1am (UTC) workflow_dispatch: -env: - # Don't emit giant backtraces in the CI logs. - RUST_BACKTRACE: short - # Rustup - RUSTUP_MAX_RETRIES: 10 - # Cargo - CARGO_TERM_COLOR: always - CARGO_INCREMENTAL: 0 - # Find a good balance between runtime performance and accurate code coverage analysis. - CARGO_PROFILE_TEST_OPT_LEVEL: 2 - CARGO_PROFILE_TEST_DEBUG: true - CARGO_PROFILE_TEST_DEBUG_ASSERTIONS: true - CARGO_PROFILE_TEST_OVERFLOW_CHECKS: false - CARGO_PROFILE_TEST_LTO: off - CARGO_PROFILE_TEST_CODEGEN_UNITS: 1 - # Allow more retries for network requests in cargo (downloading crates) and - # rustup (installing toolchains). This should help to reduce flaky CI failures - # from transient network timeouts or other issues. - CARGO_NET_RETRY: 10 - jobs: llvm-cov: name: Generate code coverage runs-on: self-hosted timeout-minutes: 180 + env: + # Don't emit giant backtraces in the CI logs. + RUST_BACKTRACE: short + # Rustup + RUSTUP_MAX_RETRIES: 10 + # Cargo + CARGO_TERM_COLOR: always + CARGO_INCREMENTAL: 0 + # Find a good balance between runtime performance and accurate code coverage analysis. + CARGO_PROFILE_TEST_OPT_LEVEL: 2 + CARGO_PROFILE_TEST_DEBUG: true + CARGO_PROFILE_TEST_DEBUG_ASSERTIONS: true + CARGO_PROFILE_TEST_OVERFLOW_CHECKS: false + CARGO_PROFILE_TEST_LTO: off + CARGO_PROFILE_TEST_CODEGEN_UNITS: 1 + # Allow more retries for network requests in cargo (downloading crates) and + # rustup (installing toolchains). This should help to reduce flaky CI failures + # from transient network timeouts or other issues. + CARGO_NET_RETRY: 10 steps: - uses: actions/checkout@eef61447b9ff4aafe5dcd4e0bbf5d482be7e7871 # pin@v4 - uses: bmwill/rust-cache@fb63fcd7a959767755b88b5af2f5cbf65fb8a127 # pin@v1 @@ -48,7 +47,7 @@ jobs: - name: Compute code coverage and create report (nextest.info) run: | cargo llvm-cov clean --profraw-only - TOOLCHAIN=$(rustup show active-toolchain | awk '{print $1}') + TOOLCHAIN=$(rustup show active-toolchain | cut -d ' ' -f 1) rustup component add llvm-tools --toolchain "$TOOLCHAIN" LLVM_PROFDATA="$HOME/.rustup/toolchains/$TOOLCHAIN/lib/rustlib/x86_64-unknown-linux-gnu/bin/llvm-profdata" if [ -x "$LLVM_PROFDATA" ]; then From 0f79efbc4d3be3f1373e74acdcfd0f7a8641302c Mon Sep 17 00:00:00 2001 From: Alexander Schmidt Date: Thu, 7 Nov 2024 12:32:20 +0100 Subject: [PATCH 070/124] ignore external crates source files --- .github/workflows/cargo_llvm_cov.yml | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/.github/workflows/cargo_llvm_cov.yml b/.github/workflows/cargo_llvm_cov.yml index 409e4e2be69..8ee846a1554 100644 --- a/.github/workflows/cargo_llvm_cov.yml +++ b/.github/workflows/cargo_llvm_cov.yml @@ -58,7 +58,11 @@ jobs: fi set +e echo "Computing code coverage." - IOTA_SKIP_SIMTESTS=1 cargo llvm-cov --workspace --ignore-run-fail --no-report nextest -vv + IOTA_SKIP_SIMTESTS=1 cargo llvm-cov \ + --workspace \ + --ignore-run-fail \ + --ignore-filename-regex 'external-crates/.*' \ + --no-report nextest -vv echo "Checking validity of generated .profraw files." find target/llvm-cov-target -name '*.profraw' | while read file; do if ! "$LLVM_PROFDATA" show "$file" > /dev/null 2>&1; then From 7f2e14729353fb8d101241bae28248cbf872f922 Mon Sep 17 00:00:00 2001 From: Alexander Schmidt Date: Thu, 7 Nov 2024 15:35:10 +0100 Subject: [PATCH 071/124] put option on the right command --- .github/workflows/cargo_llvm_cov.yml | 19 +++++++++++++------ scripts/simtest/simtest-cov.sh | 16 ++++++++++++---- 2 files changed, 25 insertions(+), 10 deletions(-) diff --git a/.github/workflows/cargo_llvm_cov.yml b/.github/workflows/cargo_llvm_cov.yml index 8ee846a1554..fb6d6e5a5ab 100644 --- a/.github/workflows/cargo_llvm_cov.yml +++ b/.github/workflows/cargo_llvm_cov.yml @@ -47,6 +47,7 @@ jobs: - name: Compute code coverage and create report (nextest.info) run: | cargo llvm-cov clean --profraw-only + TOOLCHAIN=$(rustup show active-toolchain | cut -d ' ' -f 1) rustup component add llvm-tools --toolchain "$TOOLCHAIN" LLVM_PROFDATA="$HOME/.rustup/toolchains/$TOOLCHAIN/lib/rustlib/x86_64-unknown-linux-gnu/bin/llvm-profdata" @@ -57,21 +58,28 @@ jobs: exit 1 fi set +e - echo "Computing code coverage." + + echo "Computing nextest code coverage." IOTA_SKIP_SIMTESTS=1 cargo llvm-cov \ --workspace \ --ignore-run-fail \ - --ignore-filename-regex 'external-crates/.*' \ - --no-report nextest -vv - echo "Checking validity of generated .profraw files." + --no-report \ + nextest -vv + + echo "Checking validity of generated .profraw files. This might take a while." find target/llvm-cov-target -name '*.profraw' | while read file; do if ! "$LLVM_PROFDATA" show "$file" > /dev/null 2>&1; then echo "Removing corrupted file: $file" rm "$file" fi done + echo "Creating nextest report." - cargo llvm-cov report --lcov --output-path target/nextest.info + cargo llvm-cov report \ + --lcov \ + --output-path target/nextest.info \ + --ignore-filename-regex 'external-crates/.*' + [ -f "target/nextest.info" ] || exit 1 # - name: Compute code coverage and create report (simtest.info) @@ -79,7 +87,6 @@ jobs: # cargo llvm-cov clean --profraw-only # git clean -fd # set +e - # echo "Computing code coverage." # ./scripts/simtest/simtest-cov.sh # # For now we accept failing simtest coverage # # [ -f "target/simtest.info" ] || exit 1 diff --git a/scripts/simtest/simtest-cov.sh b/scripts/simtest/simtest-cov.sh index c458cf4ed40..cefbdb5b9ad 100755 --- a/scripts/simtest/simtest-cov.sh +++ b/scripts/simtest/simtest-cov.sh @@ -19,9 +19,14 @@ export SIMTEST_STATIC_INIT_MOVE=$root_dir"/examples/move/basics" TOOLCHAIN=$(rustup show active-toolchain | awk '{print $1}') LLVM_PROFDATA="$HOME/.rustup/toolchains/$TOOLCHAIN/lib/rustlib/x86_64-unknown-linux-gnu/bin/llvm-profdata" -MSIM_WATCHDOG_TIMEOUT_MS=60000 MSIM_TEST_SEED=1 cargo llvm-cov --workspace --ignore-run-fail --no-report nextest -vv --cargo-profile simulator - -echo "Checking validity of generated .profraw files." +echo "Computing simtest code coverage." +MSIM_WATCHDOG_TIMEOUT_MS=60000 MSIM_TEST_SEED=1 cargo llvm-cov \ + --workspace \ + --ignore-run-fail \ + --no-report \ + nextest -vv --cargo-profile simulator + +echo "Checking validity of generated .profraw files. This might take a while." find target/llvm-cov-target -name '*.profraw' | while read file; do if ! "$LLVM_PROFDATA" show "$file" > /dev/null 2>&1; then echo "Removing corrupted file: $file" @@ -30,7 +35,10 @@ find target/llvm-cov-target -name '*.profraw' | while read file; do done echo "Creating simtest report." -cargo llvm-cov report --lcov --output-path target/simtest.info +cargo llvm-cov report \ + --lcov \ + --output-path target/simtest.info \ + --ignore-filename-regex 'external-crates/.*' # remove the patch git checkout .cargo/config Cargo.toml Cargo.lock From 266edcc4d95d86d2f688f11cf8bd81c5b132d064 Mon Sep 17 00:00:00 2001 From: Alexander Schmidt Date: Fri, 8 Nov 2024 14:22:49 +0100 Subject: [PATCH 072/124] simtests only: no debug info --- .github/workflows/cargo_llvm_cov.yml | 91 ++++++++++---------- Cargo.toml | 124 +++++++++++++++++++++++---- scripts/simtest/simtest-cov.sh | 5 +- 3 files changed, 154 insertions(+), 66 deletions(-) diff --git a/.github/workflows/cargo_llvm_cov.yml b/.github/workflows/cargo_llvm_cov.yml index fb6d6e5a5ab..a7f105f6111 100644 --- a/.github/workflows/cargo_llvm_cov.yml +++ b/.github/workflows/cargo_llvm_cov.yml @@ -20,11 +20,12 @@ jobs: CARGO_INCREMENTAL: 0 # Find a good balance between runtime performance and accurate code coverage analysis. CARGO_PROFILE_TEST_OPT_LEVEL: 2 - CARGO_PROFILE_TEST_DEBUG: true + CARGO_PROFILE_TEST_DEBUG: false CARGO_PROFILE_TEST_DEBUG_ASSERTIONS: true CARGO_PROFILE_TEST_OVERFLOW_CHECKS: false CARGO_PROFILE_TEST_LTO: off CARGO_PROFILE_TEST_CODEGEN_UNITS: 1 + CARGO_LOG: debug # Allow more retries for network requests in cargo (downloading crates) and # rustup (installing toolchains). This should help to reduce flaky CI failures # from transient network timeouts or other issues. @@ -44,53 +45,53 @@ jobs: with: size: 256G - - name: Compute code coverage and create report (nextest.info) - run: | - cargo llvm-cov clean --profraw-only + # - name: Compute code coverage and create report (nextest.info) + # run: | + # cargo llvm-cov clean --profraw-only - TOOLCHAIN=$(rustup show active-toolchain | cut -d ' ' -f 1) - rustup component add llvm-tools --toolchain "$TOOLCHAIN" - LLVM_PROFDATA="$HOME/.rustup/toolchains/$TOOLCHAIN/lib/rustlib/x86_64-unknown-linux-gnu/bin/llvm-profdata" - if [ -x "$LLVM_PROFDATA" ]; then - $LLVM_PROFDATA --version - else - echo "Error: llvm-profdata not found or not executable at $LLVM_PROFDATA" - exit 1 - fi - set +e + # TOOLCHAIN=$(rustup show active-toolchain | cut -d ' ' -f 1) + # rustup component add llvm-tools --toolchain "$TOOLCHAIN" + # LLVM_PROFDATA="$HOME/.rustup/toolchains/$TOOLCHAIN/lib/rustlib/x86_64-unknown-linux-gnu/bin/llvm-profdata" + # if [ -x "$LLVM_PROFDATA" ]; then + # $LLVM_PROFDATA --version + # else + # echo "Error: llvm-profdata not found or not executable at $LLVM_PROFDATA" + # exit 1 + # fi - echo "Computing nextest code coverage." - IOTA_SKIP_SIMTESTS=1 cargo llvm-cov \ - --workspace \ - --ignore-run-fail \ - --no-report \ - nextest -vv + # echo "Computing nextest code coverage." + # set +e + # IOTA_SKIP_SIMTESTS=1 cargo llvm-cov \ + # --workspace \ + # --ignore-run-fail \ + # --no-report \ + # nextest -vv - echo "Checking validity of generated .profraw files. This might take a while." - find target/llvm-cov-target -name '*.profraw' | while read file; do - if ! "$LLVM_PROFDATA" show "$file" > /dev/null 2>&1; then - echo "Removing corrupted file: $file" - rm "$file" - fi - done + # echo "Scanning for corrupted .profraw files. This might take a while." + # find target/llvm-cov-target -name '*.profraw' | while read file; do + # if ! "$LLVM_PROFDATA" show "$file" > /dev/null 2>&1; then + # echo "Removing corrupted file: $file" + # rm "$file" + # fi + # done - echo "Creating nextest report." - cargo llvm-cov report \ - --lcov \ - --output-path target/nextest.info \ - --ignore-filename-regex 'external-crates/.*' + # echo "Creating nextest report." + # cargo llvm-cov report \ + # --lcov \ + # --output-path target/nextest.info \ + # --ignore-filename-regex 'external-crates/.*' - [ -f "target/nextest.info" ] || exit 1 + # [ -f "target/nextest.info" ] || exit 1 - # - name: Compute code coverage and create report (simtest.info) - # run: | - # cargo llvm-cov clean --profraw-only - # git clean -fd - # set +e - # ./scripts/simtest/simtest-cov.sh - # # For now we accept failing simtest coverage - # # [ -f "target/simtest.info" ] || exit 1 - # exit 0 + - name: Compute code coverage and create report (simtest.info) + run: | + cargo llvm-cov clean --profraw-only + git clean -fd + set +e + ./scripts/simtest/simtest-cov.sh + # For now we accept failing simtest coverage + # [ -f "target/simtest.info" ] || exit 1 + exit 0 - name: Create html report (report.tgz) run: | @@ -103,9 +104,11 @@ jobs: fi echo "Creating html report." if [ -f "simtest.info" ]; then - genhtml -o report nextest.info simtest.info + # genhtml -o report nextest.info simtest.info + genhtml -o report simtest.info else - genhtml -o report nextest.info + # genhtml -o report nextest.info + exit 1 fi [ -d "report" ] || exit 1 echo "Packaging html report." diff --git a/Cargo.toml b/Cargo.toml index 47f7395e1a8..c8d9f6c3501 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -198,15 +198,18 @@ strip = 'none' opt-level = 2 [profile.simulator] +inherits = "test" debug = true debug-assertions = true -inherits = "test" +overflow-checks = true # opt-level 1 gives >5x speedup for simulator tests without slowing down build times very much. opt-level = 1 -overflow-checks = true [workspace.lints.rust] -unexpected_cfgs = { level = "warn", check-cfg = ['cfg(msim)', 'cfg(fail_points)'] } +unexpected_cfgs = { level = "warn", check-cfg = [ + 'cfg(msim)', + 'cfg(fail_points)', +] } # Dependencies that should be kept in sync through the whole workspace [workspace.dependencies] @@ -221,9 +224,25 @@ async-graphql = "=7.0.1" async-recursion = "1.0.4" async-trait = "0.1.61" aws-config = "0.56" -axum = { version = "0.7", default-features = false, features = ["tokio", "http1", "http2", "json", "matched-path", "original-uri", "form", "query", "ws"] } +axum = { version = "0.7", default-features = false, features = [ + "tokio", + "http1", + "http2", + "json", + "matched-path", + "original-uri", + "form", + "query", + "ws", +] } axum-extra = { version = "0.9", features = ["typed-header"] } -backoff = { version = "0.4.0", features = ["futures", "futures-core", "pin-project-lite", "tokio", "tokio_1"] } +backoff = { version = "0.4.0", features = [ + "futures", + "futures-core", + "pin-project-lite", + "tokio", + "tokio_1", +] } base64 = "0.21.2" base64-url = "2" bcs = "0.1.4" @@ -241,13 +260,23 @@ colored = "2.0.0" comfy-table = "6.1.3" const-str = "0.5.3" coset = "0.3" -criterion = { version = "0.5.0", features = ["async", "async_tokio", "html_reports"] } +criterion = { version = "0.5.0", features = [ + "async", + "async_tokio", + "html_reports", +] } crossterm = "0.25.0" csv = "1.2.1" dashmap = "5.5.3" datatest-stable = { git = "https://github.com/nextest-rs/datatest-stable.git", rev = "72db7f6d1bbe36a5407e96b9488a581f763e106f" } derivative = "2.2.0" -diesel = { version = "2.1.0", features = ["chrono", "r2d2", "serde_json", "64-column-tables", "i-implement-a-third-party-backend-and-opt-into-breaking-changes"] } +diesel = { version = "2.1.0", features = [ + "chrono", + "r2d2", + "serde_json", + "64-column-tables", + "i-implement-a-third-party-backend-and-opt-into-breaking-changes", +] } dirs = "5.0" ed25519-consensus = { version = "2.0.1", features = ["serde"] } either = "1.8.0" @@ -256,7 +285,9 @@ expect-test = "1.4.0" eyre = "0.6.8" fastcrypto = { git = "https://github.com/MystenLabs/fastcrypto", rev = "5f2c63266a065996d53f98156f0412782b468597" } fastcrypto-tbls = { git = "https://github.com/MystenLabs/fastcrypto", rev = "5f2c63266a065996d53f98156f0412782b468597" } -fastcrypto-vdf = { git = "https://github.com/MystenLabs/fastcrypto", rev = "5f2c63266a065996d53f98156f0412782b468597", features = ["experimental"] } +fastcrypto-vdf = { git = "https://github.com/MystenLabs/fastcrypto", rev = "5f2c63266a065996d53f98156f0412782b468597", features = [ + "experimental", +] } fastcrypto-zkp = { git = "https://github.com/MystenLabs/fastcrypto", rev = "5f2c63266a065996d53f98156f0412782b468597", package = "fastcrypto-zkp" } fdlimit = "0.2.1" flate2 = "1.0.28" @@ -269,7 +300,12 @@ hex = "0.4.3" http = "1" humantime = "2.1.0" hyper = "1" -hyper-rustls = { version = "0.27", default-features = false, features = ["webpki-roots", "http2", "ring", "tls12"] } +hyper-rustls = { version = "0.27", default-features = false, features = [ + "webpki-roots", + "http2", + "ring", + "tls12", +] } im = "15" indexmap = { version = "2.1.0", features = ["serde"] } indicatif = "0.17.2" @@ -277,7 +313,13 @@ insta = { version = "1.21.1", features = ["redactions", "yaml", "json"] } integer-encoding = "3.0.1" itertools = "0.13.0" json_to_table = { git = "https://github.com/zhiburt/tabled/", rev = "e449317a1c02eb6b29e409ad6617e5d9eb7b3bd4" } -jsonrpsee = { version = "0.24", features = ["server", "macros", "client", "ws-client", "http-client"] } +jsonrpsee = { version = "0.24", features = [ + "server", + "macros", + "client", + "ws-client", + "http-client", +] } leb128 = "0.2.5" lru = "0.12" mockall = "0.11.4" @@ -306,11 +348,25 @@ quote = "1.0.23" rand = "0.8.5" rayon = "1.5.3" regex = "1.7.1" -reqwest = { version = "0.12", default-features = false, features = ["http2", "json", "rustls-tls"] } +reqwest = { version = "0.12", default-features = false, features = [ + "http2", + "json", + "rustls-tls", +] } roaring = "0.10.6" -rocksdb = { version = "0.21.0", default-features = false, features = ["snappy", "lz4", "zstd", "zlib", "multi-threaded-cf"] } +rocksdb = { version = "0.21.0", default-features = false, features = [ + "snappy", + "lz4", + "zstd", + "zlib", + "multi-threaded-cf", +] } rstest = "0.16.0" -rustls = { version = "0.23", default-features = false, features = ["std", "tls12", "ring"] } +rustls = { version = "0.23", default-features = false, features = [ + "std", + "tls12", + "ring", +] } schemars = { version = "0.8.21", features = ["either"] } scopeguard = "1.1" serde = { version = "1.0.144", features = ["derive", "rc"] } @@ -336,7 +392,10 @@ thiserror = "1.0.40" # tokio is defined at a specific version to support patching with iota-sim # Do not upgrade without updating https://github.com/iotaledger/iota-sim first tokio = "=1.39.2" -tokio-rustls = { version = "0.26", default-features = false, features = ["tls12", "ring"] } +tokio-rustls = { version = "0.26", default-features = false, features = [ + "tls12", + "ring", +] } tokio-stream = { version = "0.1.14", features = ["sync", "net"] } tokio-util = "0.7.10" toml = { version = "0.7.4", features = ["preserve_order"] } @@ -346,10 +405,31 @@ toml = { version = "0.7.4", features = ["preserve_order"] } tonic = { version = "0.12", features = ["transport"] } tonic-build = { version = "0.12", features = ["prost", "transport"] } tonic-health = "0.12" -tower = { version = "0.4.12", features = ["full", "util", "timeout", "load-shed", "limit"] } -tower-http = { version = "0.5", features = ["cors", "full", "trace", "set-header", "propagate-header"] } +tower = { version = "0.4.12", features = [ + "full", + "util", + "timeout", + "load-shed", + "limit", +] } +tower-http = { version = "0.5", features = [ + "cors", + "full", + "trace", + "set-header", + "propagate-header", +] } tracing = "0.1.37" -tracing-subscriber = { version = "0.3.15", default-features = false, features = ["std", "smallvec", "fmt", "ansi", "time", "json", "registry", "env-filter"] } +tracing-subscriber = { version = "0.3.15", default-features = false, features = [ + "std", + "smallvec", + "fmt", + "ansi", + "time", + "json", + "registry", + "env-filter", +] } unescape = "0.1.0" url = "2.3.1" uuid = { version = "1.1.2", features = ["v4", "fast-rng"] } @@ -417,7 +497,11 @@ iota-rosetta = { path = "crates/iota-rosetta" } iota-rpc-loadgen = { path = "crates/iota-rpc-loadgen" } iota-sdk = { path = "crates/iota-sdk" } # core-types with json format for REST API -iota-sdk2 = { package = "iota-rust-sdk", git = "ssh://git@github.com/iotaledger/iota-rust-sdk.git", rev = "dd7b331a5ec62fd5e810051d19f31dff90ea7e3f", features = ["hash", "serde", "schemars"] } +iota-sdk2 = { package = "iota-rust-sdk", git = "ssh://git@github.com/iotaledger/iota-rust-sdk.git", rev = "dd7b331a5ec62fd5e810051d19f31dff90ea7e3f", features = [ + "hash", + "serde", + "schemars", +] } iota-simulator = { path = "crates/iota-simulator" } iota-snapshot = { path = "crates/iota-snapshot" } iota-source-validation = { path = "crates/iota-source-validation" } @@ -458,7 +542,9 @@ move-transactional-test-runner = { path = "external-crates/move/crates/move-tran move-unit-test = { path = "external-crates/move/crates/move-unit-test" } move-vm-config = { path = "external-crates/move/crates/move-vm-config" } move-vm-profiler = { path = "external-crates/move/crates/move-vm-profiler" } -move-vm-test-utils = { path = "external-crates/move/crates/move-vm-test-utils/", features = ["tiered-gas"] } +move-vm-test-utils = { path = "external-crates/move/crates/move-vm-test-utils/", features = [ + "tiered-gas", +] } move-vm-types = { path = "external-crates/move/crates/move-vm-types" } prometheus-closure-metric = { path = "crates/prometheus-closure-metric" } shared-crypto = { path = "crates/shared-crypto" } diff --git a/scripts/simtest/simtest-cov.sh b/scripts/simtest/simtest-cov.sh index cefbdb5b9ad..67939730e0e 100755 --- a/scripts/simtest/simtest-cov.sh +++ b/scripts/simtest/simtest-cov.sh @@ -21,12 +21,11 @@ LLVM_PROFDATA="$HOME/.rustup/toolchains/$TOOLCHAIN/lib/rustlib/x86_64-unknown-li echo "Computing simtest code coverage." MSIM_WATCHDOG_TIMEOUT_MS=60000 MSIM_TEST_SEED=1 cargo llvm-cov \ - --workspace \ --ignore-run-fail \ --no-report \ - nextest -vv --cargo-profile simulator + nextest -vv # --cargo-profile simulator -echo "Checking validity of generated .profraw files. This might take a while." +echo "Scanning for corrupted .profraw files. This might take a while." find target/llvm-cov-target -name '*.profraw' | while read file; do if ! "$LLVM_PROFDATA" show "$file" > /dev/null 2>&1; then echo "Removing corrupted file: $file" From ef977b9bdb41cc47a56766853e9d4741e5acade2 Mon Sep 17 00:00:00 2001 From: Alexander Schmidt Date: Fri, 8 Nov 2024 14:29:21 +0100 Subject: [PATCH 073/124] debug log --- .github/workflows/cargo_llvm_cov.yml | 1 - scripts/simtest/simtest-cov.sh | 2 +- 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/.github/workflows/cargo_llvm_cov.yml b/.github/workflows/cargo_llvm_cov.yml index a7f105f6111..effbcf60708 100644 --- a/.github/workflows/cargo_llvm_cov.yml +++ b/.github/workflows/cargo_llvm_cov.yml @@ -25,7 +25,6 @@ jobs: CARGO_PROFILE_TEST_OVERFLOW_CHECKS: false CARGO_PROFILE_TEST_LTO: off CARGO_PROFILE_TEST_CODEGEN_UNITS: 1 - CARGO_LOG: debug # Allow more retries for network requests in cargo (downloading crates) and # rustup (installing toolchains). This should help to reduce flaky CI failures # from transient network timeouts or other issues. diff --git a/scripts/simtest/simtest-cov.sh b/scripts/simtest/simtest-cov.sh index 67939730e0e..dcc0ff33e8e 100755 --- a/scripts/simtest/simtest-cov.sh +++ b/scripts/simtest/simtest-cov.sh @@ -34,7 +34,7 @@ find target/llvm-cov-target -name '*.profraw' | while read file; do done echo "Creating simtest report." -cargo llvm-cov report \ +CARGO_LOG=debug cargo llvm-cov report \ --lcov \ --output-path target/simtest.info \ --ignore-filename-regex 'external-crates/.*' From 2a70d4373a9676a80a62bd2131453541ba606093 Mon Sep 17 00:00:00 2001 From: Alexander Schmidt Date: Fri, 8 Nov 2024 16:41:29 +0100 Subject: [PATCH 074/124] re-enable nextest --- .github/workflows/cargo_llvm_cov.yml | 72 ++++++++++++++-------------- scripts/simtest/simtest-cov.sh | 4 +- 2 files changed, 38 insertions(+), 38 deletions(-) diff --git a/.github/workflows/cargo_llvm_cov.yml b/.github/workflows/cargo_llvm_cov.yml index effbcf60708..46b20e52e1d 100644 --- a/.github/workflows/cargo_llvm_cov.yml +++ b/.github/workflows/cargo_llvm_cov.yml @@ -44,43 +44,42 @@ jobs: with: size: 256G - # - name: Compute code coverage and create report (nextest.info) - # run: | - # cargo llvm-cov clean --profraw-only + - name: Compute code coverage and create report (nextest.info) + run: | + cargo llvm-cov clean --profraw-only - # TOOLCHAIN=$(rustup show active-toolchain | cut -d ' ' -f 1) - # rustup component add llvm-tools --toolchain "$TOOLCHAIN" - # LLVM_PROFDATA="$HOME/.rustup/toolchains/$TOOLCHAIN/lib/rustlib/x86_64-unknown-linux-gnu/bin/llvm-profdata" - # if [ -x "$LLVM_PROFDATA" ]; then - # $LLVM_PROFDATA --version - # else - # echo "Error: llvm-profdata not found or not executable at $LLVM_PROFDATA" - # exit 1 - # fi + TOOLCHAIN=$(rustup show active-toolchain | cut -d ' ' -f 1) + rustup component add llvm-tools --toolchain "$TOOLCHAIN" + LLVM_PROFDATA="$HOME/.rustup/toolchains/$TOOLCHAIN/lib/rustlib/x86_64-unknown-linux-gnu/bin/llvm-profdata" + if [ -x "$LLVM_PROFDATA" ]; then + $LLVM_PROFDATA --version + else + echo "Error: llvm-profdata not found or not executable at $LLVM_PROFDATA" + exit 1 + fi - # echo "Computing nextest code coverage." - # set +e - # IOTA_SKIP_SIMTESTS=1 cargo llvm-cov \ - # --workspace \ - # --ignore-run-fail \ - # --no-report \ - # nextest -vv + echo "Computing nextest code coverage." + set +e + IOTA_SKIP_SIMTESTS=1 cargo llvm-cov \ + --ignore-run-fail \ + --no-report \ + nextest -vv - # echo "Scanning for corrupted .profraw files. This might take a while." - # find target/llvm-cov-target -name '*.profraw' | while read file; do - # if ! "$LLVM_PROFDATA" show "$file" > /dev/null 2>&1; then - # echo "Removing corrupted file: $file" - # rm "$file" - # fi - # done + echo "Scanning for corrupted .profraw files. This might take a while." + find target/llvm-cov-target -name '*.profraw' | while read file; do + if ! "$LLVM_PROFDATA" show "$file" > /dev/null 2>&1; then + echo "Removing corrupted file: $file" + rm "$file" + fi + done - # echo "Creating nextest report." - # cargo llvm-cov report \ - # --lcov \ - # --output-path target/nextest.info \ - # --ignore-filename-regex 'external-crates/.*' + echo "Creating nextest report." + cargo llvm-cov report \ + --lcov \ + --output-path target/nextest.info \ + --ignore-filename-regex 'external-crates/.*' - # [ -f "target/nextest.info" ] || exit 1 + [ -f "target/nextest.info" ] || exit 1 - name: Compute code coverage and create report (simtest.info) run: | @@ -90,6 +89,9 @@ jobs: ./scripts/simtest/simtest-cov.sh # For now we accept failing simtest coverage # [ -f "target/simtest.info" ] || exit 1 + if [ ! -f "target/simtest.info" ]; then + echo "Error: failed to create simtest report." + fi exit 0 - name: Create html report (report.tgz) @@ -103,11 +105,9 @@ jobs: fi echo "Creating html report." if [ -f "simtest.info" ]; then - # genhtml -o report nextest.info simtest.info - genhtml -o report simtest.info + genhtml -o report nextest.info simtest.info else - # genhtml -o report nextest.info - exit 1 + genhtml -o report nextest.info fi [ -d "report" ] || exit 1 echo "Packaging html report." diff --git a/scripts/simtest/simtest-cov.sh b/scripts/simtest/simtest-cov.sh index dcc0ff33e8e..f18f7f096aa 100755 --- a/scripts/simtest/simtest-cov.sh +++ b/scripts/simtest/simtest-cov.sh @@ -16,7 +16,7 @@ git apply ./scripts/simtest/config-patch root_dir=$(git rev-parse --show-toplevel) export SIMTEST_STATIC_INIT_MOVE=$root_dir"/examples/move/basics" -TOOLCHAIN=$(rustup show active-toolchain | awk '{print $1}') +TOOLCHAIN=$(rustup show active-toolchain | cut -d ' ' -f 1) LLVM_PROFDATA="$HOME/.rustup/toolchains/$TOOLCHAIN/lib/rustlib/x86_64-unknown-linux-gnu/bin/llvm-profdata" echo "Computing simtest code coverage." @@ -34,7 +34,7 @@ find target/llvm-cov-target -name '*.profraw' | while read file; do done echo "Creating simtest report." -CARGO_LOG=debug cargo llvm-cov report \ +cargo llvm-cov report \ --lcov \ --output-path target/simtest.info \ --ignore-filename-regex 'external-crates/.*' From 44fcdf10d5f440fd1b5641cf74f6393e96933abb Mon Sep 17 00:00:00 2001 From: Alexander Schmidt Date: Sat, 9 Nov 2024 11:00:53 +0100 Subject: [PATCH 075/124] re-enable debug symbols --- .github/workflows/cargo_llvm_cov.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/cargo_llvm_cov.yml b/.github/workflows/cargo_llvm_cov.yml index 46b20e52e1d..5d6162d2f8c 100644 --- a/.github/workflows/cargo_llvm_cov.yml +++ b/.github/workflows/cargo_llvm_cov.yml @@ -20,7 +20,7 @@ jobs: CARGO_INCREMENTAL: 0 # Find a good balance between runtime performance and accurate code coverage analysis. CARGO_PROFILE_TEST_OPT_LEVEL: 2 - CARGO_PROFILE_TEST_DEBUG: false + CARGO_PROFILE_TEST_DEBUG: true CARGO_PROFILE_TEST_DEBUG_ASSERTIONS: true CARGO_PROFILE_TEST_OVERFLOW_CHECKS: false CARGO_PROFILE_TEST_LTO: off From ad11ce295de85d2c320af98240f0512691ebe59f Mon Sep 17 00:00:00 2001 From: Alexander Schmidt Date: Sat, 9 Nov 2024 18:22:23 +0100 Subject: [PATCH 076/124] reduce opt-level --- .github/workflows/cargo_llvm_cov.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/cargo_llvm_cov.yml b/.github/workflows/cargo_llvm_cov.yml index 5d6162d2f8c..d65c32d9bfa 100644 --- a/.github/workflows/cargo_llvm_cov.yml +++ b/.github/workflows/cargo_llvm_cov.yml @@ -19,7 +19,7 @@ jobs: CARGO_TERM_COLOR: always CARGO_INCREMENTAL: 0 # Find a good balance between runtime performance and accurate code coverage analysis. - CARGO_PROFILE_TEST_OPT_LEVEL: 2 + CARGO_PROFILE_TEST_OPT_LEVEL: 1 CARGO_PROFILE_TEST_DEBUG: true CARGO_PROFILE_TEST_DEBUG_ASSERTIONS: true CARGO_PROFILE_TEST_OVERFLOW_CHECKS: false From d96e68253e93db4c09ebd5e8ae98fc653d03423a Mon Sep 17 00:00:00 2001 From: Alexander Schmidt Date: Mon, 11 Nov 2024 00:40:52 +0100 Subject: [PATCH 077/124] reduce opt-level to 0 --- .github/workflows/cargo_llvm_cov.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/cargo_llvm_cov.yml b/.github/workflows/cargo_llvm_cov.yml index d65c32d9bfa..ca46a92aeab 100644 --- a/.github/workflows/cargo_llvm_cov.yml +++ b/.github/workflows/cargo_llvm_cov.yml @@ -19,7 +19,7 @@ jobs: CARGO_TERM_COLOR: always CARGO_INCREMENTAL: 0 # Find a good balance between runtime performance and accurate code coverage analysis. - CARGO_PROFILE_TEST_OPT_LEVEL: 1 + CARGO_PROFILE_TEST_OPT_LEVEL: 0 CARGO_PROFILE_TEST_DEBUG: true CARGO_PROFILE_TEST_DEBUG_ASSERTIONS: true CARGO_PROFILE_TEST_OVERFLOW_CHECKS: false From f6284312257c4bce1b2334711dc9440c6ec7819c Mon Sep 17 00:00:00 2001 From: Alexander Schmidt Date: Mon, 11 Nov 2024 16:09:35 +0100 Subject: [PATCH 078/124] refactor --- .github/workflows/cargo_llvm_cov.yml | 84 +++++++++++++++------------- 1 file changed, 45 insertions(+), 39 deletions(-) diff --git a/.github/workflows/cargo_llvm_cov.yml b/.github/workflows/cargo_llvm_cov.yml index ca46a92aeab..f9bebc0bd1e 100644 --- a/.github/workflows/cargo_llvm_cov.yml +++ b/.github/workflows/cargo_llvm_cov.yml @@ -19,7 +19,7 @@ jobs: CARGO_TERM_COLOR: always CARGO_INCREMENTAL: 0 # Find a good balance between runtime performance and accurate code coverage analysis. - CARGO_PROFILE_TEST_OPT_LEVEL: 0 + CARGO_PROFILE_TEST_OPT_LEVEL: 1 CARGO_PROFILE_TEST_DEBUG: true CARGO_PROFILE_TEST_DEBUG_ASSERTIONS: true CARGO_PROFILE_TEST_OVERFLOW_CHECKS: false @@ -44,20 +44,23 @@ jobs: with: size: 256G - - name: Compute code coverage and create report (nextest.info) + - name: Install llvm-tools run: | - cargo llvm-cov clean --profraw-only - TOOLCHAIN=$(rustup show active-toolchain | cut -d ' ' -f 1) rustup component add llvm-tools --toolchain "$TOOLCHAIN" - LLVM_PROFDATA="$HOME/.rustup/toolchains/$TOOLCHAIN/lib/rustlib/x86_64-unknown-linux-gnu/bin/llvm-profdata" + echo "LLVM_PROFDATA=$HOME/.rustup/toolchains/$TOOLCHAIN/lib/rustlib/x86_64-unknown-linux-gnu/bin/llvm-profdata" >> $GITHUB_ENV + if [ -x "$LLVM_PROFDATA" ]; then $LLVM_PROFDATA --version else - echo "Error: llvm-profdata not found or not executable at $LLVM_PROFDATA" + echo "Error: llvm-profdata not found at $LLVM_PROFDATA or not executable." exit 1 fi + - name: Compute code coverage and create report (nextest.info) + run: | + cargo llvm-cov clean --profraw-only + echo "Computing nextest code coverage." set +e IOTA_SKIP_SIMTESTS=1 cargo llvm-cov \ @@ -65,52 +68,55 @@ jobs: --no-report \ nextest -vv - echo "Scanning for corrupted .profraw files. This might take a while." - find target/llvm-cov-target -name '*.profraw' | while read file; do - if ! "$LLVM_PROFDATA" show "$file" > /dev/null 2>&1; then - echo "Removing corrupted file: $file" - rm "$file" - fi - done - - echo "Creating nextest report." - cargo llvm-cov report \ - --lcov \ - --output-path target/nextest.info \ - --ignore-filename-regex 'external-crates/.*' + # echo "Scanning for corrupted .profraw files. This might take a while." + # find target/llvm-cov-target -name '*.profraw' | while read file; do + # if ! "$LLVM_PROFDATA" show "$file" > /dev/null 2>&1; then + # echo "Removing corrupted file: $file" + # rm "$file" + # fi + # done - [ -f "target/nextest.info" ] || exit 1 + $LLVM_PROFDATA merge --failure-mode=warn --sparse target/llvm-cov-target/*.profraw -o nextest.profdata + [ -f "target/nextest.profdata" ] || exit 1 - - name: Compute code coverage and create report (simtest.info) - run: | - cargo llvm-cov clean --profraw-only - git clean -fd - set +e - ./scripts/simtest/simtest-cov.sh - # For now we accept failing simtest coverage - # [ -f "target/simtest.info" ] || exit 1 - if [ ! -f "target/simtest.info" ]; then - echo "Error: failed to create simtest report." - fi - exit 0 + # - name: Compute code coverage and create report (simtest.info) + # run: | + # cargo llvm-cov clean --profraw-only + # git clean -fd + # set +e + # ./scripts/simtest/simtest-cov.sh + # # For now we accept failing simtest coverage + # # [ -f "target/simtest.info" ] || exit 1 + # if [ ! -f "target/simtest.info" ]; then + # echo "Error: failed to create simtest report." + # fi + # exit 0 - name: Create html report (report.tgz) run: | - if ! command -v lcov &> /dev/null; then - sudo apt-get install -y lcov - fi cd target || exit 1 + if [ -d "report" ]; then + echo "Cleaning up." rm -rf report fi + echo "Creating html report." - if [ -f "simtest.info" ]; then - genhtml -o report nextest.info simtest.info + if [ -f "simtest.profdata" ]; then + $LLVM_PROFDATA merge --failure-mode=warn --sparse llvm-cov-target/nextest.profdata llvm-cov/target/simtest.profdata -o merged.profdata else - genhtml -o report nextest.info + $LLVM_PROFDATA merge --failure-mode=warn --sparse llvm-cov-target/nextest.profdata -o merged.profdata fi - [ -d "report" ] || exit 1 + + echo "Creating html report." + [ -f "merged.profdata" ] || exit 1 + LLVM_PROFILE_FILE="merged.profdata" cargo llvm-cov report \ + --html \ + --output-dir report \ + --ignore-filename-regex 'external-crates/.*' + echo "Packaging html report." + [ -d "report" ] || exit 1 tar -czf report.tgz report [ -f "report.tgz" ] || exit 1 From 19604d2f54b2eaea6eb06d1745d6d2d958bf7155 Mon Sep 17 00:00:00 2001 From: Alexander Schmidt Date: Tue, 12 Nov 2024 15:21:44 +0100 Subject: [PATCH 079/124] env --- .github/workflows/cargo_llvm_cov.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/cargo_llvm_cov.yml b/.github/workflows/cargo_llvm_cov.yml index f9bebc0bd1e..a2d6c19303f 100644 --- a/.github/workflows/cargo_llvm_cov.yml +++ b/.github/workflows/cargo_llvm_cov.yml @@ -48,7 +48,8 @@ jobs: run: | TOOLCHAIN=$(rustup show active-toolchain | cut -d ' ' -f 1) rustup component add llvm-tools --toolchain "$TOOLCHAIN" - echo "LLVM_PROFDATA=$HOME/.rustup/toolchains/$TOOLCHAIN/lib/rustlib/x86_64-unknown-linux-gnu/bin/llvm-profdata" >> $GITHUB_ENV + LLVM_PROFDATA=$HOME/.rustup/toolchains/$TOOLCHAIN/lib/rustlib/x86_64-unknown-linux-gnu/bin/llvm-profdata + echo "$LLVM_PROFDATA" >> $GITHUB_ENV if [ -x "$LLVM_PROFDATA" ]; then $LLVM_PROFDATA --version From 0d2be43c1dda9d72054456dbb8267d10ad06e17c Mon Sep 17 00:00:00 2001 From: Alexander Schmidt Date: Tue, 12 Nov 2024 15:34:00 +0100 Subject: [PATCH 080/124] fix env --- .github/workflows/cargo_llvm_cov.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/cargo_llvm_cov.yml b/.github/workflows/cargo_llvm_cov.yml index a2d6c19303f..118e0c2b169 100644 --- a/.github/workflows/cargo_llvm_cov.yml +++ b/.github/workflows/cargo_llvm_cov.yml @@ -49,7 +49,7 @@ jobs: TOOLCHAIN=$(rustup show active-toolchain | cut -d ' ' -f 1) rustup component add llvm-tools --toolchain "$TOOLCHAIN" LLVM_PROFDATA=$HOME/.rustup/toolchains/$TOOLCHAIN/lib/rustlib/x86_64-unknown-linux-gnu/bin/llvm-profdata - echo "$LLVM_PROFDATA" >> $GITHUB_ENV + echo "LLVM_PROFDATA=$LLVM_PROFDATA" >> $GITHUB_ENV if [ -x "$LLVM_PROFDATA" ]; then $LLVM_PROFDATA --version From 499e94d63589ebdeb6021fe59995bdcb1a51baad Mon Sep 17 00:00:00 2001 From: Alexander Schmidt Date: Tue, 12 Nov 2024 18:34:08 +0100 Subject: [PATCH 081/124] pass as list to llvm-profdata --- .github/workflows/cargo_llvm_cov.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/cargo_llvm_cov.yml b/.github/workflows/cargo_llvm_cov.yml index 118e0c2b169..d69948abfec 100644 --- a/.github/workflows/cargo_llvm_cov.yml +++ b/.github/workflows/cargo_llvm_cov.yml @@ -77,7 +77,7 @@ jobs: # fi # done - $LLVM_PROFDATA merge --failure-mode=warn --sparse target/llvm-cov-target/*.profraw -o nextest.profdata + find target/llvm-cov-target -name '*.profraw' -print0 | xargs -0 $LLVM_PROFDATA merge --failure-mode=warn --sparse --output target/nextest.profdata [ -f "target/nextest.profdata" ] || exit 1 # - name: Compute code coverage and create report (simtest.info) From 9b3f25160552f36ccdb955827946822a6eac77f6 Mon Sep 17 00:00:00 2001 From: Alexander Schmidt Date: Tue, 12 Nov 2024 19:18:33 +0100 Subject: [PATCH 082/124] too bad --- .github/workflows/cargo_llvm_cov.yml | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/.github/workflows/cargo_llvm_cov.yml b/.github/workflows/cargo_llvm_cov.yml index d69948abfec..e8b2c0c45c5 100644 --- a/.github/workflows/cargo_llvm_cov.yml +++ b/.github/workflows/cargo_llvm_cov.yml @@ -69,13 +69,13 @@ jobs: --no-report \ nextest -vv - # echo "Scanning for corrupted .profraw files. This might take a while." - # find target/llvm-cov-target -name '*.profraw' | while read file; do - # if ! "$LLVM_PROFDATA" show "$file" > /dev/null 2>&1; then - # echo "Removing corrupted file: $file" - # rm "$file" - # fi - # done + echo "Scanning for corrupted .profraw files. This might take a while." + find target/llvm-cov-target -name '*.profraw' | while read file; do + if ! "$LLVM_PROFDATA" show "$file" > /dev/null 2>&1; then + echo "Removing corrupted file: $file" + rm "$file" + fi + done find target/llvm-cov-target -name '*.profraw' -print0 | xargs -0 $LLVM_PROFDATA merge --failure-mode=warn --sparse --output target/nextest.profdata [ -f "target/nextest.profdata" ] || exit 1 From 1e41722e408244ab71492c83fcd10cdb892192ec Mon Sep 17 00:00:00 2001 From: Alexander Schmidt Date: Tue, 12 Nov 2024 21:27:25 +0100 Subject: [PATCH 083/124] fix paths --- .github/workflows/cargo_llvm_cov.yml | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/.github/workflows/cargo_llvm_cov.yml b/.github/workflows/cargo_llvm_cov.yml index e8b2c0c45c5..21e5c14e9e7 100644 --- a/.github/workflows/cargo_llvm_cov.yml +++ b/.github/workflows/cargo_llvm_cov.yml @@ -104,12 +104,10 @@ jobs: echo "Creating html report." if [ -f "simtest.profdata" ]; then - $LLVM_PROFDATA merge --failure-mode=warn --sparse llvm-cov-target/nextest.profdata llvm-cov/target/simtest.profdata -o merged.profdata + $LLVM_PROFDATA merge --failure-mode=warn --sparse nextest.profdata simtest.profdata --output merged.profdata else - $LLVM_PROFDATA merge --failure-mode=warn --sparse llvm-cov-target/nextest.profdata -o merged.profdata + $LLVM_PROFDATA merge --failure-mode=warn --sparse nextest.profdata --output merged.profdata fi - - echo "Creating html report." [ -f "merged.profdata" ] || exit 1 LLVM_PROFILE_FILE="merged.profdata" cargo llvm-cov report \ --html \ From 2df29ea23197f077876cdc47a69fa54ad63ddaad Mon Sep 17 00:00:00 2001 From: Alexander Schmidt Date: Tue, 12 Nov 2024 23:38:41 +0100 Subject: [PATCH 084/124] nightly advanced infos --- .github/workflows/cargo_llvm_cov.yml | 39 ++++++++++++++++++---------- scripts/simtest/simtest-cov.sh | 10 +++---- 2 files changed, 29 insertions(+), 20 deletions(-) diff --git a/.github/workflows/cargo_llvm_cov.yml b/.github/workflows/cargo_llvm_cov.yml index 21e5c14e9e7..edf19e52842 100644 --- a/.github/workflows/cargo_llvm_cov.yml +++ b/.github/workflows/cargo_llvm_cov.yml @@ -46,7 +46,8 @@ jobs: - name: Install llvm-tools run: | - TOOLCHAIN=$(rustup show active-toolchain | cut -d ' ' -f 1) + # TOOLCHAIN=$(rustup show active-toolchain | cut -d ' ' -f 1) + TOOLCHAIN=nightly rustup component add llvm-tools --toolchain "$TOOLCHAIN" LLVM_PROFDATA=$HOME/.rustup/toolchains/$TOOLCHAIN/lib/rustlib/x86_64-unknown-linux-gnu/bin/llvm-profdata echo "LLVM_PROFDATA=$LLVM_PROFDATA" >> $GITHUB_ENV @@ -58,13 +59,14 @@ jobs: exit 1 fi - - name: Compute code coverage and create report (nextest.info) + - name: Compute code coverage (nextest.profdata) run: | - cargo llvm-cov clean --profraw-only + cargo +nightly llvm-cov clean --profraw-only echo "Computing nextest code coverage." set +e - IOTA_SKIP_SIMTESTS=1 cargo llvm-cov \ + IOTA_SKIP_SIMTESTS=1 cargo +nightly llvm-cov \ + --branch \ --ignore-run-fail \ --no-report \ nextest -vv @@ -80,25 +82,26 @@ jobs: find target/llvm-cov-target -name '*.profraw' -print0 | xargs -0 $LLVM_PROFDATA merge --failure-mode=warn --sparse --output target/nextest.profdata [ -f "target/nextest.profdata" ] || exit 1 - # - name: Compute code coverage and create report (simtest.info) + # - name: Compute code coverage (simtest.profdata) # run: | - # cargo llvm-cov clean --profraw-only + # cargo +nightly llvm-cov clean --profraw-only + # git clean -fd # set +e # ./scripts/simtest/simtest-cov.sh # # For now we accept failing simtest coverage - # # [ -f "target/simtest.info" ] || exit 1 - # if [ ! -f "target/simtest.info" ]; then - # echo "Error: failed to create simtest report." + # # [ -f "target/simtest.profdata" ] || exit 1 + # if [ ! -f "target/simtest.profdata" ]; then + # echo "Error: failed to create simtest.profdata." # fi # exit 0 - name: Create html report (report.tgz) run: | - cd target || exit 1 + cd target if [ -d "report" ]; then - echo "Cleaning up." + echo "Cleaning old report." rm -rf report fi @@ -106,14 +109,22 @@ jobs: if [ -f "simtest.profdata" ]; then $LLVM_PROFDATA merge --failure-mode=warn --sparse nextest.profdata simtest.profdata --output merged.profdata else - $LLVM_PROFDATA merge --failure-mode=warn --sparse nextest.profdata --output merged.profdata + mv nextest.profdata merged.profdata fi + [ -f "merged.profdata" ] || exit 1 - LLVM_PROFILE_FILE="merged.profdata" cargo llvm-cov report \ + + LLVM_PROFILE_FILE="merged.profdata" cargo +nightly llvm-cov report \ --html \ - --output-dir report \ + --show-instantiations \ + --show-missing-lines \ + --doctests \ + --output-dir . \ --ignore-filename-regex 'external-crates/.*' + [ -d "html" ] || exit 1 + mv html report + echo "Packaging html report." [ -d "report" ] || exit 1 tar -czf report.tgz report diff --git a/scripts/simtest/simtest-cov.sh b/scripts/simtest/simtest-cov.sh index f18f7f096aa..498742d7bef 100755 --- a/scripts/simtest/simtest-cov.sh +++ b/scripts/simtest/simtest-cov.sh @@ -16,11 +16,13 @@ git apply ./scripts/simtest/config-patch root_dir=$(git rev-parse --show-toplevel) export SIMTEST_STATIC_INIT_MOVE=$root_dir"/examples/move/basics" -TOOLCHAIN=$(rustup show active-toolchain | cut -d ' ' -f 1) +#TOOLCHAIN=$(rustup show active-toolchain | cut -d ' ' -f 1) +TOOLCHAIN=nightly LLVM_PROFDATA="$HOME/.rustup/toolchains/$TOOLCHAIN/lib/rustlib/x86_64-unknown-linux-gnu/bin/llvm-profdata" echo "Computing simtest code coverage." MSIM_WATCHDOG_TIMEOUT_MS=60000 MSIM_TEST_SEED=1 cargo llvm-cov \ + --branch \ --ignore-run-fail \ --no-report \ nextest -vv # --cargo-profile simulator @@ -33,11 +35,7 @@ find target/llvm-cov-target -name '*.profraw' | while read file; do fi done -echo "Creating simtest report." -cargo llvm-cov report \ - --lcov \ - --output-path target/simtest.info \ - --ignore-filename-regex 'external-crates/.*' +find target/llvm-cov-target -name '*.profraw' -print0 | xargs -0 $LLVM_PROFDATA merge --failure-mode=warn --sparse --output target/simtest.profdata # remove the patch git checkout .cargo/config Cargo.toml Cargo.lock From 5836bda66ea4a9f4016c822fffee1c6e16f39e8c Mon Sep 17 00:00:00 2001 From: Alexander Schmidt Date: Tue, 12 Nov 2024 23:52:54 +0100 Subject: [PATCH 085/124] fix toolchain --- .github/workflows/cargo_llvm_cov.yml | 2 +- scripts/simtest/simtest-cov.sh | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/cargo_llvm_cov.yml b/.github/workflows/cargo_llvm_cov.yml index edf19e52842..fdac8f6fcaf 100644 --- a/.github/workflows/cargo_llvm_cov.yml +++ b/.github/workflows/cargo_llvm_cov.yml @@ -47,7 +47,7 @@ jobs: - name: Install llvm-tools run: | # TOOLCHAIN=$(rustup show active-toolchain | cut -d ' ' -f 1) - TOOLCHAIN=nightly + TOOLCHAIN=nightly-x86_64-unknown-linux-gnu rustup component add llvm-tools --toolchain "$TOOLCHAIN" LLVM_PROFDATA=$HOME/.rustup/toolchains/$TOOLCHAIN/lib/rustlib/x86_64-unknown-linux-gnu/bin/llvm-profdata echo "LLVM_PROFDATA=$LLVM_PROFDATA" >> $GITHUB_ENV diff --git a/scripts/simtest/simtest-cov.sh b/scripts/simtest/simtest-cov.sh index 498742d7bef..2a91d265068 100755 --- a/scripts/simtest/simtest-cov.sh +++ b/scripts/simtest/simtest-cov.sh @@ -17,7 +17,7 @@ root_dir=$(git rev-parse --show-toplevel) export SIMTEST_STATIC_INIT_MOVE=$root_dir"/examples/move/basics" #TOOLCHAIN=$(rustup show active-toolchain | cut -d ' ' -f 1) -TOOLCHAIN=nightly +TOOLCHAIN=nightly-x86_64-unknown-linux-gnu LLVM_PROFDATA="$HOME/.rustup/toolchains/$TOOLCHAIN/lib/rustlib/x86_64-unknown-linux-gnu/bin/llvm-profdata" echo "Computing simtest code coverage." From a10ba8c16ef70e4d1f0ade92b1f78624a228dd39 Mon Sep 17 00:00:00 2001 From: Alexander Schmidt Date: Wed, 13 Nov 2024 00:51:04 +0100 Subject: [PATCH 086/124] can't have everything --- .github/workflows/cargo_llvm_cov.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/cargo_llvm_cov.yml b/.github/workflows/cargo_llvm_cov.yml index fdac8f6fcaf..25114256506 100644 --- a/.github/workflows/cargo_llvm_cov.yml +++ b/.github/workflows/cargo_llvm_cov.yml @@ -116,9 +116,9 @@ jobs: LLVM_PROFILE_FILE="merged.profdata" cargo +nightly llvm-cov report \ --html \ - --show-instantiations \ - --show-missing-lines \ - --doctests \ + #--show-instantiations \ + #--show-missing-lines \ + #--doctests \ --output-dir . \ --ignore-filename-regex 'external-crates/.*' From b0a44221a5cce75a7fddb561b425f289b9d91a2e Mon Sep 17 00:00:00 2001 From: Alexander Schmidt Date: Wed, 13 Nov 2024 10:19:31 +0100 Subject: [PATCH 087/124] try again --- .github/workflows/cargo_llvm_cov.yml | 3 --- 1 file changed, 3 deletions(-) diff --git a/.github/workflows/cargo_llvm_cov.yml b/.github/workflows/cargo_llvm_cov.yml index 25114256506..3c4ad05869b 100644 --- a/.github/workflows/cargo_llvm_cov.yml +++ b/.github/workflows/cargo_llvm_cov.yml @@ -116,9 +116,6 @@ jobs: LLVM_PROFILE_FILE="merged.profdata" cargo +nightly llvm-cov report \ --html \ - #--show-instantiations \ - #--show-missing-lines \ - #--doctests \ --output-dir . \ --ignore-filename-regex 'external-crates/.*' From cbd12fef8f3d36b6a38d4d029c858231297f3986 Mon Sep 17 00:00:00 2001 From: Alexander Schmidt Date: Wed, 13 Nov 2024 11:24:44 +0100 Subject: [PATCH 088/124] test if --branch caused the OOM --- .github/workflows/cargo_llvm_cov.yml | 1 - scripts/simtest/simtest-cov.sh | 1 - 2 files changed, 2 deletions(-) diff --git a/.github/workflows/cargo_llvm_cov.yml b/.github/workflows/cargo_llvm_cov.yml index 3c4ad05869b..72b986069b0 100644 --- a/.github/workflows/cargo_llvm_cov.yml +++ b/.github/workflows/cargo_llvm_cov.yml @@ -66,7 +66,6 @@ jobs: echo "Computing nextest code coverage." set +e IOTA_SKIP_SIMTESTS=1 cargo +nightly llvm-cov \ - --branch \ --ignore-run-fail \ --no-report \ nextest -vv diff --git a/scripts/simtest/simtest-cov.sh b/scripts/simtest/simtest-cov.sh index 2a91d265068..88123d4d48e 100755 --- a/scripts/simtest/simtest-cov.sh +++ b/scripts/simtest/simtest-cov.sh @@ -22,7 +22,6 @@ LLVM_PROFDATA="$HOME/.rustup/toolchains/$TOOLCHAIN/lib/rustlib/x86_64-unknown-li echo "Computing simtest code coverage." MSIM_WATCHDOG_TIMEOUT_MS=60000 MSIM_TEST_SEED=1 cargo llvm-cov \ - --branch \ --ignore-run-fail \ --no-report \ nextest -vv # --cargo-profile simulator From 8abecc730a6b35187e510188337ed1fdc8997e8f Mon Sep 17 00:00:00 2001 From: Alexander Schmidt Date: Wed, 13 Nov 2024 14:19:33 +0100 Subject: [PATCH 089/124] re-include simtests --- .github/workflows/cargo_llvm_cov.yml | 29 +++++++++++++--------------- scripts/simtest/simtest-cov.sh | 6 ++++-- 2 files changed, 17 insertions(+), 18 deletions(-) diff --git a/.github/workflows/cargo_llvm_cov.yml b/.github/workflows/cargo_llvm_cov.yml index 72b986069b0..c3714d9e8b4 100644 --- a/.github/workflows/cargo_llvm_cov.yml +++ b/.github/workflows/cargo_llvm_cov.yml @@ -46,12 +46,10 @@ jobs: - name: Install llvm-tools run: | - # TOOLCHAIN=$(rustup show active-toolchain | cut -d ' ' -f 1) TOOLCHAIN=nightly-x86_64-unknown-linux-gnu rustup component add llvm-tools --toolchain "$TOOLCHAIN" LLVM_PROFDATA=$HOME/.rustup/toolchains/$TOOLCHAIN/lib/rustlib/x86_64-unknown-linux-gnu/bin/llvm-profdata echo "LLVM_PROFDATA=$LLVM_PROFDATA" >> $GITHUB_ENV - if [ -x "$LLVM_PROFDATA" ]; then $LLVM_PROFDATA --version else @@ -78,22 +76,21 @@ jobs: fi done - find target/llvm-cov-target -name '*.profraw' -print0 | xargs -0 $LLVM_PROFDATA merge --failure-mode=warn --sparse --output target/nextest.profdata + find target/llvm-cov-target -name '*.profraw' -print0 | xargs -0 $LLVM_PROFDATA merge \ + --failure-mode=warn \ + --sparse \ + --output target/nextest.profdata + [ -f "target/nextest.profdata" ] || exit 1 - # - name: Compute code coverage (simtest.profdata) - # run: | - # cargo +nightly llvm-cov clean --profraw-only - - # git clean -fd - # set +e - # ./scripts/simtest/simtest-cov.sh - # # For now we accept failing simtest coverage - # # [ -f "target/simtest.profdata" ] || exit 1 - # if [ ! -f "target/simtest.profdata" ]; then - # echo "Error: failed to create simtest.profdata." - # fi - # exit 0 + - name: Compute code coverage (simtest.profdata) + run: | + cargo +nightly llvm-cov clean --profraw-only + + git clean -fd + set +e + ./scripts/simtest/simtest-cov.sh + [ -f "target/simtest.profdata" ] || exit 1 - name: Create html report (report.tgz) run: | diff --git a/scripts/simtest/simtest-cov.sh b/scripts/simtest/simtest-cov.sh index 88123d4d48e..99b0a3e755d 100755 --- a/scripts/simtest/simtest-cov.sh +++ b/scripts/simtest/simtest-cov.sh @@ -16,7 +16,6 @@ git apply ./scripts/simtest/config-patch root_dir=$(git rev-parse --show-toplevel) export SIMTEST_STATIC_INIT_MOVE=$root_dir"/examples/move/basics" -#TOOLCHAIN=$(rustup show active-toolchain | cut -d ' ' -f 1) TOOLCHAIN=nightly-x86_64-unknown-linux-gnu LLVM_PROFDATA="$HOME/.rustup/toolchains/$TOOLCHAIN/lib/rustlib/x86_64-unknown-linux-gnu/bin/llvm-profdata" @@ -34,7 +33,10 @@ find target/llvm-cov-target -name '*.profraw' | while read file; do fi done -find target/llvm-cov-target -name '*.profraw' -print0 | xargs -0 $LLVM_PROFDATA merge --failure-mode=warn --sparse --output target/simtest.profdata +find target/llvm-cov-target -name '*.profraw' -print0 | xargs -0 $LLVM_PROFDATA merge \ + --failure-mode=warn \ + --sparse \ + --output target/simtest.profdata # remove the patch git checkout .cargo/config Cargo.toml Cargo.lock From 855749e727ce3d0f8687ec78c0fbe38bc5ab3bb3 Mon Sep 17 00:00:00 2001 From: Alexander Schmidt Date: Thu, 14 Nov 2024 17:48:48 +0100 Subject: [PATCH 090/124] disable debug symbols --- .github/workflows/cargo_llvm_cov.yml | 22 +++++++++++++--------- 1 file changed, 13 insertions(+), 9 deletions(-) diff --git a/.github/workflows/cargo_llvm_cov.yml b/.github/workflows/cargo_llvm_cov.yml index c3714d9e8b4..aa3384d9db5 100644 --- a/.github/workflows/cargo_llvm_cov.yml +++ b/.github/workflows/cargo_llvm_cov.yml @@ -20,8 +20,8 @@ jobs: CARGO_INCREMENTAL: 0 # Find a good balance between runtime performance and accurate code coverage analysis. CARGO_PROFILE_TEST_OPT_LEVEL: 1 - CARGO_PROFILE_TEST_DEBUG: true - CARGO_PROFILE_TEST_DEBUG_ASSERTIONS: true + CARGO_PROFILE_TEST_DEBUG: false + CARGO_PROFILE_TEST_DEBUG_ASSERTIONS: false CARGO_PROFILE_TEST_OVERFLOW_CHECKS: false CARGO_PROFILE_TEST_LTO: off CARGO_PROFILE_TEST_CODEGEN_UNITS: 1 @@ -64,6 +64,7 @@ jobs: echo "Computing nextest code coverage." set +e IOTA_SKIP_SIMTESTS=1 cargo +nightly llvm-cov \ + --branch \ --ignore-run-fail \ --no-report \ nextest -vv @@ -83,14 +84,14 @@ jobs: [ -f "target/nextest.profdata" ] || exit 1 - - name: Compute code coverage (simtest.profdata) - run: | - cargo +nightly llvm-cov clean --profraw-only + # - name: Compute code coverage (simtest.profdata) + # run: | + # cargo +nightly llvm-cov clean --profraw-only - git clean -fd - set +e - ./scripts/simtest/simtest-cov.sh - [ -f "target/simtest.profdata" ] || exit 1 + # git clean -fd + # set +e + # ./scripts/simtest/simtest-cov.sh + # [ -f "target/simtest.profdata" ] || exit 1 - name: Create html report (report.tgz) run: | @@ -112,8 +113,11 @@ jobs: LLVM_PROFILE_FILE="merged.profdata" cargo +nightly llvm-cov report \ --html \ + --show-missing-lines \ --output-dir . \ --ignore-filename-regex 'external-crates/.*' + #--show-instantiations \ + #--doctests \ [ -d "html" ] || exit 1 mv html report From 809b640911ee8341040bcb31bee18c99418849a6 Mon Sep 17 00:00:00 2001 From: Alexander Schmidt Date: Thu, 14 Nov 2024 22:29:11 +0100 Subject: [PATCH 091/124] single package --- .github/workflows/cargo_llvm_cov.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/cargo_llvm_cov.yml b/.github/workflows/cargo_llvm_cov.yml index aa3384d9db5..9fd08ed3806 100644 --- a/.github/workflows/cargo_llvm_cov.yml +++ b/.github/workflows/cargo_llvm_cov.yml @@ -113,6 +113,7 @@ jobs: LLVM_PROFILE_FILE="merged.profdata" cargo +nightly llvm-cov report \ --html \ + --package iota-sdk \ --show-missing-lines \ --output-dir . \ --ignore-filename-regex 'external-crates/.*' From 7de2a39a5eb8581627a9aa179f0301a852c059aa Mon Sep 17 00:00:00 2001 From: /alex/ Date: Thu, 21 Nov 2024 15:20:18 +0100 Subject: [PATCH 092/124] disable branch coverage --- .github/workflows/cargo_llvm_cov.yml | 25 ++++++++++--------------- 1 file changed, 10 insertions(+), 15 deletions(-) diff --git a/.github/workflows/cargo_llvm_cov.yml b/.github/workflows/cargo_llvm_cov.yml index 9fd08ed3806..cbb0dc5ddbd 100644 --- a/.github/workflows/cargo_llvm_cov.yml +++ b/.github/workflows/cargo_llvm_cov.yml @@ -57,14 +57,12 @@ jobs: exit 1 fi - - name: Compute code coverage (nextest.profdata) + - name: Run code coverage (nextest) run: | cargo +nightly llvm-cov clean --profraw-only - echo "Computing nextest code coverage." set +e IOTA_SKIP_SIMTESTS=1 cargo +nightly llvm-cov \ - --branch \ --ignore-run-fail \ --no-report \ nextest -vv @@ -84,16 +82,17 @@ jobs: [ -f "target/nextest.profdata" ] || exit 1 - # - name: Compute code coverage (simtest.profdata) - # run: | - # cargo +nightly llvm-cov clean --profraw-only + - name: Run code coverage (simtest) + run: | + cargo +nightly llvm-cov clean --profraw-only - # git clean -fd - # set +e - # ./scripts/simtest/simtest-cov.sh - # [ -f "target/simtest.profdata" ] || exit 1 + git clean -fd + + set +e + ./scripts/simtest/simtest-cov.sh + [ -f "target/simtest.profdata" ] || exit 1 - - name: Create html report (report.tgz) + - name: Create html report run: | cd target @@ -102,7 +101,6 @@ jobs: rm -rf report fi - echo "Creating html report." if [ -f "simtest.profdata" ]; then $LLVM_PROFDATA merge --failure-mode=warn --sparse nextest.profdata simtest.profdata --output merged.profdata else @@ -114,11 +112,8 @@ jobs: LLVM_PROFILE_FILE="merged.profdata" cargo +nightly llvm-cov report \ --html \ --package iota-sdk \ - --show-missing-lines \ --output-dir . \ --ignore-filename-regex 'external-crates/.*' - #--show-instantiations \ - #--doctests \ [ -d "html" ] || exit 1 mv html report From 09bb6b0cbd4fefad30dc3c6b59e461dbe2ecaab2 Mon Sep 17 00:00:00 2001 From: /alex/ Date: Thu, 21 Nov 2024 15:20:58 +0100 Subject: [PATCH 093/124] nit --- scripts/simtest/simtest-cov.sh | 1 - 1 file changed, 1 deletion(-) diff --git a/scripts/simtest/simtest-cov.sh b/scripts/simtest/simtest-cov.sh index 99b0a3e755d..7e279cec890 100755 --- a/scripts/simtest/simtest-cov.sh +++ b/scripts/simtest/simtest-cov.sh @@ -19,7 +19,6 @@ export SIMTEST_STATIC_INIT_MOVE=$root_dir"/examples/move/basics" TOOLCHAIN=nightly-x86_64-unknown-linux-gnu LLVM_PROFDATA="$HOME/.rustup/toolchains/$TOOLCHAIN/lib/rustlib/x86_64-unknown-linux-gnu/bin/llvm-profdata" -echo "Computing simtest code coverage." MSIM_WATCHDOG_TIMEOUT_MS=60000 MSIM_TEST_SEED=1 cargo llvm-cov \ --ignore-run-fail \ --no-report \ From 26b1423302106fe4d3fb09705fadca11274d1bd7 Mon Sep 17 00:00:00 2001 From: /alex/ Date: Mon, 25 Nov 2024 10:47:51 +0100 Subject: [PATCH 094/124] publish to coveralls --- .github/workflows/cargo_llvm_cov.yml | 49 ++++++++++------------------ 1 file changed, 18 insertions(+), 31 deletions(-) diff --git a/.github/workflows/cargo_llvm_cov.yml b/.github/workflows/cargo_llvm_cov.yml index cbb0dc5ddbd..65bf9ac9c92 100644 --- a/.github/workflows/cargo_llvm_cov.yml +++ b/.github/workflows/cargo_llvm_cov.yml @@ -82,25 +82,20 @@ jobs: [ -f "target/nextest.profdata" ] || exit 1 - - name: Run code coverage (simtest) - run: | - cargo +nightly llvm-cov clean --profraw-only + # - name: Run code coverage (simtest) + # run: | + # cargo +nightly llvm-cov clean --profraw-only - git clean -fd + # git clean -fd - set +e - ./scripts/simtest/simtest-cov.sh - [ -f "target/simtest.profdata" ] || exit 1 + # set +e + # ./scripts/simtest/simtest-cov.sh + # [ -f "target/simtest.profdata" ] || exit 1 - - name: Create html report + - name: Create report (lcov.info) run: | cd target - if [ -d "report" ]; then - echo "Cleaning old report." - rm -rf report - fi - if [ -f "simtest.profdata" ]; then $LLVM_PROFDATA merge --failure-mode=warn --sparse nextest.profdata simtest.profdata --output merged.profdata else @@ -110,29 +105,21 @@ jobs: [ -f "merged.profdata" ] || exit 1 LLVM_PROFILE_FILE="merged.profdata" cargo +nightly llvm-cov report \ - --html \ - --package iota-sdk \ - --output-dir . \ + --lcov \ + --output-path ./lcov.info \ --ignore-filename-regex 'external-crates/.*' - [ -d "html" ] || exit 1 - mv html report - - echo "Packaging html report." - [ -d "report" ] || exit 1 - tar -czf report.tgz report - [ -f "report.tgz" ] || exit 1 - - - name: Publish html report and trigger update - run: | - rsync -av target/report.tgz ${{ secrets.CODEGOV_REPORT_HOST }}:transfer/cargo-llvm-cov/ - ssh ${{ secrets.CODEGOV_REPORT_HOST }} + - name: Upload coverage to Coveralls + uses: coverallsapp/github-action@v2 + with: + github-token: ${{ secrets.GITHUB_TOKEN }} + path-to-lcov: target/lcov.info - - name: Backup html report + - name: Backup report uses: actions/upload-artifact@b4b15b8c7c6ac21ea08fcf65892d2ee8f75cf882 # pin@v4 if: always() with: - name: report - path: target/report.tgz + name: lcov.info + path: target/lcov.info if-no-files-found: error retention-days: 30 From 88f8e61801d8a18153d88c06915d907f509c3a33 Mon Sep 17 00:00:00 2001 From: /alex/ Date: Tue, 26 Nov 2024 16:51:44 +0100 Subject: [PATCH 095/124] set base-path --- .github/workflows/cargo_llvm_cov.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/cargo_llvm_cov.yml b/.github/workflows/cargo_llvm_cov.yml index 65bf9ac9c92..e86d9e4774c 100644 --- a/.github/workflows/cargo_llvm_cov.yml +++ b/.github/workflows/cargo_llvm_cov.yml @@ -114,6 +114,7 @@ jobs: with: github-token: ${{ secrets.GITHUB_TOKEN }} path-to-lcov: target/lcov.info + base-path: ${{ github.workspace }} - name: Backup report uses: actions/upload-artifact@b4b15b8c7c6ac21ea08fcf65892d2ee8f75cf882 # pin@v4 From 74cbc9b2787418867c8bee996eb13fbd83a5daf1 Mon Sep 17 00:00:00 2001 From: /alex/ Date: Tue, 26 Nov 2024 17:32:00 +0100 Subject: [PATCH 096/124] upload to codecov for comparison --- .github/workflows/cargo_llvm_cov.yml | 27 +++++++++++++++++++-------- 1 file changed, 19 insertions(+), 8 deletions(-) diff --git a/.github/workflows/cargo_llvm_cov.yml b/.github/workflows/cargo_llvm_cov.yml index e86d9e4774c..f6fd8e0082e 100644 --- a/.github/workflows/cargo_llvm_cov.yml +++ b/.github/workflows/cargo_llvm_cov.yml @@ -109,18 +109,29 @@ jobs: --output-path ./lcov.info \ --ignore-filename-regex 'external-crates/.*' - - name: Upload coverage to Coveralls - uses: coverallsapp/github-action@v2 - with: - github-token: ${{ secrets.GITHUB_TOKEN }} - path-to-lcov: target/lcov.info - base-path: ${{ github.workspace }} - - name: Backup report uses: actions/upload-artifact@b4b15b8c7c6ac21ea08fcf65892d2ee8f75cf882 # pin@v4 - if: always() with: name: lcov.info path: target/lcov.info if-no-files-found: error retention-days: 30 + + - name: Upload coverage to Coveralls + uses: coverallsapp/github-action@v2 + with: + github-token: ${{ secrets.GITHUB_TOKEN }} + base-path: ${{ github.workspace }} + path-to-lcov: target/lcov.info + flag-name: nextest+simtest + fail-on-error: true + + - name: Upload coverage data to Codecov + uses: codecov/codecov-action@v5 + with: + # no token required (https://docs.codecov.com/docs/codecov-tokens#uploading-without-a-token) + files: target/lcov.info + flags: nextest+simtest + disable_search: true + fail_ci_if_error: true + verbose: true From 27e42fb0786955953e84fe770df2718657a9e6f2 Mon Sep 17 00:00:00 2001 From: /alex/ Date: Tue, 26 Nov 2024 18:18:53 +0100 Subject: [PATCH 097/124] relative paths then --- .github/workflows/cargo_llvm_cov.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/cargo_llvm_cov.yml b/.github/workflows/cargo_llvm_cov.yml index f6fd8e0082e..6e7af7b4cfd 100644 --- a/.github/workflows/cargo_llvm_cov.yml +++ b/.github/workflows/cargo_llvm_cov.yml @@ -106,6 +106,7 @@ jobs: LLVM_PROFILE_FILE="merged.profdata" cargo +nightly llvm-cov report \ --lcov \ + --remap-path-prefix=$(pwd)=. \ --output-path ./lcov.info \ --ignore-filename-regex 'external-crates/.*' From 188fbc6ee359d6c2b9c35e0c43274cf8dec575a1 Mon Sep 17 00:00:00 2001 From: /alex/ Date: Tue, 26 Nov 2024 20:26:23 +0100 Subject: [PATCH 098/124] wen better docs? --- .github/workflows/cargo_llvm_cov.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/cargo_llvm_cov.yml b/.github/workflows/cargo_llvm_cov.yml index 6e7af7b4cfd..36a8a8296bb 100644 --- a/.github/workflows/cargo_llvm_cov.yml +++ b/.github/workflows/cargo_llvm_cov.yml @@ -106,7 +106,7 @@ jobs: LLVM_PROFILE_FILE="merged.profdata" cargo +nightly llvm-cov report \ --lcov \ - --remap-path-prefix=$(pwd)=. \ + --remap-path-prefix \ --output-path ./lcov.info \ --ignore-filename-regex 'external-crates/.*' From a372302836e65c3b1407ca86c49264916bf4c579 Mon Sep 17 00:00:00 2001 From: /alex/ Date: Tue, 26 Nov 2024 22:35:16 +0100 Subject: [PATCH 099/124] relative paths the hard way --- .github/workflows/cargo_llvm_cov.yml | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/.github/workflows/cargo_llvm_cov.yml b/.github/workflows/cargo_llvm_cov.yml index 36a8a8296bb..31b44e2514c 100644 --- a/.github/workflows/cargo_llvm_cov.yml +++ b/.github/workflows/cargo_llvm_cov.yml @@ -106,10 +106,13 @@ jobs: LLVM_PROFILE_FILE="merged.profdata" cargo +nightly llvm-cov report \ --lcov \ - --remap-path-prefix \ - --output-path ./lcov.info \ + --output-path lcov.info \ --ignore-filename-regex 'external-crates/.*' + echo "Removing absolute path prefix: ${{ github.workspace }} from report." + sed --in-place "s#${{ github.workspace }}#.#g" lcov.info + + - name: Backup report uses: actions/upload-artifact@b4b15b8c7c6ac21ea08fcf65892d2ee8f75cf882 # pin@v4 with: From 9b783d860d5a2164193b54e1d5cd1f33a372c753 Mon Sep 17 00:00:00 2001 From: /alex/ Date: Wed, 27 Nov 2024 00:12:30 +0100 Subject: [PATCH 100/124] ran into coveralls issue #1530 --- .github/workflows/cargo_llvm_cov.yml | 19 +++++++++---------- 1 file changed, 9 insertions(+), 10 deletions(-) diff --git a/.github/workflows/cargo_llvm_cov.yml b/.github/workflows/cargo_llvm_cov.yml index 31b44e2514c..9dba6f25e3c 100644 --- a/.github/workflows/cargo_llvm_cov.yml +++ b/.github/workflows/cargo_llvm_cov.yml @@ -125,17 +125,16 @@ jobs: uses: coverallsapp/github-action@v2 with: github-token: ${{ secrets.GITHUB_TOKEN }} - base-path: ${{ github.workspace }} path-to-lcov: target/lcov.info flag-name: nextest+simtest fail-on-error: true - - name: Upload coverage data to Codecov - uses: codecov/codecov-action@v5 - with: - # no token required (https://docs.codecov.com/docs/codecov-tokens#uploading-without-a-token) - files: target/lcov.info - flags: nextest+simtest - disable_search: true - fail_ci_if_error: true - verbose: true + # - name: Upload coverage data to Codecov + # uses: codecov/codecov-action@v5 + # with: + # # TODO token required because of branch protection (https://docs.codecov.com/docs/codecov-tokens#uploading-without-a-token) + # files: target/lcov.info + # flags: nextest+simtest + # disable_search: true + # fail_ci_if_error: true + # verbose: true From 1787c7a456db4fd992294784e1e17cf9859ebb6a Mon Sep 17 00:00:00 2001 From: /alex/ Date: Wed, 27 Nov 2024 11:13:49 +0100 Subject: [PATCH 101/124] upload to codecov with token --- .github/workflows/cargo_llvm_cov.yml | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) diff --git a/.github/workflows/cargo_llvm_cov.yml b/.github/workflows/cargo_llvm_cov.yml index 9dba6f25e3c..f691ff0fe94 100644 --- a/.github/workflows/cargo_llvm_cov.yml +++ b/.github/workflows/cargo_llvm_cov.yml @@ -129,12 +129,11 @@ jobs: flag-name: nextest+simtest fail-on-error: true - # - name: Upload coverage data to Codecov - # uses: codecov/codecov-action@v5 - # with: - # # TODO token required because of branch protection (https://docs.codecov.com/docs/codecov-tokens#uploading-without-a-token) - # files: target/lcov.info - # flags: nextest+simtest - # disable_search: true - # fail_ci_if_error: true - # verbose: true + - name: Upload coverage data to Codecov + uses: codecov/codecov-action@v5 + with: + token: ${{ secrets.CODECOV_TOKEN }} + files: target/lcov.info + flags: nextest+simtest + fail_ci_if_error: true + verbose: true From 86d52247a4e235d2f5dca94b0ba3cd149542521d Mon Sep 17 00:00:00 2001 From: /alex/ Date: Wed, 27 Nov 2024 14:54:01 +0100 Subject: [PATCH 102/124] re-enable simtest coverage :sweat: :pray: --- .github/workflows/cargo_llvm_cov.yml | 14 +++++++------- scripts/simtest/simtest-cov.sh | 2 +- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/.github/workflows/cargo_llvm_cov.yml b/.github/workflows/cargo_llvm_cov.yml index f691ff0fe94..b0123968191 100644 --- a/.github/workflows/cargo_llvm_cov.yml +++ b/.github/workflows/cargo_llvm_cov.yml @@ -82,15 +82,15 @@ jobs: [ -f "target/nextest.profdata" ] || exit 1 - # - name: Run code coverage (simtest) - # run: | - # cargo +nightly llvm-cov clean --profraw-only + - name: Run code coverage (simtest) + run: | + cargo +nightly llvm-cov clean --profraw-only - # git clean -fd + git clean -fd - # set +e - # ./scripts/simtest/simtest-cov.sh - # [ -f "target/simtest.profdata" ] || exit 1 + set +e + ./scripts/simtest/simtest-cov.sh + [ -f "target/simtest.profdata" ] || exit 1 - name: Create report (lcov.info) run: | diff --git a/scripts/simtest/simtest-cov.sh b/scripts/simtest/simtest-cov.sh index 7e279cec890..5e1459d0005 100755 --- a/scripts/simtest/simtest-cov.sh +++ b/scripts/simtest/simtest-cov.sh @@ -22,7 +22,7 @@ LLVM_PROFDATA="$HOME/.rustup/toolchains/$TOOLCHAIN/lib/rustlib/x86_64-unknown-li MSIM_WATCHDOG_TIMEOUT_MS=60000 MSIM_TEST_SEED=1 cargo llvm-cov \ --ignore-run-fail \ --no-report \ - nextest -vv # --cargo-profile simulator + nextest -vv --cargo-profile simulator echo "Scanning for corrupted .profraw files. This might take a while." find target/llvm-cov-target -name '*.profraw' | while read file; do From 9246ccc342b6a52cd7a253b093f74ce2be25826a Mon Sep 17 00:00:00 2001 From: /alex/ Date: Wed, 27 Nov 2024 14:55:30 +0100 Subject: [PATCH 103/124] don't fail if codecov upload fails --- .github/workflows/cargo_llvm_cov.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/cargo_llvm_cov.yml b/.github/workflows/cargo_llvm_cov.yml index b0123968191..cc30234989a 100644 --- a/.github/workflows/cargo_llvm_cov.yml +++ b/.github/workflows/cargo_llvm_cov.yml @@ -135,5 +135,5 @@ jobs: token: ${{ secrets.CODECOV_TOKEN }} files: target/lcov.info flags: nextest+simtest - fail_ci_if_error: true + fail_ci_if_error: false verbose: true From 8fd0834f70af4ab3b9d4274a353c97bc1339c61e Mon Sep 17 00:00:00 2001 From: /alex/ Date: Thu, 28 Nov 2024 12:04:23 +0100 Subject: [PATCH 104/124] no nightly, fixes, cleanup, improvements --- .github/workflows/cargo_llvm_cov.yml | 60 ++++++++++++++++------------ scripts/simtest/simtest-cov.sh | 32 +++++++++------ 2 files changed, 55 insertions(+), 37 deletions(-) diff --git a/.github/workflows/cargo_llvm_cov.yml b/.github/workflows/cargo_llvm_cov.yml index cc30234989a..7c636ef2678 100644 --- a/.github/workflows/cargo_llvm_cov.yml +++ b/.github/workflows/cargo_llvm_cov.yml @@ -46,65 +46,75 @@ jobs: - name: Install llvm-tools run: | - TOOLCHAIN=nightly-x86_64-unknown-linux-gnu + TOOLCHAIN=$(rustup show active-toolchain | cut -d ' ' -f 1) rustup component add llvm-tools --toolchain "$TOOLCHAIN" - LLVM_PROFDATA=$HOME/.rustup/toolchains/$TOOLCHAIN/lib/rustlib/x86_64-unknown-linux-gnu/bin/llvm-profdata - echo "LLVM_PROFDATA=$LLVM_PROFDATA" >> $GITHUB_ENV + LLVM_PROFDATA="$HOME/.rustup/toolchains/$TOOLCHAIN/lib/rustlib/x86_64-unknown-linux-gnu/bin/llvm-profdata" + if [ -x "$LLVM_PROFDATA" ]; then $LLVM_PROFDATA --version + echo "LLVM_PROFDATA=$LLVM_PROFDATA" >> $GITHUB_ENV else - echo "Error: llvm-profdata not found at $LLVM_PROFDATA or not executable." + echo "Error: llvm-profdata not found at $LLVM_PROFDATA, or is not executable." exit 1 fi - name: Run code coverage (nextest) run: | - cargo +nightly llvm-cov clean --profraw-only - set +e - IOTA_SKIP_SIMTESTS=1 cargo +nightly llvm-cov \ - --ignore-run-fail \ - --no-report \ - nextest -vv - - echo "Scanning for corrupted .profraw files. This might take a while." - find target/llvm-cov-target -name '*.profraw' | while read file; do - if ! "$LLVM_PROFDATA" show "$file" > /dev/null 2>&1; then - echo "Removing corrupted file: $file" - rm "$file" - fi - done + IOTA_SKIP_SIMTESTS=1 cargo llvm-cov --ignore-run-fail --no-report nextest -vv find target/llvm-cov-target -name '*.profraw' -print0 | xargs -0 $LLVM_PROFDATA merge \ --failure-mode=warn \ --sparse \ --output target/nextest.profdata + set -e + + if [ $? -ne 0]; then + echo "Error detected despite `--ignore-run-fail`. Trying to salvage the situation:" + echo "Scanning for corrupted .profraw files. This might take a while." + find target/llvm-cov-target -name '*.profraw' | while read file; do + if ! "$LLVM_PROFDATA" show "$file" > /dev/null 2>&1; then + echo "$file: corruped -> removing" + rm "$file" + else + echo "$file: good" + fi + done + + find target/llvm-cov-target -name '*.profraw' -print0 | xargs -0 $LLVM_PROFDATA merge \ + --failure-mode=warn \ + --sparse \ + --output target/nextest.profdata + fi - [ -f "target/nextest.profdata" ] || exit 1 + [ -s "target/nextest.profdata" ] || exit 1 - name: Run code coverage (simtest) run: | - cargo +nightly llvm-cov clean --profraw-only - git clean -fd set +e ./scripts/simtest/simtest-cov.sh - [ -f "target/simtest.profdata" ] || exit 1 + set -e + + if [ ! -s "target/simtest.profdata" ]; then + echo "🚨 Warning 🚨: Collecting simtest coverage failed." + exit 0 + fi - name: Create report (lcov.info) run: | cd target - if [ -f "simtest.profdata" ]; then + if [ -s "simtest.profdata" ]; then $LLVM_PROFDATA merge --failure-mode=warn --sparse nextest.profdata simtest.profdata --output merged.profdata else mv nextest.profdata merged.profdata fi - [ -f "merged.profdata" ] || exit 1 + [ -s "merged.profdata" ] || exit 1 - LLVM_PROFILE_FILE="merged.profdata" cargo +nightly llvm-cov report \ + LLVM_PROFILE_FILE="merged.profdata" cargo llvm-cov report \ --lcov \ --output-path lcov.info \ --ignore-filename-regex 'external-crates/.*' diff --git a/scripts/simtest/simtest-cov.sh b/scripts/simtest/simtest-cov.sh index 5e1459d0005..2ae41f1ca44 100755 --- a/scripts/simtest/simtest-cov.sh +++ b/scripts/simtest/simtest-cov.sh @@ -16,26 +16,34 @@ git apply ./scripts/simtest/config-patch root_dir=$(git rev-parse --show-toplevel) export SIMTEST_STATIC_INIT_MOVE=$root_dir"/examples/move/basics" -TOOLCHAIN=nightly-x86_64-unknown-linux-gnu +TOOLCHAIN=$(rustup show active-toolchain | cut -d ' ' -f 1) LLVM_PROFDATA="$HOME/.rustup/toolchains/$TOOLCHAIN/lib/rustlib/x86_64-unknown-linux-gnu/bin/llvm-profdata" -MSIM_WATCHDOG_TIMEOUT_MS=60000 MSIM_TEST_SEED=1 cargo llvm-cov \ - --ignore-run-fail \ - --no-report \ +MSIM_WATCHDOG_TIMEOUT_MS=60000 MSIM_TEST_SEED=1 cargo llvm-cov --ignore-run-fail --no-report \ nextest -vv --cargo-profile simulator -echo "Scanning for corrupted .profraw files. This might take a while." -find target/llvm-cov-target -name '*.profraw' | while read file; do - if ! "$LLVM_PROFDATA" show "$file" > /dev/null 2>&1; then - echo "Removing corrupted file: $file" - rm "$file" - fi -done - find target/llvm-cov-target -name '*.profraw' -print0 | xargs -0 $LLVM_PROFDATA merge \ --failure-mode=warn \ --sparse \ --output target/simtest.profdata +if [ $? -ne 0]; then + echo "Error detected despite `--ignore-run-fail`. Trying to salvage the situation:" + echo "Scanning for corrupted .profraw files. This might take a while." + find target/llvm-cov-target -name '*.profraw' | while read file; do + if ! "$LLVM_PROFDATA" show "$file" > /dev/null 2>&1; then + echo "$file: corruped -> removing" + rm "$file" + else + echo "$file: good" + fi + done + + find target/llvm-cov-target -name '*.profraw' -print0 | xargs -0 $LLVM_PROFDATA merge \ + --failure-mode=warn \ + --sparse \ + --output target/simtest.profdata +fi + # remove the patch git checkout .cargo/config Cargo.toml Cargo.lock From e6b3b1fff506d21fe33e5498b3f557f05a8c6f7a Mon Sep 17 00:00:00 2001 From: /alex/ Date: Thu, 28 Nov 2024 13:46:50 +0100 Subject: [PATCH 105/124] fix check --- .github/workflows/cargo_llvm_cov.yml | 20 ++++++++++---------- scripts/simtest/simtest-cov.sh | 2 +- 2 files changed, 11 insertions(+), 11 deletions(-) diff --git a/.github/workflows/cargo_llvm_cov.yml b/.github/workflows/cargo_llvm_cov.yml index 7c636ef2678..6ac303eb24f 100644 --- a/.github/workflows/cargo_llvm_cov.yml +++ b/.github/workflows/cargo_llvm_cov.yml @@ -69,7 +69,7 @@ jobs: --output target/nextest.profdata set -e - if [ $? -ne 0]; then + if [ $? -ne 0 ]; then echo "Error detected despite `--ignore-run-fail`. Trying to salvage the situation:" echo "Scanning for corrupted .profraw files. This might take a while." find target/llvm-cov-target -name '*.profraw' | while read file; do @@ -131,15 +131,7 @@ jobs: if-no-files-found: error retention-days: 30 - - name: Upload coverage to Coveralls - uses: coverallsapp/github-action@v2 - with: - github-token: ${{ secrets.GITHUB_TOKEN }} - path-to-lcov: target/lcov.info - flag-name: nextest+simtest - fail-on-error: true - - - name: Upload coverage data to Codecov + - name: Upload coverage to Codecov uses: codecov/codecov-action@v5 with: token: ${{ secrets.CODECOV_TOKEN }} @@ -147,3 +139,11 @@ jobs: flags: nextest+simtest fail_ci_if_error: false verbose: true + + - name: Upload coverage to Coveralls + uses: coverallsapp/github-action@v2 + with: + github-token: ${{ secrets.GITHUB_TOKEN }} + path-to-lcov: target/lcov.info + flag-name: nextest+simtest + fail-on-error: true diff --git a/scripts/simtest/simtest-cov.sh b/scripts/simtest/simtest-cov.sh index 2ae41f1ca44..3400f026f5a 100755 --- a/scripts/simtest/simtest-cov.sh +++ b/scripts/simtest/simtest-cov.sh @@ -27,7 +27,7 @@ find target/llvm-cov-target -name '*.profraw' -print0 | xargs -0 $LLVM_PROFDATA --sparse \ --output target/simtest.profdata -if [ $? -ne 0]; then +if [ $? -ne 0 ]; then echo "Error detected despite `--ignore-run-fail`. Trying to salvage the situation:" echo "Scanning for corrupted .profraw files. This might take a while." find target/llvm-cov-target -name '*.profraw' | while read file; do From d26b3fc2e8df0b39f08cb18d7b484398b5038bc1 Mon Sep 17 00:00:00 2001 From: /alex/ Date: Thu, 28 Nov 2024 16:07:04 +0100 Subject: [PATCH 106/124] come on --- .github/workflows/cargo_llvm_cov.yml | 25 +++++++++++++++++++++++-- scripts/simtest/simtest-cov.sh | 23 ----------------------- 2 files changed, 23 insertions(+), 25 deletions(-) diff --git a/.github/workflows/cargo_llvm_cov.yml b/.github/workflows/cargo_llvm_cov.yml index 6ac303eb24f..0decd6eb1c2 100644 --- a/.github/workflows/cargo_llvm_cov.yml +++ b/.github/workflows/cargo_llvm_cov.yml @@ -67,7 +67,6 @@ jobs: --failure-mode=warn \ --sparse \ --output target/nextest.profdata - set -e if [ $? -ne 0 ]; then echo "Error detected despite `--ignore-run-fail`. Trying to salvage the situation:" @@ -95,7 +94,29 @@ jobs: set +e ./scripts/simtest/simtest-cov.sh - set -e + + find target/llvm-cov-target -name '*.profraw' -print0 | xargs -0 $LLVM_PROFDATA merge \ + --failure-mode=warn \ + --sparse \ + --output target/simtest.profdata + + if [ $? -ne 0 ]; then + echo "Error detected despite `--ignore-run-fail`. Trying to salvage the situation:" + echo "Scanning for corrupted .profraw files. This might take a while." + find target/llvm-cov-target -name '*.profraw' | while read file; do + if ! "$LLVM_PROFDATA" show "$file" > /dev/null 2>&1; then + echo "$file: corruped -> removing" + rm "$file" + else + echo "$file: good" + fi + done + + find target/llvm-cov-target -name '*.profraw' -print0 | xargs -0 $LLVM_PROFDATA merge \ + --failure-mode=warn \ + --sparse \ + --output target/simtest.profdata + fi if [ ! -s "target/simtest.profdata" ]; then echo "🚨 Warning 🚨: Collecting simtest coverage failed." diff --git a/scripts/simtest/simtest-cov.sh b/scripts/simtest/simtest-cov.sh index 3400f026f5a..a899702a7ee 100755 --- a/scripts/simtest/simtest-cov.sh +++ b/scripts/simtest/simtest-cov.sh @@ -22,28 +22,5 @@ LLVM_PROFDATA="$HOME/.rustup/toolchains/$TOOLCHAIN/lib/rustlib/x86_64-unknown-li MSIM_WATCHDOG_TIMEOUT_MS=60000 MSIM_TEST_SEED=1 cargo llvm-cov --ignore-run-fail --no-report \ nextest -vv --cargo-profile simulator -find target/llvm-cov-target -name '*.profraw' -print0 | xargs -0 $LLVM_PROFDATA merge \ - --failure-mode=warn \ - --sparse \ - --output target/simtest.profdata - -if [ $? -ne 0 ]; then - echo "Error detected despite `--ignore-run-fail`. Trying to salvage the situation:" - echo "Scanning for corrupted .profraw files. This might take a while." - find target/llvm-cov-target -name '*.profraw' | while read file; do - if ! "$LLVM_PROFDATA" show "$file" > /dev/null 2>&1; then - echo "$file: corruped -> removing" - rm "$file" - else - echo "$file: good" - fi - done - - find target/llvm-cov-target -name '*.profraw' -print0 | xargs -0 $LLVM_PROFDATA merge \ - --failure-mode=warn \ - --sparse \ - --output target/simtest.profdata -fi - # remove the patch git checkout .cargo/config Cargo.toml Cargo.lock From db168fa88b83b699e94d329573d5fcae5ff3bfd3 Mon Sep 17 00:00:00 2001 From: /alex/ Date: Thu, 28 Nov 2024 18:57:15 +0100 Subject: [PATCH 107/124] sccache check --- .github/workflows/cargo_llvm_cov.yml | 22 +++++++++++++--------- 1 file changed, 13 insertions(+), 9 deletions(-) diff --git a/.github/workflows/cargo_llvm_cov.yml b/.github/workflows/cargo_llvm_cov.yml index 0decd6eb1c2..eb5aac10d05 100644 --- a/.github/workflows/cargo_llvm_cov.yml +++ b/.github/workflows/cargo_llvm_cov.yml @@ -58,18 +58,24 @@ jobs: exit 1 fi + # TEMP: check if sccache is on the image + echo "sccache: $(which sccache)" + echo "$RUSTC_WRAPPER" + if [ -s "$HOME/.cargo/config.toml" ]; then + cat "$HOME/.cargo/config.toml" + fi + - name: Run code coverage (nextest) run: | set +e + IOTA_SKIP_SIMTESTS=1 cargo llvm-cov --ignore-run-fail --no-report nextest -vv - find target/llvm-cov-target -name '*.profraw' -print0 | xargs -0 $LLVM_PROFDATA merge \ + if ! find target/llvm-cov-target -name '*.profraw' -print0 | xargs -0 $LLVM_PROFDATA merge \ --failure-mode=warn \ --sparse \ - --output target/nextest.profdata + --output target/nextest.profdata; then - if [ $? -ne 0 ]; then - echo "Error detected despite `--ignore-run-fail`. Trying to salvage the situation:" echo "Scanning for corrupted .profraw files. This might take a while." find target/llvm-cov-target -name '*.profraw' | while read file; do if ! "$LLVM_PROFDATA" show "$file" > /dev/null 2>&1; then @@ -93,15 +99,14 @@ jobs: git clean -fd set +e + ./scripts/simtest/simtest-cov.sh - find target/llvm-cov-target -name '*.profraw' -print0 | xargs -0 $LLVM_PROFDATA merge \ + if ! find target/llvm-cov-target -name '*.profraw' -print0 | xargs -0 $LLVM_PROFDATA merge \ --failure-mode=warn \ --sparse \ - --output target/simtest.profdata + --output target/simtest.profdata; then - if [ $? -ne 0 ]; then - echo "Error detected despite `--ignore-run-fail`. Trying to salvage the situation:" echo "Scanning for corrupted .profraw files. This might take a while." find target/llvm-cov-target -name '*.profraw' | while read file; do if ! "$LLVM_PROFDATA" show "$file" > /dev/null 2>&1; then @@ -120,7 +125,6 @@ jobs: if [ ! -s "target/simtest.profdata" ]; then echo "🚨 Warning 🚨: Collecting simtest coverage failed." - exit 0 fi - name: Create report (lcov.info) From b1dc2851bbfb6750971490c969f7410584510553 Mon Sep 17 00:00:00 2001 From: /alex/ Date: Thu, 28 Nov 2024 21:21:30 +0100 Subject: [PATCH 108/124] debug commands; use subshell --- .github/workflows/cargo_llvm_cov.yml | 12 +++++++----- scripts/simtest/simtest-cov.sh | 2 +- 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/.github/workflows/cargo_llvm_cov.yml b/.github/workflows/cargo_llvm_cov.yml index eb5aac10d05..1b56055244a 100644 --- a/.github/workflows/cargo_llvm_cov.yml +++ b/.github/workflows/cargo_llvm_cov.yml @@ -67,14 +67,15 @@ jobs: - name: Run code coverage (nextest) run: | + set +x set +e IOTA_SKIP_SIMTESTS=1 cargo llvm-cov --ignore-run-fail --no-report nextest -vv - if ! find target/llvm-cov-target -name '*.profraw' -print0 | xargs -0 $LLVM_PROFDATA merge \ + if ! (find target/llvm-cov-target -name '*.profraw' -print0 | xargs -0 "$LLVM_PROFDATA" merge \ --failure-mode=warn \ --sparse \ - --output target/nextest.profdata; then + --output target/nextest.profdata); then echo "Scanning for corrupted .profraw files. This might take a while." find target/llvm-cov-target -name '*.profraw' | while read file; do @@ -96,16 +97,17 @@ jobs: - name: Run code coverage (simtest) run: | + set +x + git clean -fd set +e - ./scripts/simtest/simtest-cov.sh - if ! find target/llvm-cov-target -name '*.profraw' -print0 | xargs -0 $LLVM_PROFDATA merge \ + if ! (find target/llvm-cov-target -name '*.profraw' -print0 | xargs -0 "$LLVM_PROFDATA" merge \ --failure-mode=warn \ --sparse \ - --output target/simtest.profdata; then + --output target/simtest.profdata); then echo "Scanning for corrupted .profraw files. This might take a while." find target/llvm-cov-target -name '*.profraw' | while read file; do diff --git a/scripts/simtest/simtest-cov.sh b/scripts/simtest/simtest-cov.sh index a899702a7ee..fdfc6abb063 100755 --- a/scripts/simtest/simtest-cov.sh +++ b/scripts/simtest/simtest-cov.sh @@ -20,7 +20,7 @@ TOOLCHAIN=$(rustup show active-toolchain | cut -d ' ' -f 1) LLVM_PROFDATA="$HOME/.rustup/toolchains/$TOOLCHAIN/lib/rustlib/x86_64-unknown-linux-gnu/bin/llvm-profdata" MSIM_WATCHDOG_TIMEOUT_MS=60000 MSIM_TEST_SEED=1 cargo llvm-cov --ignore-run-fail --no-report \ - nextest -vv --cargo-profile simulator + nextest -vv # remove the patch git checkout .cargo/config Cargo.toml Cargo.lock From fa7db49539a73005c36ee860733f07c92a122847 Mon Sep 17 00:00:00 2001 From: /alex/ Date: Thu, 28 Nov 2024 23:37:28 +0100 Subject: [PATCH 109/124] sccache + more echos --- .github/workflows/cargo_llvm_cov.yml | 37 +++++++++++++++++++--------- scripts/simtest/simtest-cov.sh | 6 +---- 2 files changed, 27 insertions(+), 16 deletions(-) diff --git a/.github/workflows/cargo_llvm_cov.yml b/.github/workflows/cargo_llvm_cov.yml index 1b56055244a..9cbef8ccbcf 100644 --- a/.github/workflows/cargo_llvm_cov.yml +++ b/.github/workflows/cargo_llvm_cov.yml @@ -54,28 +54,30 @@ jobs: $LLVM_PROFDATA --version echo "LLVM_PROFDATA=$LLVM_PROFDATA" >> $GITHUB_ENV else - echo "Error: llvm-profdata not found at $LLVM_PROFDATA, or is not executable." + echo "🚨 Error 🚨: llvm-profdata not found at $LLVM_PROFDATA, or is not executable." exit 1 fi - # TEMP: check if sccache is on the image + - name: Install sccache + run: | + cargo install sccache + echo -e "\n[build]\nrustc-wrapper = \"sccache\"" >> $HOME/.cargo/config.toml echo "sccache: $(which sccache)" - echo "$RUSTC_WRAPPER" - if [ -s "$HOME/.cargo/config.toml" ]; then - cat "$HOME/.cargo/config.toml" - fi + cat "$HOME/.cargo/config.toml" - name: Run code coverage (nextest) run: | - set +x set +e + echo "Generating coverage data (.profraw files)." IOTA_SKIP_SIMTESTS=1 cargo llvm-cov --ignore-run-fail --no-report nextest -vv + echo "Trying to merge .profraw files." if ! (find target/llvm-cov-target -name '*.profraw' -print0 | xargs -0 "$LLVM_PROFDATA" merge \ --failure-mode=warn \ --sparse \ --output target/nextest.profdata); then + echo "Merging failed." echo "Scanning for corrupted .profraw files. This might take a while." find target/llvm-cov-target -name '*.profraw' | while read file; do @@ -87,27 +89,34 @@ jobs: fi done + echo "Trying to merge remaining .profraw files." find target/llvm-cov-target -name '*.profraw' -print0 | xargs -0 $LLVM_PROFDATA merge \ --failure-mode=warn \ --sparse \ --output target/nextest.profdata fi - [ -s "target/nextest.profdata" ] || exit 1 + if [ -s "target/nextest.profdata" ]; then + echo "Successfully collected nextest coverage data." + else + echo "🚨 Error 🚨: Collecting nexttest coverage failed." + exit 1 + fi - name: Run code coverage (simtest) run: | - set +x - git clean -fd set +e + echo "Generating coverage data (.profraw files)." ./scripts/simtest/simtest-cov.sh + echo "Trying to merge .profraw files." if ! (find target/llvm-cov-target -name '*.profraw' -print0 | xargs -0 "$LLVM_PROFDATA" merge \ --failure-mode=warn \ --sparse \ --output target/simtest.profdata); then + echo "Merging failed." echo "Scanning for corrupted .profraw files. This might take a while." find target/llvm-cov-target -name '*.profraw' | while read file; do @@ -119,13 +128,16 @@ jobs: fi done + echo "Trying to merge remaining .profraw files." find target/llvm-cov-target -name '*.profraw' -print0 | xargs -0 $LLVM_PROFDATA merge \ --failure-mode=warn \ --sparse \ --output target/simtest.profdata fi - if [ ! -s "target/simtest.profdata" ]; then + if [ -s "target/simtest.profdata" ]; then + echo "Successfully collected simtest coverage data." + else echo "🚨 Warning 🚨: Collecting simtest coverage failed." fi @@ -134,13 +146,16 @@ jobs: cd target if [ -s "simtest.profdata" ]; then + echo "Merging nextest and simtest coverage data." $LLVM_PROFDATA merge --failure-mode=warn --sparse nextest.profdata simtest.profdata --output merged.profdata else + echo "Using only nextest coverage data." mv nextest.profdata merged.profdata fi [ -s "merged.profdata" ] || exit 1 + echo "Creating report (lcov.info)." LLVM_PROFILE_FILE="merged.profdata" cargo llvm-cov report \ --lcov \ --output-path lcov.info \ diff --git a/scripts/simtest/simtest-cov.sh b/scripts/simtest/simtest-cov.sh index fdfc6abb063..972c612243e 100755 --- a/scripts/simtest/simtest-cov.sh +++ b/scripts/simtest/simtest-cov.sh @@ -16,11 +16,7 @@ git apply ./scripts/simtest/config-patch root_dir=$(git rev-parse --show-toplevel) export SIMTEST_STATIC_INIT_MOVE=$root_dir"/examples/move/basics" -TOOLCHAIN=$(rustup show active-toolchain | cut -d ' ' -f 1) -LLVM_PROFDATA="$HOME/.rustup/toolchains/$TOOLCHAIN/lib/rustlib/x86_64-unknown-linux-gnu/bin/llvm-profdata" - -MSIM_WATCHDOG_TIMEOUT_MS=60000 MSIM_TEST_SEED=1 cargo llvm-cov --ignore-run-fail --no-report \ - nextest -vv +MSIM_WATCHDOG_TIMEOUT_MS=60000 MSIM_TEST_SEED=1 cargo llvm-cov --ignore-run-fail --no-report nextest -vv # remove the patch git checkout .cargo/config Cargo.toml Cargo.lock From d0e9babf4058b591d7801af2527f6529c798e828 Mon Sep 17 00:00:00 2001 From: /alex/ Date: Fri, 29 Nov 2024 00:37:43 +0100 Subject: [PATCH 110/124] add Coveralls badge to README.md --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index 27c067864c6..1fcacc6d278 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,5 @@ # IOTA +[![Coverage Status](https://coveralls.io/repos/github/iotaledger/iota/badge.svg)](https://coveralls.io/github/iotaledger/iota) IOTA is a asset-oriented programming model powered by the [Move programming language](https://move-language.github.io/move/introduction.html). IOTA is a project under active From 6e48ec6c83e06857c85d4b9cf09efeb6cdfc7e1c Mon Sep 17 00:00:00 2001 From: /alex/ Date: Fri, 29 Nov 2024 01:07:32 +0100 Subject: [PATCH 111/124] bye codecov --- .github/workflows/cargo_llvm_cov.yml | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/.github/workflows/cargo_llvm_cov.yml b/.github/workflows/cargo_llvm_cov.yml index 9cbef8ccbcf..26ba73e943f 100644 --- a/.github/workflows/cargo_llvm_cov.yml +++ b/.github/workflows/cargo_llvm_cov.yml @@ -4,6 +4,12 @@ on: schedule: - cron: "0 1 * * *" # every day at 1am (UTC) workflow_dispatch: + inputs: + sui_repo_ref: + description: "Branch / commit to test" + type: string + required: false + default: '' jobs: llvm-cov: @@ -31,6 +37,9 @@ jobs: CARGO_NET_RETRY: 10 steps: - uses: actions/checkout@eef61447b9ff4aafe5dcd4e0bbf5d482be7e7871 # pin@v4 + with: + ref: ${{ github.event.inputs.sui_repo_ref || github.ref }} + - uses: bmwill/rust-cache@fb63fcd7a959767755b88b5af2f5cbf65fb8a127 # pin@v1 - name: Install cargo-llvm-cov @@ -173,15 +182,6 @@ jobs: if-no-files-found: error retention-days: 30 - - name: Upload coverage to Codecov - uses: codecov/codecov-action@v5 - with: - token: ${{ secrets.CODECOV_TOKEN }} - files: target/lcov.info - flags: nextest+simtest - fail_ci_if_error: false - verbose: true - - name: Upload coverage to Coveralls uses: coverallsapp/github-action@v2 with: From 9a6ad5e3d40dd357713b838decc316f0e090c631 Mon Sep 17 00:00:00 2001 From: /alex/ Date: Fri, 29 Nov 2024 12:21:44 +0100 Subject: [PATCH 112/124] fix config.toml extension Co-authored-by: DaughterOfMars --- scripts/simtest/simtest-cov.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/simtest/simtest-cov.sh b/scripts/simtest/simtest-cov.sh index 972c612243e..a81fbfbf95d 100755 --- a/scripts/simtest/simtest-cov.sh +++ b/scripts/simtest/simtest-cov.sh @@ -19,4 +19,4 @@ export SIMTEST_STATIC_INIT_MOVE=$root_dir"/examples/move/basics" MSIM_WATCHDOG_TIMEOUT_MS=60000 MSIM_TEST_SEED=1 cargo llvm-cov --ignore-run-fail --no-report nextest -vv # remove the patch -git checkout .cargo/config Cargo.toml Cargo.lock +git checkout .cargo/config.toml Cargo.toml Cargo.lock From 6cb16372508eec853beabec9fbeb2fa5b70b12c6 Mon Sep 17 00:00:00 2001 From: /alex/ Date: Fri, 29 Nov 2024 12:32:33 +0100 Subject: [PATCH 113/124] rm badge --- README.md | 1 - 1 file changed, 1 deletion(-) diff --git a/README.md b/README.md index 1fcacc6d278..27c067864c6 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,4 @@ # IOTA -[![Coverage Status](https://coveralls.io/repos/github/iotaledger/iota/badge.svg)](https://coveralls.io/github/iotaledger/iota) IOTA is a asset-oriented programming model powered by the [Move programming language](https://move-language.github.io/move/introduction.html). IOTA is a project under active From 8732f9fbde896ea23b8986c463aa00094cfd3ab1 Mon Sep 17 00:00:00 2001 From: /alex/ Date: Fri, 29 Nov 2024 15:52:55 +0100 Subject: [PATCH 114/124] rm sscache install; mandatory corruption check --- .github/workflows/cargo_llvm_cov.yml | 71 ++++++++++------------------ 1 file changed, 24 insertions(+), 47 deletions(-) diff --git a/.github/workflows/cargo_llvm_cov.yml b/.github/workflows/cargo_llvm_cov.yml index 26ba73e943f..dc453ecd008 100644 --- a/.github/workflows/cargo_llvm_cov.yml +++ b/.github/workflows/cargo_llvm_cov.yml @@ -67,13 +67,6 @@ jobs: exit 1 fi - - name: Install sccache - run: | - cargo install sccache - echo -e "\n[build]\nrustc-wrapper = \"sccache\"" >> $HOME/.cargo/config.toml - echo "sccache: $(which sccache)" - cat "$HOME/.cargo/config.toml" - - name: Run code coverage (nextest) run: | set +e @@ -81,29 +74,21 @@ jobs: echo "Generating coverage data (.profraw files)." IOTA_SKIP_SIMTESTS=1 cargo llvm-cov --ignore-run-fail --no-report nextest -vv + echo "Scanning for corrupted .profraw files. This might take a while." + find target/llvm-cov-target -name '*.profraw' | while read file; do + if ! "$LLVM_PROFDATA" show "$file" > /dev/null 2>&1; then + echo "$file: corruped -> removing" + rm "$file" + else + echo "$file: good" + fi + done + echo "Trying to merge .profraw files." - if ! (find target/llvm-cov-target -name '*.profraw' -print0 | xargs -0 "$LLVM_PROFDATA" merge \ + find target/llvm-cov-target -name '*.profraw' -print0 | xargs -0 $LLVM_PROFDATA merge \ --failure-mode=warn \ --sparse \ - --output target/nextest.profdata); then - echo "Merging failed." - - echo "Scanning for corrupted .profraw files. This might take a while." - find target/llvm-cov-target -name '*.profraw' | while read file; do - if ! "$LLVM_PROFDATA" show "$file" > /dev/null 2>&1; then - echo "$file: corruped -> removing" - rm "$file" - else - echo "$file: good" - fi - done - - echo "Trying to merge remaining .profraw files." - find target/llvm-cov-target -name '*.profraw' -print0 | xargs -0 $LLVM_PROFDATA merge \ - --failure-mode=warn \ - --sparse \ - --output target/nextest.profdata - fi + --output target/nextest.profdata if [ -s "target/nextest.profdata" ]; then echo "Successfully collected nextest coverage data." @@ -120,29 +105,21 @@ jobs: echo "Generating coverage data (.profraw files)." ./scripts/simtest/simtest-cov.sh + echo "Scanning for corrupted .profraw files. This might take a while." + find target/llvm-cov-target -name '*.profraw' | while read file; do + if ! "$LLVM_PROFDATA" show "$file" > /dev/null 2>&1; then + echo "$file: corruped -> removing" + rm "$file" + else + echo "$file: good" + fi + done + echo "Trying to merge .profraw files." - if ! (find target/llvm-cov-target -name '*.profraw' -print0 | xargs -0 "$LLVM_PROFDATA" merge \ + find target/llvm-cov-target -name '*.profraw' -print0 | xargs -0 $LLVM_PROFDATA merge \ --failure-mode=warn \ --sparse \ - --output target/simtest.profdata); then - echo "Merging failed." - - echo "Scanning for corrupted .profraw files. This might take a while." - find target/llvm-cov-target -name '*.profraw' | while read file; do - if ! "$LLVM_PROFDATA" show "$file" > /dev/null 2>&1; then - echo "$file: corruped -> removing" - rm "$file" - else - echo "$file: good" - fi - done - - echo "Trying to merge remaining .profraw files." - find target/llvm-cov-target -name '*.profraw' -print0 | xargs -0 $LLVM_PROFDATA merge \ - --failure-mode=warn \ - --sparse \ - --output target/simtest.profdata - fi + --output target/simtest.profdata if [ -s "target/simtest.profdata" ]; then echo "Successfully collected simtest coverage data." From 1cbe6d34675ed18b960e496f1c24ecf30fda4664 Mon Sep 17 00:00:00 2001 From: /alex/ Date: Sat, 30 Nov 2024 00:24:01 +0100 Subject: [PATCH 115/124] dprint --- .github/workflows/cargo_llvm_cov.yml | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/.github/workflows/cargo_llvm_cov.yml b/.github/workflows/cargo_llvm_cov.yml index dc453ecd008..76fba0a1048 100644 --- a/.github/workflows/cargo_llvm_cov.yml +++ b/.github/workflows/cargo_llvm_cov.yml @@ -9,7 +9,7 @@ on: description: "Branch / commit to test" type: string required: false - default: '' + default: "" jobs: llvm-cov: @@ -38,7 +38,7 @@ jobs: steps: - uses: actions/checkout@eef61447b9ff4aafe5dcd4e0bbf5d482be7e7871 # pin@v4 with: - ref: ${{ github.event.inputs.sui_repo_ref || github.ref }} + ref: ${{ github.event.inputs.sui_repo_ref || github.ref }} - uses: bmwill/rust-cache@fb63fcd7a959767755b88b5af2f5cbf65fb8a127 # pin@v1 @@ -93,7 +93,7 @@ jobs: if [ -s "target/nextest.profdata" ]; then echo "Successfully collected nextest coverage data." else - echo "🚨 Error 🚨: Collecting nexttest coverage failed." + echo "🚨 Error 🚨: Collecting nexttest coverage failed." exit 1 fi @@ -124,7 +124,7 @@ jobs: if [ -s "target/simtest.profdata" ]; then echo "Successfully collected simtest coverage data." else - echo "🚨 Warning 🚨: Collecting simtest coverage failed." + echo "🚨 Warning 🚨: Collecting simtest coverage failed." fi - name: Create report (lcov.info) @@ -150,7 +150,6 @@ jobs: echo "Removing absolute path prefix: ${{ github.workspace }} from report." sed --in-place "s#${{ github.workspace }}#.#g" lcov.info - - name: Backup report uses: actions/upload-artifact@b4b15b8c7c6ac21ea08fcf65892d2ee8f75cf882 # pin@v4 with: From d63895f688beff0616beb140aee8a5c8d5e4e439 Mon Sep 17 00:00:00 2001 From: /alex/ Date: Sat, 30 Nov 2024 00:29:14 +0100 Subject: [PATCH 116/124] dprint Cargo.toml --- Cargo.toml | 100 ++++++++--------------------------------------------- 1 file changed, 14 insertions(+), 86 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index bfa06399a5e..83ac006cf50 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -198,10 +198,7 @@ overflow-checks = true opt-level = 1 [workspace.lints.rust] -unexpected_cfgs = { level = "warn", check-cfg = [ - 'cfg(msim)', - 'cfg(fail_points)', -] } +unexpected_cfgs = { level = "warn", check-cfg = ['cfg(msim)', 'cfg(fail_points)'] } # Dependencies that should be kept in sync through the whole workspace [workspace.dependencies] @@ -216,25 +213,9 @@ async-graphql = "=7.0.1" async-recursion = "1.0.4" async-trait = "0.1.61" aws-config = "0.56" -axum = { version = "0.7", default-features = false, features = [ - "tokio", - "http1", - "http2", - "json", - "matched-path", - "original-uri", - "form", - "query", - "ws", -] } +axum = { version = "0.7", default-features = false, features = ["tokio", "http1", "http2", "json", "matched-path", "original-uri", "form", "query", "ws"] } axum-extra = { version = "0.9", features = ["typed-header"] } -backoff = { version = "0.4.0", features = [ - "futures", - "futures-core", - "pin-project-lite", - "tokio", - "tokio_1", -] } +backoff = { version = "0.4.0", features = ["futures", "futures-core", "pin-project-lite", "tokio", "tokio_1"] } base64 = "0.21.2" base64-url = "2" bcs = "0.1.4" @@ -252,11 +233,7 @@ colored = "2.0.0" comfy-table = "6.1.3" const-str = "0.5.3" coset = "0.3" -criterion = { version = "0.5.0", features = [ - "async", - "async_tokio", - "html_reports", -] } +criterion = { version = "0.5.0", features = ["async", "async_tokio", "html_reports"] } crossterm = "0.25.0" csv = "1.2.1" dashmap = "5.5.3" @@ -271,9 +248,7 @@ expect-test = "1.4.0" eyre = "0.6.8" fastcrypto = { git = "https://github.com/MystenLabs/fastcrypto", rev = "5f2c63266a065996d53f98156f0412782b468597" } fastcrypto-tbls = { git = "https://github.com/MystenLabs/fastcrypto", rev = "5f2c63266a065996d53f98156f0412782b468597" } -fastcrypto-vdf = { git = "https://github.com/MystenLabs/fastcrypto", rev = "5f2c63266a065996d53f98156f0412782b468597", features = [ - "experimental", -] } +fastcrypto-vdf = { git = "https://github.com/MystenLabs/fastcrypto", rev = "5f2c63266a065996d53f98156f0412782b468597", features = ["experimental"] } fastcrypto-zkp = { git = "https://github.com/MystenLabs/fastcrypto", rev = "5f2c63266a065996d53f98156f0412782b468597", package = "fastcrypto-zkp" } fdlimit = "0.2.1" flate2 = "1.0.28" @@ -286,12 +261,7 @@ hex = "0.4.3" http = "1" humantime = "2.1.0" hyper = "1" -hyper-rustls = { version = "0.27", default-features = false, features = [ - "webpki-roots", - "http2", - "ring", - "tls12", -] } +hyper-rustls = { version = "0.27", default-features = false, features = ["webpki-roots", "http2", "ring", "tls12"] } im = "15" indexmap = { version = "2.1.0", features = ["serde"] } indicatif = "0.17.2" @@ -299,13 +269,7 @@ insta = { version = "1.21.1", features = ["redactions", "yaml", "json"] } integer-encoding = "3.0.1" itertools = "0.13.0" json_to_table = { git = "https://github.com/zhiburt/tabled/", rev = "e449317a1c02eb6b29e409ad6617e5d9eb7b3bd4" } -jsonrpsee = { version = "0.24", features = [ - "server", - "macros", - "client", - "ws-client", - "http-client", -] } +jsonrpsee = { version = "0.24", features = ["server", "macros", "client", "ws-client", "http-client"] } leb128 = "0.2.5" lru = "0.12" mockall = "0.11.4" @@ -334,19 +298,9 @@ quote = "1.0.23" rand = "0.8.5" rayon = "1.5.3" regex = "1.7.1" -reqwest = { version = "0.12", default-features = false, features = [ - "http2", - "json", - "rustls-tls", -] } +reqwest = { version = "0.12", default-features = false, features = ["http2", "json", "rustls-tls"] } roaring = "0.10.6" -rocksdb = { version = "0.21.0", default-features = false, features = [ - "snappy", - "lz4", - "zstd", - "zlib", - "multi-threaded-cf", -] } +rocksdb = { version = "0.21.0", default-features = false, features = ["snappy", "lz4", "zstd", "zlib", "multi-threaded-cf"] } rstest = "0.16.0" rustls = { version = "0.23.18", default-features = false, features = ["std", "tls12", "ring"] } schemars = { version = "0.8.21", features = ["either"] } @@ -374,10 +328,7 @@ thiserror = "1.0.40" # tokio is defined at a specific version to support patching with iota-sim # Do not upgrade without updating https://github.com/iotaledger/iota-sim first tokio = "=1.39.2" -tokio-rustls = { version = "0.26", default-features = false, features = [ - "tls12", - "ring", -] } +tokio-rustls = { version = "0.26", default-features = false, features = ["tls12", "ring"] } tokio-stream = { version = "0.1.14", features = ["sync", "net"] } tokio-util = "0.7.10" toml = { version = "0.7.4", features = ["preserve_order"] } @@ -387,31 +338,10 @@ toml = { version = "0.7.4", features = ["preserve_order"] } tonic = { version = "0.12", features = ["transport"] } tonic-build = { version = "0.12", features = ["prost", "transport"] } tonic-health = "0.12" -tower = { version = "0.4.12", features = [ - "full", - "util", - "timeout", - "load-shed", - "limit", -] } -tower-http = { version = "0.5", features = [ - "cors", - "full", - "trace", - "set-header", - "propagate-header", -] } +tower = { version = "0.4.12", features = ["full", "util", "timeout", "load-shed", "limit"] } +tower-http = { version = "0.5", features = ["cors", "full", "trace", "set-header", "propagate-header"] } tracing = "0.1.37" -tracing-subscriber = { version = "0.3.15", default-features = false, features = [ - "std", - "smallvec", - "fmt", - "ansi", - "time", - "json", - "registry", - "env-filter", -] } +tracing-subscriber = { version = "0.3.15", default-features = false, features = ["std", "smallvec", "fmt", "ansi", "time", "json", "registry", "env-filter"] } unescape = "0.1.0" url = "2.3.1" uuid = { version = "1.1.2", features = ["v4", "fast-rng"] } @@ -520,9 +450,7 @@ move-transactional-test-runner = { path = "external-crates/move/crates/move-tran move-unit-test = { path = "external-crates/move/crates/move-unit-test" } move-vm-config = { path = "external-crates/move/crates/move-vm-config" } move-vm-profiler = { path = "external-crates/move/crates/move-vm-profiler" } -move-vm-test-utils = { path = "external-crates/move/crates/move-vm-test-utils/", features = [ - "tiered-gas", -] } +move-vm-test-utils = { path = "external-crates/move/crates/move-vm-test-utils/", features = ["tiered-gas"] } move-vm-types = { path = "external-crates/move/crates/move-vm-types" } prometheus-closure-metric = { path = "crates/prometheus-closure-metric" } shared-crypto = { path = "crates/shared-crypto" } From 5cb5452de29bec10d60a250c26690e5d107eeb46 Mon Sep 17 00:00:00 2001 From: /alex/ Date: Mon, 2 Dec 2024 10:35:54 +0100 Subject: [PATCH 117/124] run cargo_sort.py --- Cargo.toml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index 83ac006cf50..d9a5cb5b76b 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -190,12 +190,12 @@ strip = 'none' opt-level = 2 [profile.simulator] -inherits = "test" debug = true debug-assertions = true -overflow-checks = true +inherits = "test" # opt-level 1 gives >5x speedup for simulator tests without slowing down build times very much. opt-level = 1 +overflow-checks = true [workspace.lints.rust] unexpected_cfgs = { level = "warn", check-cfg = ['cfg(msim)', 'cfg(fail_points)'] } From 57664154741108bfd9679f7c725f01c848ad5138 Mon Sep 17 00:00:00 2001 From: Thibault Martinez Date: Tue, 3 Dec 2024 09:55:01 +0100 Subject: [PATCH 118/124] chore(ci): clean version pin comments (#4317) * chore(ci): clean version pin comments * labeler --- .github/actions/diffs/action.yml | 4 +- .github/actions/turbo-diffs/action.yml | 6 +-- .github/workflows/_cargo_deny.yml | 4 +- .github/workflows/_docs_lint.yml | 4 +- .github/workflows/_docusaurus.yml | 6 +-- .github/workflows/_e2e.yml | 10 ++-- .github/workflows/_execution_cut.yml | 6 +-- .github/workflows/_external_rust_tests.yml | 6 +-- .github/workflows/_ledgernano.yml | 6 +-- .github/workflows/_move_ide.yml | 12 ++--- .github/workflows/_move_tests.yml | 4 +- .github/workflows/_rust.yml | 8 ++-- .github/workflows/_rust_lints.yml | 8 ++-- .github/workflows/_rust_tests.yml | 22 ++++----- .github/workflows/_turborepo.yml | 18 +++---- .github/workflows/_typos.yml | 4 +- .github/workflows/apps_backend_deploy.yml | 10 ++-- .github/workflows/apps_explorer_deploy.yml | 10 ++-- .github/workflows/apps_ui_kit_deploy.yml | 8 ++-- .../apps_wallet_dashboard_deploy.yml | 10 ++-- .../workflows/apps_wallet_nightly_build.yml | 10 ++-- .github/workflows/apps_wallet_prod_build.yml | 12 ++--- .github/workflows/apps_wallet_rc_build.yml | 10 ++-- .github/workflows/build_nightly.yml | 6 +-- .github/workflows/changesets.yml | 8 ++-- .github/workflows/changesets_ci.yml | 10 ++-- .github/workflows/changesets_ci_comment.yml | 8 ++-- .github/workflows/changesets_publish.yml | 6 +-- .github/workflows/crate_docs.yml | 6 +-- .github/workflows/develop_ci_slack_report.yml | 2 +- .github/workflows/hierarchy.yml | 6 +-- .github/workflows/labeler.yml | 6 +-- .github/workflows/links_checker.yml | 8 ++-- .github/workflows/nightly.yml | 4 +- .github/workflows/preview_wiki.yml | 8 ++-- .github/workflows/release.yml | 14 +++--- .github/workflows/release_docker.yml | 48 +++++++++---------- .github/workflows/release_notes_monitor.yml | 6 +-- .github/workflows/release_wiki.yml | 6 +-- .github/workflows/simulator_nightly.yml | 12 ++--- .github/workflows/split_cluster.yml | 4 +- .github/workflows/stale.yml | 2 +- .github/workflows/tag.yml | 4 +- 43 files changed, 186 insertions(+), 186 deletions(-) diff --git a/.github/actions/diffs/action.yml b/.github/actions/diffs/action.yml index ac54e779fdd..c7bc240b392 100644 --- a/.github/actions/diffs/action.yml +++ b/.github/actions/diffs/action.yml @@ -20,9 +20,9 @@ outputs: runs: using: composite steps: - - uses: actions/checkout@eef61447b9ff4aafe5dcd4e0bbf5d482be7e7871 # pin@v4 + - uses: actions/checkout@eef61447b9ff4aafe5dcd4e0bbf5d482be7e7871 # v4.2.1 - name: Detect Changes - uses: dorny/paths-filter@de90cc6fb38fc0963ad72b210f1f284cd68cea36 # pin@v3 + uses: dorny/paths-filter@de90cc6fb38fc0963ad72b210f1f284cd68cea36 # v3.0.2 id: diff with: filters: | diff --git a/.github/actions/turbo-diffs/action.yml b/.github/actions/turbo-diffs/action.yml index 5ecf523d527..60e9302aca9 100644 --- a/.github/actions/turbo-diffs/action.yml +++ b/.github/actions/turbo-diffs/action.yml @@ -7,11 +7,11 @@ outputs: runs: using: composite steps: - - uses: actions/checkout@eef61447b9ff4aafe5dcd4e0bbf5d482be7e7871 # pin@v4 + - uses: actions/checkout@eef61447b9ff4aafe5dcd4e0bbf5d482be7e7871 # v4.2.1 with: fetch-depth: 0 - - uses: pnpm/action-setup@fe02b34f77f8bc703788d5817da081398fad5dd2 # pin@v4 - - uses: actions/setup-node@0a44ba7841725637a19e28fa30b79a866c81b0a6 # pin@v4 + - uses: pnpm/action-setup@fe02b34f77f8bc703788d5817da081398fad5dd2 # v4.0.0 + - uses: actions/setup-node@0a44ba7841725637a19e28fa30b79a866c81b0a6 # v4.0.4 with: node-version: "20" - id: changes diff --git a/.github/workflows/_cargo_deny.yml b/.github/workflows/_cargo_deny.yml index 911cdca4016..aab5dac50a3 100644 --- a/.github/workflows/_cargo_deny.yml +++ b/.github/workflows/_cargo_deny.yml @@ -17,12 +17,12 @@ jobs: name: cargo deny (bans, licenses, sources) runs-on: [self-hosted] steps: - - uses: actions/checkout@eef61447b9ff4aafe5dcd4e0bbf5d482be7e7871 # pin@v4 + - uses: actions/checkout@eef61447b9ff4aafe5dcd4e0bbf5d482be7e7871 # v4.2.1 - run: cargo deny --manifest-path ${{ inputs.manifest-path || './Cargo.toml' }} check bans licenses sources advisories: name: cargo deny (advisories) runs-on: [self-hosted] steps: - - uses: actions/checkout@eef61447b9ff4aafe5dcd4e0bbf5d482be7e7871 # pin@v4 + - uses: actions/checkout@eef61447b9ff4aafe5dcd4e0bbf5d482be7e7871 # v4.2.1 - run: cargo deny --manifest-path ${{ inputs.manifest-path || './Cargo.toml' }} check advisories diff --git a/.github/workflows/_docs_lint.yml b/.github/workflows/_docs_lint.yml index 58435476537..35314d3f409 100644 --- a/.github/workflows/_docs_lint.yml +++ b/.github/workflows/_docs_lint.yml @@ -12,8 +12,8 @@ jobs: runs-on: [self-hosted] steps: - - uses: actions/checkout@eef61447b9ff4aafe5dcd4e0bbf5d482be7e7871 # pin@v4 + - uses: actions/checkout@eef61447b9ff4aafe5dcd4e0bbf5d482be7e7871 # v4.2.1 - name: Spell Check Docs - uses: crate-ci/typos@945d407a5fc9097f020969446a16f581612ab4df # pin@v1.24.5 + uses: crate-ci/typos@945d407a5fc9097f020969446a16f581612ab4df # v1.24.5 with: files: ./docs/content diff --git a/.github/workflows/_docusaurus.yml b/.github/workflows/_docusaurus.yml index b62d6eb2f32..e13b4f0e13b 100644 --- a/.github/workflows/_docusaurus.yml +++ b/.github/workflows/_docusaurus.yml @@ -12,12 +12,12 @@ jobs: runs-on: self-hosted steps: - name: Checkout - uses: actions/checkout@eef61447b9ff4aafe5dcd4e0bbf5d482be7e7871 # pin@v4 + uses: actions/checkout@eef61447b9ff4aafe5dcd4e0bbf5d482be7e7871 # v4.2.1 with: fetch-depth: 2 - - uses: pnpm/action-setup@fe02b34f77f8bc703788d5817da081398fad5dd2 # pin@v4 + - uses: pnpm/action-setup@fe02b34f77f8bc703788d5817da081398fad5dd2 # v4.0.0 - name: Install Nodejs - uses: actions/setup-node@0a44ba7841725637a19e28fa30b79a866c81b0a6 # pin@v4 + uses: actions/setup-node@0a44ba7841725637a19e28fa30b79a866c81b0a6 # v4.0.4 with: node-version: "20" cache: "pnpm" diff --git a/.github/workflows/_e2e.yml b/.github/workflows/_e2e.yml index 21cccf3a81c..c68e7efb83f 100644 --- a/.github/workflows/_e2e.yml +++ b/.github/workflows/_e2e.yml @@ -48,11 +48,11 @@ jobs: ports: - 5432:5432 steps: - - uses: actions/checkout@eef61447b9ff4aafe5dcd4e0bbf5d482be7e7871 # pin@v4 - - uses: pnpm/action-setup@fe02b34f77f8bc703788d5817da081398fad5dd2 # pin@v4 + - uses: actions/checkout@eef61447b9ff4aafe5dcd4e0bbf5d482be7e7871 # v4.2.1 + - uses: pnpm/action-setup@fe02b34f77f8bc703788d5817da081398fad5dd2 # v4.0.0 - run: cargo build --bin iota --features indexer --profile dev - name: Install Nodejs - uses: actions/setup-node@0a44ba7841725637a19e28fa30b79a866c81b0a6 # pin@v4 + uses: actions/setup-node@0a44ba7841725637a19e28fa30b79a866c81b0a6 # v4.0.4 with: node-version: "20" cache: "pnpm" @@ -89,7 +89,7 @@ jobs: - name: Run Explorer e2e tests if: inputs.isTypescriptSDK || inputs.isExplorer || inputs.isRust || github.ref_name == 'develop' run: pnpm --filter iota-explorer playwright test - - uses: actions/upload-artifact@b4b15b8c7c6ac21ea08fcf65892d2ee8f75cf882 # pin@v4 + - uses: actions/upload-artifact@b4b15b8c7c6ac21ea08fcf65892d2ee8f75cf882 # v4.4.3 if: always() with: name: playwright-report-explorer @@ -115,7 +115,7 @@ jobs: if: inputs.isWallet || inputs.isRust || inputs.isTypescriptSDK || github.ref_name == 'develop' run: xvfb-run --auto-servernum --server-args="-screen 0 1280x960x24" -- pnpm --filter iota-wallet playwright test - - uses: actions/upload-artifact@b4b15b8c7c6ac21ea08fcf65892d2ee8f75cf882 # pin@v4 + - uses: actions/upload-artifact@b4b15b8c7c6ac21ea08fcf65892d2ee8f75cf882 # v4.4.3 if: always() with: name: playwright-report-wallet diff --git a/.github/workflows/_execution_cut.yml b/.github/workflows/_execution_cut.yml index 14cf87f9679..9c231940a39 100644 --- a/.github/workflows/_execution_cut.yml +++ b/.github/workflows/_execution_cut.yml @@ -11,13 +11,13 @@ jobs: name: cutting a new execution layer runs-on: [self-hosted] steps: - - uses: actions/checkout@eef61447b9ff4aafe5dcd4e0bbf5d482be7e7871 # pin@v4 + - uses: actions/checkout@eef61447b9ff4aafe5dcd4e0bbf5d482be7e7871 # v4.2.1 - name: Install cargo-hakari, and cache the binary - uses: baptiste0928/cargo-install@904927dbe77864e0f2281519fe9d5bd097a220b3 # pin@v3 + uses: baptiste0928/cargo-install@904927dbe77864e0f2281519fe9d5bd097a220b3 # v3.1.1 with: crate: cargo-hakari locked: true - - uses: actions/checkout@eef61447b9ff4aafe5dcd4e0bbf5d482be7e7871 # pin@v4 + - uses: actions/checkout@eef61447b9ff4aafe5dcd4e0bbf5d482be7e7871 # v4.2.1 - name: Make cut run: ./scripts/execution_layer.py cut for_ci_test - name: Check execution builds diff --git a/.github/workflows/_external_rust_tests.yml b/.github/workflows/_external_rust_tests.yml index 015ff4b7676..e787b85f668 100644 --- a/.github/workflows/_external_rust_tests.yml +++ b/.github/workflows/_external_rust_tests.yml @@ -27,8 +27,8 @@ jobs: IOTA_SKIP_SIMTESTS: 1 runs-on: [self-hosted] steps: - - uses: actions/checkout@eef61447b9ff4aafe5dcd4e0bbf5d482be7e7871 # pin@v4 - - uses: taiki-e/install-action@375e0c7f08a66b8c2ba7e7eef31a6f91043a81b0 # pin@v2 + - uses: actions/checkout@eef61447b9ff4aafe5dcd4e0bbf5d482be7e7871 # v4.2.1 + - uses: taiki-e/install-action@375e0c7f08a66b8c2ba7e7eef31a6f91043a81b0 # v2.44.38 with: tool: nextest - name: Install python dependencies @@ -70,6 +70,6 @@ jobs: runs-on: [self-hosted] steps: - - uses: actions/checkout@eef61447b9ff4aafe5dcd4e0bbf5d482be7e7871 # pin@v4 + - uses: actions/checkout@eef61447b9ff4aafe5dcd4e0bbf5d482be7e7871 # v4.2.1 - name: Run Cargo Udeps run: cargo +nightly ci-udeps-external ${{ matrix.flags }} diff --git a/.github/workflows/_ledgernano.yml b/.github/workflows/_ledgernano.yml index 0d9484caf47..316714d376e 100644 --- a/.github/workflows/_ledgernano.yml +++ b/.github/workflows/_ledgernano.yml @@ -11,11 +11,11 @@ jobs: name: Ledgernano runs-on: self-hosted steps: - - uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # Pin v4.1.1 - - uses: pnpm/action-setup@fe02b34f77f8bc703788d5817da081398fad5dd2 # pin@v4.0.0 + - uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1 + - uses: pnpm/action-setup@fe02b34f77f8bc703788d5817da081398fad5dd2 # v4.0.0 - name: Install Nodejs - uses: actions/setup-node@60edb5dd545a775178f52524783378180af0d1f8 # pin@v4.0.2 + uses: actions/setup-node@60edb5dd545a775178f52524783378180af0d1f8 # v4.0.2 with: node-version: "20" cache: "pnpm" diff --git a/.github/workflows/_move_ide.yml b/.github/workflows/_move_ide.yml index 5878489c9aa..d6fba17c64c 100644 --- a/.github/workflows/_move_ide.yml +++ b/.github/workflows/_move_ide.yml @@ -13,12 +13,12 @@ jobs: steps: - name: Checkout - uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # Pin v4.1.1 + uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1 with: ref: ${{ github.event.inputs.iota_repo_ref || github.ref }} - name: Setup Node - uses: actions/setup-node@60edb5dd545a775178f52524783378180af0d1f8 # pin@v4.0.2 + uses: actions/setup-node@60edb5dd545a775178f52524783378180af0d1f8 # v4.0.2 with: node-version: "20" @@ -37,12 +37,12 @@ jobs: steps: - name: Checkout - uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # Pin v4.1.1 + uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1 with: ref: ${{ github.event.inputs.iota_repo_ref || github.ref }} - name: Setup Node - uses: actions/setup-node@60edb5dd545a775178f52524783378180af0d1f8 # pin@v4.0.2 + uses: actions/setup-node@60edb5dd545a775178f52524783378180af0d1f8 # v4.0.2 with: node-version: "20" @@ -78,12 +78,12 @@ jobs: steps: - name: Checkout - uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # Pin v4.1.1 + uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1 with: ref: ${{ github.event.inputs.iota_repo_ref || github.ref }} - name: Setup Node - uses: actions/setup-node@60edb5dd545a775178f52524783378180af0d1f8 # pin@v4.0.2 + uses: actions/setup-node@60edb5dd545a775178f52524783378180af0d1f8 # v4.0.2 with: node-version: "20" diff --git a/.github/workflows/_move_tests.yml b/.github/workflows/_move_tests.yml index b2c2be4b930..a98c7ad8f3f 100644 --- a/.github/workflows/_move_tests.yml +++ b/.github/workflows/_move_tests.yml @@ -20,8 +20,8 @@ jobs: timeout-minutes: 10 runs-on: [self-hosted] steps: - - uses: actions/checkout@eef61447b9ff4aafe5dcd4e0bbf5d482be7e7871 # pin@v4 - - uses: taiki-e/install-action@375e0c7f08a66b8c2ba7e7eef31a6f91043a81b0 # pin@v2 + - uses: actions/checkout@eef61447b9ff4aafe5dcd4e0bbf5d482be7e7871 # v4.2.1 + - uses: taiki-e/install-action@375e0c7f08a66b8c2ba7e7eef31a6f91043a81b0 # v2.44.38 with: tool: nextest - name: Run move tests diff --git a/.github/workflows/_rust.yml b/.github/workflows/_rust.yml index da0c28dc2da..f95a7642424 100644 --- a/.github/workflows/_rust.yml +++ b/.github/workflows/_rust.yml @@ -44,8 +44,8 @@ jobs: outputs: components: ${{ steps.filter.outputs.changes }} steps: - - uses: actions/checkout@eef61447b9ff4aafe5dcd4e0bbf5d482be7e7871 # pin@v4 - - uses: dorny/paths-filter@de90cc6fb38fc0963ad72b210f1f284cd68cea36 # pin@v3 + - uses: actions/checkout@eef61447b9ff4aafe5dcd4e0bbf5d482be7e7871 # v4.2.1 + - uses: dorny/paths-filter@de90cc6fb38fc0963ad72b210f1f284cd68cea36 # v3.0.2 id: filter with: list-files: "json" @@ -57,8 +57,8 @@ jobs: outputs: components: ${{ steps.filter.outputs.changes }} steps: - - uses: actions/checkout@eef61447b9ff4aafe5dcd4e0bbf5d482be7e7871 # pin@v4 - - uses: dorny/paths-filter@de90cc6fb38fc0963ad72b210f1f284cd68cea36 # pin@v3 + - uses: actions/checkout@eef61447b9ff4aafe5dcd4e0bbf5d482be7e7871 # v4.2.1 + - uses: dorny/paths-filter@de90cc6fb38fc0963ad72b210f1f284cd68cea36 # v3.0.2 id: filter with: list-files: "json" diff --git a/.github/workflows/_rust_lints.yml b/.github/workflows/_rust_lints.yml index e42b1b1eb76..43410a38234 100644 --- a/.github/workflows/_rust_lints.yml +++ b/.github/workflows/_rust_lints.yml @@ -21,7 +21,7 @@ jobs: if: (!cancelled() && inputs.isRust) runs-on: [self-hosted] steps: - - uses: actions/checkout@eef61447b9ff4aafe5dcd4e0bbf5d482be7e7871 # pin@v4 + - uses: actions/checkout@eef61447b9ff4aafe5dcd4e0bbf5d482be7e7871 # v4.2.1 - name: Install latest nightly run: rustup toolchain install nightly --component rustfmt --allow-downgrade - name: Check Rust formatting @@ -31,7 +31,7 @@ jobs: if: (!cancelled() && inputs.isRust) runs-on: [self-hosted] steps: - - uses: actions/checkout@eef61447b9ff4aafe5dcd4e0bbf5d482be7e7871 # pin@v4 + - uses: actions/checkout@eef61447b9ff4aafe5dcd4e0bbf5d482be7e7871 # v4.2.1 - name: Check Cargo.toml format and sorting run: | pushd "scripts/cargo_sort" @@ -51,11 +51,11 @@ jobs: - rustfmt runs-on: [self-hosted] steps: - - uses: actions/checkout@eef61447b9ff4aafe5dcd4e0bbf5d482be7e7871 # pin@v4 + - uses: actions/checkout@eef61447b9ff4aafe5dcd4e0bbf5d482be7e7871 # v4.2.1 # TODO(bradh): debug and re-enable this; the caching is breaking the clippy build # Enable caching of the 'librocksdb-sys' crate by additionally caching the # 'librocksdb-sys' src directory which is managed by cargo - # - uses: bmwill/rust-cache@v1 # Fork of 'Swatinem/rust-cache' which allows caching additional paths + # - uses: bmwill/rust-cache@cb2cf0cc7c5198d3364b9630e2c3d457f160790c # v1.4.0 # Fork of 'Swatinem/rust-cache' which allows caching additional paths # with: # path: ~/.cargo/registry/src/**/librocksdb-sys-* diff --git a/.github/workflows/_rust_tests.yml b/.github/workflows/_rust_tests.yml index 7b2857f27fc..5b18626d2ac 100644 --- a/.github/workflows/_rust_tests.yml +++ b/.github/workflows/_rust_tests.yml @@ -36,8 +36,8 @@ jobs: IOTA_SKIP_SIMTESTS: 1 runs-on: [self-hosted] steps: - - uses: actions/checkout@eef61447b9ff4aafe5dcd4e0bbf5d482be7e7871 # pin@v4 - - uses: taiki-e/install-action@375e0c7f08a66b8c2ba7e7eef31a6f91043a81b0 # pin@v2 + - uses: actions/checkout@eef61447b9ff4aafe5dcd4e0bbf5d482be7e7871 # v4.2.1 + - uses: taiki-e/install-action@375e0c7f08a66b8c2ba7e7eef31a6f91043a81b0 # v2.44.38 with: tool: nextest - name: cargo test @@ -72,7 +72,7 @@ jobs: runs-on: [self-hosted] steps: - - uses: actions/checkout@eef61447b9ff4aafe5dcd4e0bbf5d482be7e7871 # pin@v4 + - uses: actions/checkout@eef61447b9ff4aafe5dcd4e0bbf5d482be7e7871 # v4.2.1 - name: Run Cargo Udeps run: cargo +nightly ci-udeps ${{ matrix.flags }} @@ -89,8 +89,8 @@ jobs: - [self-hosted] fail-fast: false steps: - - uses: actions/checkout@eef61447b9ff4aafe5dcd4e0bbf5d482be7e7871 # Pin v4 - - uses: taiki-e/install-action@375e0c7f08a66b8c2ba7e7eef31a6f91043a81b0 # pin@v2 + - uses: actions/checkout@eef61447b9ff4aafe5dcd4e0bbf5d482be7e7871 # v4.2.1 + - uses: taiki-e/install-action@375e0c7f08a66b8c2ba7e7eef31a6f91043a81b0 # v2.44.38 with: tool: nextest - name: benchmark (smoke) @@ -103,7 +103,7 @@ jobs: run: | cargo doc --all-features --workspace --no-deps - name: Install cargo-hakari, and cache the binary - uses: baptiste0928/cargo-install@904927dbe77864e0f2281519fe9d5bd097a220b3 # pin@v3 + uses: baptiste0928/cargo-install@904927dbe77864e0f2281519fe9d5bd097a220b3 # v3.1.1 with: crate: cargo-hakari locked: true @@ -123,8 +123,8 @@ jobs: env: MSIM_WATCHDOG_TIMEOUT_MS: 60000 steps: - - uses: actions/checkout@eef61447b9ff4aafe5dcd4e0bbf5d482be7e7871 # pin@v4 - - uses: taiki-e/install-action@375e0c7f08a66b8c2ba7e7eef31a6f91043a81b0 # pin@v2 + - uses: actions/checkout@eef61447b9ff4aafe5dcd4e0bbf5d482be7e7871 # v4.2.1 + - uses: taiki-e/install-action@375e0c7f08a66b8c2ba7e7eef31a6f91043a81b0 # v2.44.38 with: tool: nextest - name: setup filter @@ -164,7 +164,7 @@ jobs: # timeout-minutes: 45 # runs-on: [self-hosted] # steps: - # - uses: actions/checkout@eef61447b9ff4aafe5dcd4e0bbf5d482be7e7871 # pin@v4 + # - uses: actions/checkout@eef61447b9ff4aafe5dcd4e0bbf5d482be7e7871 # v4.2.1 # - name: Setup environment # run: .github/scripts/rosetta/setup.sh @@ -216,8 +216,8 @@ jobs: ports: - 5432:5432 steps: - - uses: actions/checkout@eef61447b9ff4aafe5dcd4e0bbf5d482be7e7871 # pin@v4 - - uses: taiki-e/install-action@375e0c7f08a66b8c2ba7e7eef31a6f91043a81b0 # pin@v2 + - uses: actions/checkout@eef61447b9ff4aafe5dcd4e0bbf5d482be7e7871 # v4.2.1 + - uses: taiki-e/install-action@375e0c7f08a66b8c2ba7e7eef31a6f91043a81b0 # v2.44.38 with: tool: nextest - name: Install postgresql-client diff --git a/.github/workflows/_turborepo.yml b/.github/workflows/_turborepo.yml index 4e1742f79b1..7d4c7d6142b 100644 --- a/.github/workflows/_turborepo.yml +++ b/.github/workflows/_turborepo.yml @@ -12,10 +12,10 @@ jobs: runs-on: self-hosted steps: - name: Checkout - uses: actions/checkout@eef61447b9ff4aafe5dcd4e0bbf5d482be7e7871 # pin@v4 - - uses: pnpm/action-setup@fe02b34f77f8bc703788d5817da081398fad5dd2 # pin@v4 + uses: actions/checkout@eef61447b9ff4aafe5dcd4e0bbf5d482be7e7871 # v4.2.1 + - uses: pnpm/action-setup@fe02b34f77f8bc703788d5817da081398fad5dd2 # v4.0.0 - name: Install Nodejs - uses: actions/setup-node@0a44ba7841725637a19e28fa30b79a866c81b0a6 # pin@v4 + uses: actions/setup-node@0a44ba7841725637a19e28fa30b79a866c81b0a6 # v4.0.4 with: node-version: "20" - name: Run audit @@ -26,12 +26,12 @@ jobs: runs-on: self-hosted steps: - name: Checkout - uses: actions/checkout@eef61447b9ff4aafe5dcd4e0bbf5d482be7e7871 # pin@v4 + uses: actions/checkout@eef61447b9ff4aafe5dcd4e0bbf5d482be7e7871 # v4.2.1 with: fetch-depth: 2 - - uses: pnpm/action-setup@fe02b34f77f8bc703788d5817da081398fad5dd2 # pin@v4 + - uses: pnpm/action-setup@fe02b34f77f8bc703788d5817da081398fad5dd2 # v4.0.0 - name: Install Nodejs - uses: actions/setup-node@0a44ba7841725637a19e28fa30b79a866c81b0a6 # pin@v4 + uses: actions/setup-node@0a44ba7841725637a19e28fa30b79a866c81b0a6 # v4.0.4 with: node-version: "20" cache: "pnpm" @@ -41,7 +41,7 @@ jobs: run: pnpm manypkg check - name: Turbo Cache id: turbo-cache - uses: actions/cache@3624ceb22c1c5a301c8db4169662070a689d9ea8 # pin@v4 + uses: actions/cache@3624ceb22c1c5a301c8db4169662070a689d9ea8 # v4.1.1 with: path: .turbo key: turbo-${{ runner.os }}-${{ github.sha }} @@ -50,7 +50,7 @@ jobs: - name: Lint run: pnpm turbo lint - name: Install wasm-pack for mbf package - uses: jetli/wasm-pack-action@0d096b08b4e5a7de8c28de67e11e945404e9eefa # pin@v0.4.0 + uses: jetli/wasm-pack-action@0d096b08b4e5a7de8c28de67e11e945404e9eefa # v0.4.0 with: version: "latest" - name: Build @@ -66,7 +66,7 @@ jobs: - name: Wallet Extension Preview Package if: steps.wallet-diff.outcome == 'failure' run: pnpm --filter iota-wallet pack:zip - - uses: actions/upload-artifact@b4b15b8c7c6ac21ea08fcf65892d2ee8f75cf882 # pin@v4 + - uses: actions/upload-artifact@b4b15b8c7c6ac21ea08fcf65892d2ee8f75cf882 # v4.4.3 if: steps.wallet-diff.outcome == 'failure' with: name: wallet-extension diff --git a/.github/workflows/_typos.yml b/.github/workflows/_typos.yml index 05f6a69030f..1747c0ca15a 100644 --- a/.github/workflows/_typos.yml +++ b/.github/workflows/_typos.yml @@ -12,9 +12,9 @@ jobs: runs-on: ubuntu-latest steps: - name: Checkout Actions Repository - uses: actions/checkout@eef61447b9ff4aafe5dcd4e0bbf5d482be7e7871 # pin@v4 + uses: actions/checkout@eef61447b9ff4aafe5dcd4e0bbf5d482be7e7871 # v4.2.1 - name: Check spelling - uses: crate-ci/typos@945d407a5fc9097f020969446a16f581612ab4df # pin@v1.24.5 + uses: crate-ci/typos@945d407a5fc9097f020969446a16f581612ab4df # v1.24.5 with: config: ./.typos.toml diff --git a/.github/workflows/apps_backend_deploy.yml b/.github/workflows/apps_backend_deploy.yml index 38c919e73f5..63c5b01a9e6 100644 --- a/.github/workflows/apps_backend_deploy.yml +++ b/.github/workflows/apps_backend_deploy.yml @@ -19,10 +19,10 @@ jobs: pull-requests: write runs-on: [self-hosted] steps: - - uses: actions/checkout@eef61447b9ff4aafe5dcd4e0bbf5d482be7e7871 # pin@v4 - - uses: pnpm/action-setup@fe02b34f77f8bc703788d5817da081398fad5dd2 # pin@v4 + - uses: actions/checkout@eef61447b9ff4aafe5dcd4e0bbf5d482be7e7871 # v4.2.1 + - uses: pnpm/action-setup@fe02b34f77f8bc703788d5817da081398fad5dd2 # v4.0.0 - name: Install Nodejs - uses: actions/setup-node@0a44ba7841725637a19e28fa30b79a866c81b0a6 # pin@v4 + uses: actions/setup-node@0a44ba7841725637a19e28fa30b79a866c81b0a6 # v4.0.4 with: node-version: "20" cache: "pnpm" @@ -42,7 +42,7 @@ jobs: fi - name: Turbo Cache id: turbo-cache - uses: actions/cache@3624ceb22c1c5a301c8db4169662070a689d9ea8 # pin@v4 + uses: actions/cache@3624ceb22c1c5a301c8db4169662070a689d9ea8 # v4.1.1 with: path: node_modules/.cache/turbo key: turbo-${{ runner.os }}-${{ github.sha }} @@ -64,7 +64,7 @@ jobs: run: echo "DEPLOY_URL=$(cat vercel_output.txt | awk 'END{print}')" >> $GITHUB_OUTPUT - name: Comment on pull request if: ${{ inputs.isProd == false }} - uses: actions/github-script@60a0d83039c74a4aee543508d2ffcb1c3799cdea # pin@v7 + uses: actions/github-script@60a0d83039c74a4aee543508d2ffcb1c3799cdea # v7.0.1 with: github-token: ${{ secrets.GITHUB_TOKEN }} script: | diff --git a/.github/workflows/apps_explorer_deploy.yml b/.github/workflows/apps_explorer_deploy.yml index 10badc709fc..0b57bb6b97c 100644 --- a/.github/workflows/apps_explorer_deploy.yml +++ b/.github/workflows/apps_explorer_deploy.yml @@ -30,10 +30,10 @@ jobs: pull-requests: write runs-on: [self-hosted] steps: - - uses: actions/checkout@eef61447b9ff4aafe5dcd4e0bbf5d482be7e7871 # pin@v4 - - uses: pnpm/action-setup@fe02b34f77f8bc703788d5817da081398fad5dd2 # pin@v4 + - uses: actions/checkout@eef61447b9ff4aafe5dcd4e0bbf5d482be7e7871 # v4.2.1 + - uses: pnpm/action-setup@fe02b34f77f8bc703788d5817da081398fad5dd2 # v4.0.0 - name: Install Nodejs - uses: actions/setup-node@0a44ba7841725637a19e28fa30b79a866c81b0a6 # pin@v4 + uses: actions/setup-node@0a44ba7841725637a19e28fa30b79a866c81b0a6 # v4.0.4 with: node-version: "20" cache: "pnpm" @@ -53,7 +53,7 @@ jobs: fi - name: Turbo Cache id: turbo-cache - uses: actions/cache@3624ceb22c1c5a301c8db4169662070a689d9ea8 # pin@v4 + uses: actions/cache@3624ceb22c1c5a301c8db4169662070a689d9ea8 # v4.1.1 with: path: node_modules/.cache/turbo key: turbo-${{ runner.os }}-${{ github.sha }} @@ -80,7 +80,7 @@ jobs: run: vercel alias ${{ steps.deploy_url.outputs.DEPLOY_URL }} $EXPLORER_VERCEL_PROJECT_STAGING_URL --token=${{ secrets.VERCEL_TOKEN }} --scope=${{ secrets.VERCEL_SCOPE }} - name: Comment on pull request if: ${{ inputs.isProd == false && inputs.isStaging == false }} - uses: actions/github-script@60a0d83039c74a4aee543508d2ffcb1c3799cdea # pin@v7 + uses: actions/github-script@60a0d83039c74a4aee543508d2ffcb1c3799cdea # v7.0.1 with: github-token: ${{ secrets.GITHUB_TOKEN }} script: | diff --git a/.github/workflows/apps_ui_kit_deploy.yml b/.github/workflows/apps_ui_kit_deploy.yml index bbb003fb875..3c2f4e753f5 100644 --- a/.github/workflows/apps_ui_kit_deploy.yml +++ b/.github/workflows/apps_ui_kit_deploy.yml @@ -19,10 +19,10 @@ jobs: pull-requests: write runs-on: [self-hosted] steps: - - uses: actions/checkout@eef61447b9ff4aafe5dcd4e0bbf5d482be7e7871 # pin@v4 - - uses: pnpm/action-setup@fe02b34f77f8bc703788d5817da081398fad5dd2 # pin@v4 + - uses: actions/checkout@eef61447b9ff4aafe5dcd4e0bbf5d482be7e7871 # v4.2.1 + - uses: pnpm/action-setup@fe02b34f77f8bc703788d5817da081398fad5dd2 # v4.0.0 - name: Install Nodejs - uses: actions/setup-node@0a44ba7841725637a19e28fa30b79a866c81b0a6 # pin@v4 + uses: actions/setup-node@0a44ba7841725637a19e28fa30b79a866c81b0a6 # v4.0.4 with: node-version: "20" cache: "pnpm" @@ -54,7 +54,7 @@ jobs: run: echo "DEPLOY_URL=$(cat vercel_output.txt | awk 'END{print}')" >> $GITHUB_OUTPUT - name: Comment on pull request if: ${{ inputs.isProd == false }} - uses: actions/github-script@60a0d83039c74a4aee543508d2ffcb1c3799cdea # pin@v7 + uses: actions/github-script@60a0d83039c74a4aee543508d2ffcb1c3799cdea # v7.0.1 with: github-token: ${{ secrets.GITHUB_TOKEN }} script: | diff --git a/.github/workflows/apps_wallet_dashboard_deploy.yml b/.github/workflows/apps_wallet_dashboard_deploy.yml index 97bd8ae6670..d3ae3f5f284 100644 --- a/.github/workflows/apps_wallet_dashboard_deploy.yml +++ b/.github/workflows/apps_wallet_dashboard_deploy.yml @@ -19,10 +19,10 @@ jobs: pull-requests: write runs-on: [self-hosted] steps: - - uses: actions/checkout@eef61447b9ff4aafe5dcd4e0bbf5d482be7e7871 # pin@v4 - - uses: pnpm/action-setup@fe02b34f77f8bc703788d5817da081398fad5dd2 # pin@v4 + - uses: actions/checkout@eef61447b9ff4aafe5dcd4e0bbf5d482be7e7871 # v4.2.1 + - uses: pnpm/action-setup@fe02b34f77f8bc703788d5817da081398fad5dd2 # v4.0.0 - name: Install Nodejs - uses: actions/setup-node@0a44ba7841725637a19e28fa30b79a866c81b0a6 # pin@v4 + uses: actions/setup-node@0a44ba7841725637a19e28fa30b79a866c81b0a6 # v4.0.4 with: node-version: "20" cache: "pnpm" @@ -42,7 +42,7 @@ jobs: fi - name: Turbo Cache id: turbo-cache - uses: actions/cache@3624ceb22c1c5a301c8db4169662070a689d9ea8 # pin@v4 + uses: actions/cache@3624ceb22c1c5a301c8db4169662070a689d9ea8 # v4.1.1 with: path: node_modules/.cache/turbo key: turbo-${{ runner.os }}-${{ github.sha }} @@ -66,7 +66,7 @@ jobs: run: echo "DEPLOY_URL=$(cat vercel_output.txt | awk 'END{print}')" >> $GITHUB_OUTPUT - name: Comment on pull request if: ${{ inputs.isProd == false }} - uses: actions/github-script@60a0d83039c74a4aee543508d2ffcb1c3799cdea # pin@v7 + uses: actions/github-script@60a0d83039c74a4aee543508d2ffcb1c3799cdea # v7.0.1 with: github-token: ${{ secrets.GITHUB_TOKEN }} script: | diff --git a/.github/workflows/apps_wallet_nightly_build.yml b/.github/workflows/apps_wallet_nightly_build.yml index 267b940df18..32c5e429273 100644 --- a/.github/workflows/apps_wallet_nightly_build.yml +++ b/.github/workflows/apps_wallet_nightly_build.yml @@ -25,10 +25,10 @@ jobs: export artifact_name="wallet-nightly-$(date -Idate)" echo "artifact_name=${artifact_name}" >> $GITHUB_ENV - name: Checking out - uses: actions/checkout@eef61447b9ff4aafe5dcd4e0bbf5d482be7e7871 # pin@v4 - - uses: pnpm/action-setup@fe02b34f77f8bc703788d5817da081398fad5dd2 # pin@v4 + uses: actions/checkout@eef61447b9ff4aafe5dcd4e0bbf5d482be7e7871 # v4.2.1 + - uses: pnpm/action-setup@fe02b34f77f8bc703788d5817da081398fad5dd2 # v4.0.0 - name: Install Nodejs - uses: actions/setup-node@0a44ba7841725637a19e28fa30b79a866c81b0a6 # pin@v4 + uses: actions/setup-node@0a44ba7841725637a19e28fa30b79a866c81b0a6 # v4.0.4 with: node-version: "20" cache: "pnpm" @@ -36,7 +36,7 @@ jobs: run: pnpm install --frozen-lockfile - name: Turbo Cache id: turbo-cache - uses: actions/cache@3624ceb22c1c5a301c8db4169662070a689d9ea8 # pin@v4 + uses: actions/cache@3624ceb22c1c5a301c8db4169662070a689d9ea8 # v4.1.1 with: path: node_modules/.cache/turbo key: turbo-${{ runner.os }}-${{ github.sha }} @@ -45,7 +45,7 @@ jobs: - name: Build Wallet run: pnpm wallet build:nightly - name: Upload artifacts - uses: actions/upload-artifact@b4b15b8c7c6ac21ea08fcf65892d2ee8f75cf882 # pin@v4 + uses: actions/upload-artifact@b4b15b8c7c6ac21ea08fcf65892d2ee8f75cf882 # v4.4.3 with: name: ${{ env.artifact_name }} path: | diff --git a/.github/workflows/apps_wallet_prod_build.yml b/.github/workflows/apps_wallet_prod_build.yml index 7fe6657ef78..3deb10ac329 100644 --- a/.github/workflows/apps_wallet_prod_build.yml +++ b/.github/workflows/apps_wallet_prod_build.yml @@ -19,10 +19,10 @@ jobs: runs-on: [self-hosted] steps: - name: Checking out the repository - uses: actions/checkout@f43a0e5ff2bd294095638e18286ca9a3d1956744 # pin@v3 - - uses: pnpm/action-setup@fe02b34f77f8bc703788d5817da081398fad5dd2 # pin@v4.0.0 + uses: actions/checkout@f43a0e5ff2bd294095638e18286ca9a3d1956744 # v3.6.0 + - uses: pnpm/action-setup@fe02b34f77f8bc703788d5817da081398fad5dd2 # v4.0.0 - name: Install Nodejs - uses: actions/setup-node@60edb5dd545a775178f52524783378180af0d1f8 # pin@v4.0.2 + uses: actions/setup-node@60edb5dd545a775178f52524783378180af0d1f8 # v4.0.2 with: node-version: "20" cache: "pnpm" @@ -30,7 +30,7 @@ jobs: run: pnpm install --frozen-lockfile - name: get-npm-version id: package-version - uses: martinbeentjes/npm-get-version-action@3cf273023a0dda27efcd3164bdfb51908dd46a5b # pin@v1.3.1 + uses: martinbeentjes/npm-get-version-action@3cf273023a0dda27efcd3164bdfb51908dd46a5b # v1.3.1 with: path: apps/wallet - name: Create artifact name @@ -71,7 +71,7 @@ jobs: run: echo "::set-output name=version::${GITHUB_REF#refs/tags/wallet-v}" - name: Create GitHub Release - uses: elgohr/Github-Release-Action@c5ea99036abb741a89f8bf1f2cd7fba845e3313a # pin@v5 + uses: elgohr/Github-Release-Action@c5ea99036abb741a89f8bf1f2cd7fba845e3313a # v5.0.0 env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} with: @@ -83,7 +83,7 @@ jobs: draft: true prerelease: false - name: Upload artifacts - uses: actions/upload-artifact@b4b15b8c7c6ac21ea08fcf65892d2ee8f75cf882 # pin@v4 + uses: actions/upload-artifact@b4b15b8c7c6ac21ea08fcf65892d2ee8f75cf882 # v4.4.3 with: name: ${{ env.artifact_name }} path: | diff --git a/.github/workflows/apps_wallet_rc_build.yml b/.github/workflows/apps_wallet_rc_build.yml index 625c6cbc23f..bfbf13ac1f3 100644 --- a/.github/workflows/apps_wallet_rc_build.yml +++ b/.github/workflows/apps_wallet_rc_build.yml @@ -21,10 +21,10 @@ jobs: runs-on: [self-hosted] steps: - name: Checking out ${{ env.iota_branch }} - uses: actions/checkout@f43a0e5ff2bd294095638e18286ca9a3d1956744 # pin@v3 - - uses: pnpm/action-setup@fe02b34f77f8bc703788d5817da081398fad5dd2 # pin@v4.0.0 + uses: actions/checkout@f43a0e5ff2bd294095638e18286ca9a3d1956744 # v3.6.0 + - uses: pnpm/action-setup@fe02b34f77f8bc703788d5817da081398fad5dd2 # v4.0.0 - name: Install Nodejs - uses: actions/setup-node@60edb5dd545a775178f52524783378180af0d1f8 # pin@v4.0.2 + uses: actions/setup-node@60edb5dd545a775178f52524783378180af0d1f8 # v4.0.2 with: node-version: "20" cache: "pnpm" @@ -32,7 +32,7 @@ jobs: run: pnpm install --frozen-lockfile - name: get-npm-version id: package-version - uses: martinbeentjes/npm-get-version-action@3cf273023a0dda27efcd3164bdfb51908dd46a5b # pin@v1.3.1 + uses: martinbeentjes/npm-get-version-action@3cf273023a0dda27efcd3164bdfb51908dd46a5b # v1.3.1 with: path: apps/wallet - name: Create artifact name @@ -43,7 +43,7 @@ jobs: - name: Build Wallet run: pnpm wallet build:rc - name: Upload artifacts - uses: actions/upload-artifact@b4b15b8c7c6ac21ea08fcf65892d2ee8f75cf882 # pin@v4 + uses: actions/upload-artifact@b4b15b8c7c6ac21ea08fcf65892d2ee8f75cf882 # v4.4.3 with: name: ${{ env.artifact_name }} path: | diff --git a/.github/workflows/build_nightly.yml b/.github/workflows/build_nightly.yml index 15f9a91e015..23e1dd3c61f 100644 --- a/.github/workflows/build_nightly.yml +++ b/.github/workflows/build_nightly.yml @@ -53,7 +53,7 @@ jobs: echo "artifact_name=${artifact_name}" >> $GITHUB_ENV - name: Install Foundry - uses: foundry-rs/foundry-toolchain@8f1998e9878d786675189ef566a2e4bf24869773 # pin@v1 + uses: foundry-rs/foundry-toolchain@8f1998e9878d786675189ef566a2e4bf24869773 # v1.2.0 - name: Install PostgreSQL library headers shell: bash @@ -69,7 +69,7 @@ jobs: echo "os_type=${system_os}-${arch}" >> $GITHUB_ENV - name: Checking out ${{ env.iota_branch }} - uses: actions/checkout@eef61447b9ff4aafe5dcd4e0bbf5d482be7e7871 # pin@v4 + uses: actions/checkout@eef61447b9ff4aafe5dcd4e0bbf5d482be7e7871 # v4.2.1 with: ref: ${{ env.iota_branch }} @@ -79,7 +79,7 @@ jobs: [ -f ~/.cargo/env ] && source ~/.cargo/env ; cargo build --release --bin iota --bin iota-indexer --features indexer - name: Upload artifacts - uses: actions/upload-artifact@b4b15b8c7c6ac21ea08fcf65892d2ee8f75cf882 # pin@v4 + uses: actions/upload-artifact@b4b15b8c7c6ac21ea08fcf65892d2ee8f75cf882 # v4.4.3 with: name: ${{ env.artifact_name }} path: | diff --git a/.github/workflows/changesets.yml b/.github/workflows/changesets.yml index 73737505b89..6c01337fad6 100644 --- a/.github/workflows/changesets.yml +++ b/.github/workflows/changesets.yml @@ -14,19 +14,19 @@ jobs: runs-on: self-hosted steps: - name: checkout code repository - uses: actions/checkout@eef61447b9ff4aafe5dcd4e0bbf5d482be7e7871 # pin@v4 + uses: actions/checkout@eef61447b9ff4aafe5dcd4e0bbf5d482be7e7871 # v4.2.1 with: fetch-depth: 0 - - uses: pnpm/action-setup@fe02b34f77f8bc703788d5817da081398fad5dd2 # pin@v4 + - uses: pnpm/action-setup@fe02b34f77f8bc703788d5817da081398fad5dd2 # v4.0.0 - name: Install Nodejs - uses: actions/setup-node@0a44ba7841725637a19e28fa30b79a866c81b0a6 # pin@v4 + uses: actions/setup-node@0a44ba7841725637a19e28fa30b79a866c81b0a6 # v4.0.4 with: node-version: "20" cache: "pnpm" - name: Install dependencies run: pnpm install --frozen-lockfile - name: Create Release Pull Request - uses: changesets/action@f13b1baaa620fde937751f5d2c3572b9da32af23 # pin@v1 + uses: changesets/action@f13b1baaa620fde937751f5d2c3572b9da32af23 # v1.4.5 with: # Generates src/version.ts file using genVersion # https://github.com/changesets/action#with-version-script diff --git a/.github/workflows/changesets_ci.yml b/.github/workflows/changesets_ci.yml index 59449264009..ba30a3e6a97 100644 --- a/.github/workflows/changesets_ci.yml +++ b/.github/workflows/changesets_ci.yml @@ -10,12 +10,12 @@ jobs: runs-on: self-hosted steps: - name: checkout code repository - uses: actions/checkout@eef61447b9ff4aafe5dcd4e0bbf5d482be7e7871 # pin@v4 + uses: actions/checkout@eef61447b9ff4aafe5dcd4e0bbf5d482be7e7871 # v4.2.1 with: fetch-depth: 0 - - uses: pnpm/action-setup@fe02b34f77f8bc703788d5817da081398fad5dd2 # pin@v4 + - uses: pnpm/action-setup@fe02b34f77f8bc703788d5817da081398fad5dd2 # v4.0.0 - name: Install Nodejs - uses: actions/setup-node@0a44ba7841725637a19e28fa30b79a866c81b0a6 # pin@v4 + uses: actions/setup-node@0a44ba7841725637a19e28fa30b79a866c81b0a6 # v4.0.4 with: node-version: "20" cache: "pnpm" @@ -26,7 +26,7 @@ jobs: run: echo "hasChanges=$(pnpm list --filter "...[$(git rev-parse HEAD^1)]" --depth -1 --json | jq "any(.[] | select(.private != true) ; length > 0)")" >> $GITHUB_OUTPUT - name: Get changed files in the changesets folder id: has-changesets - uses: tj-actions/changed-files@c3a1bb2c992d77180ae65be6ae6c166cf40f857c # pin@v45 + uses: tj-actions/changed-files@c3a1bb2c992d77180ae65be6ae6c166cf40f857c # v45.0.3 with: files: | .changeset/** @@ -35,7 +35,7 @@ jobs: run: | echo "true" > missing-changeset.txt - name: Upload missing changeset artifact - uses: actions/upload-artifact@b4b15b8c7c6ac21ea08fcf65892d2ee8f75cf882 # pin@v4 + uses: actions/upload-artifact@b4b15b8c7c6ac21ea08fcf65892d2ee8f75cf882 # v4.4.3 if: steps.has-changesets.outputs.any_changed != 'true' && steps.diff.outputs.hasChanges == 'true' with: name: missing-changeset diff --git a/.github/workflows/changesets_ci_comment.yml b/.github/workflows/changesets_ci_comment.yml index 5bdac435ed9..3deda7d99e4 100644 --- a/.github/workflows/changesets_ci_comment.yml +++ b/.github/workflows/changesets_ci_comment.yml @@ -16,14 +16,14 @@ jobs: github.event.workflow_run.conclusion == 'success' steps: - name: Get workflow run information - uses: potiuk/get-workflow-origin@c657bb36aef4a7402bbe9b2e09a820320f8ff447 # pin@v1 + uses: potiuk/get-workflow-origin@c657bb36aef4a7402bbe9b2e09a820320f8ff447 # v1.0.0 id: source-run-info with: token: ${{ secrets.GITHUB_TOKEN }} sourceRunId: ${{ github.event.workflow_run.id }} - name: "Download artifact" - uses: actions/github-script@60a0d83039c74a4aee543508d2ffcb1c3799cdea # pin@v7 + uses: actions/github-script@60a0d83039c74a4aee543508d2ffcb1c3799cdea # v7.0.1 id: get-artifact if: steps.source-run-info.outputs.pullRequestNumber with: @@ -46,7 +46,7 @@ jobs: return 'true'; - name: Comment PR - uses: thollander/actions-comment-pull-request@fabd468d3a1a0b97feee5f6b9e499eab0dd903f6 # pin@v2 + uses: thollander/actions-comment-pull-request@fabd468d3a1a0b97feee5f6b9e499eab0dd903f6 # v2.5.0 if: steps.get-artifact.outputs.result == 'true' && steps.source-run-info.outputs.pullRequestNumber with: pr_number: ${{ steps.source-run-info.outputs.pullRequestNumber }} @@ -58,7 +58,7 @@ jobs: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - name: Remove outdated comments - uses: actions/github-script@60a0d83039c74a4aee543508d2ffcb1c3799cdea # pin@v7 + uses: actions/github-script@60a0d83039c74a4aee543508d2ffcb1c3799cdea # v7.0.1 if: steps.get-artifact.outputs.result == 'false' && steps.source-run-info.outputs.pullRequestNumber env: ISSUE_NUMBER: ${{ steps.source-run-info.outputs.pullRequestNumber }} diff --git a/.github/workflows/changesets_publish.yml b/.github/workflows/changesets_publish.yml index 61d8bdf7870..42c0d958f58 100644 --- a/.github/workflows/changesets_publish.yml +++ b/.github/workflows/changesets_publish.yml @@ -10,12 +10,12 @@ jobs: runs-on: self-hosted steps: - name: checkout code repository - uses: actions/checkout@eef61447b9ff4aafe5dcd4e0bbf5d482be7e7871 # pin@v4 + uses: actions/checkout@eef61447b9ff4aafe5dcd4e0bbf5d482be7e7871 # v4.2.1 with: fetch-depth: 0 - - uses: pnpm/action-setup@fe02b34f77f8bc703788d5817da081398fad5dd2 # pin@v4 + - uses: pnpm/action-setup@fe02b34f77f8bc703788d5817da081398fad5dd2 # v4.0.0 - name: Install Nodejs - uses: actions/setup-node@0a44ba7841725637a19e28fa30b79a866c81b0a6 # pin@v4 + uses: actions/setup-node@0a44ba7841725637a19e28fa30b79a866c81b0a6 # v4.0.4 with: node-version: "20" cache: "pnpm" diff --git a/.github/workflows/crate_docs.yml b/.github/workflows/crate_docs.yml index 427fa9dea15..8fb8baf1d59 100644 --- a/.github/workflows/crate_docs.yml +++ b/.github/workflows/crate_docs.yml @@ -16,16 +16,16 @@ jobs: runs-on: self-hosted steps: - name: Checkout sources - uses: actions/checkout@eef61447b9ff4aafe5dcd4e0bbf5d482be7e7871 # pin@v4 + uses: actions/checkout@eef61447b9ff4aafe5dcd4e0bbf5d482be7e7871 # v4.2.1 - name: Generate documentation - uses: actions-rs/cargo@ae10961054e4aa8b4aa7dffede299aaf087aa33b # pin@v1.0.3 + uses: actions-rs/cargo@ae10961054e4aa8b4aa7dffede299aaf087aa33b # v1.0.1 with: command: doc args: --workspace --exclude "iota-benchmark" --no-deps - name: Deploy documentation - uses: peaceiris/actions-gh-pages@373f7f263a76c20808c831209c920827a82a2847 # pin@v3 + uses: peaceiris/actions-gh-pages@373f7f263a76c20808c831209c920827a82a2847 # v3.9.3 with: github_token: ${{ secrets.GITHUB_TOKEN }} publish_branch: gh-pages diff --git a/.github/workflows/develop_ci_slack_report.yml b/.github/workflows/develop_ci_slack_report.yml index b024aa65b33..1dc6c0561e1 100644 --- a/.github/workflows/develop_ci_slack_report.yml +++ b/.github/workflows/develop_ci_slack_report.yml @@ -11,7 +11,7 @@ jobs: runs-on: ubuntu-latest if: github.event.workflow_run.conclusion == 'failure' || github.event.workflow_run.conclusion == 'timed_out' steps: - - uses: ravsamhq/notify-slack-action@be814b201e233b2dc673608aa46e5447c8ab13f2 # pin@v2 + - uses: ravsamhq/notify-slack-action@be814b201e233b2dc673608aa46e5447c8ab13f2 # v2.5.0 with: status: ${{ github.event.workflow_run.conclusion }} notification_title: " ${{github.event.workflow_run.name}} - ${{github.event.workflow_run.conclusion}} on ${{github.event.workflow_run.head_branch}}" diff --git a/.github/workflows/hierarchy.yml b/.github/workflows/hierarchy.yml index 6456b3e033a..9c61f02a77d 100644 --- a/.github/workflows/hierarchy.yml +++ b/.github/workflows/hierarchy.yml @@ -32,7 +32,7 @@ jobs: isGraphQlTransport: ${{ (steps.turbo.outputs.packages && contains(fromJson(steps.turbo.outputs.packages), '@iota/graphql-transport')) }} isLedgerjs: ${{ (steps.turbo.outputs.packages && contains(fromJson(steps.turbo.outputs.packages), '@iota/ledgerjs-hw-app-iota')) }} steps: - - uses: actions/checkout@eef61447b9ff4aafe5dcd4e0bbf5d482be7e7871 # pin@v4 + - uses: actions/checkout@eef61447b9ff4aafe5dcd4e0bbf5d482be7e7871 # v4.2.1 - name: Detect Changes (turbo) uses: "./.github/actions/turbo-diffs" id: turbo @@ -46,7 +46,7 @@ jobs: group: dprint-${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} cancel-in-progress: true steps: - - uses: actions/checkout@eef61447b9ff4aafe5dcd4e0bbf5d482be7e7871 # pin@v4 + - uses: actions/checkout@eef61447b9ff4aafe5dcd4e0bbf5d482be7e7871 # v4.2.1 - name: Check dprint formatting run: dprint check @@ -62,7 +62,7 @@ jobs: if: (!cancelled() && needs.diff.outputs.isRust == 'true') runs-on: [self-hosted] steps: - - uses: actions/checkout@eef61447b9ff4aafe5dcd4e0bbf5d482be7e7871 # pin@v4 + - uses: actions/checkout@eef61447b9ff4aafe5dcd4e0bbf5d482be7e7871 # v4.2.1 - name: Run license check run: cargo ci-license diff --git a/.github/workflows/labeler.yml b/.github/workflows/labeler.yml index 02ed863940c..096893042f8 100644 --- a/.github/workflows/labeler.yml +++ b/.github/workflows/labeler.yml @@ -9,15 +9,15 @@ jobs: pull-requests: write runs-on: ubuntu-latest steps: - - uses: actions/checkout@eef61447b9ff4aafe5dcd4e0bbf5d482be7e7871 # pin@v4 - - uses: actions/labeler@8558fd74291d67161a8a78ce36a881fa63b766a9 # pin@v5 + - uses: actions/checkout@eef61447b9ff4aafe5dcd4e0bbf5d482be7e7871 # v4.2.1 + - uses: actions/labeler@8558fd74291d67161a8a78ce36a881fa63b766a9 # v5.0.0 with: repo-token: "${{ secrets.GITHUB_TOKEN }}" team-label: runs-on: ubuntu-latest steps: - - uses: actions/checkout@eef61447b9ff4aafe5dcd4e0bbf5d482be7e7871 # pin@v4 + - uses: actions/checkout@eef61447b9ff4aafe5dcd4e0bbf5d482be7e7871 # v4.2.1 - uses: equitybee/team-label-action@732147c0a9129eb90b16261d14860954fe5ce42a # v1.0.3 with: repo-token: ${{ secrets.TEAM_LABELER_TOKEN }} diff --git a/.github/workflows/links_checker.yml b/.github/workflows/links_checker.yml index 3d17cbeed50..96ee42b70a7 100644 --- a/.github/workflows/links_checker.yml +++ b/.github/workflows/links_checker.yml @@ -16,11 +16,11 @@ jobs: LYCHEE_OUT: ./lychee/links-report steps: ## Check out code using Git - - uses: actions/checkout@eef61447b9ff4aafe5dcd4e0bbf5d482be7e7871 # pin@v4 + - uses: actions/checkout@eef61447b9ff4aafe5dcd4e0bbf5d482be7e7871 # v4.2.1 - name: Check all links at *.md and doc files id: lychee - uses: lycheeverse/lychee-action@2b973e86fc7b1f6b36a93795fe2c9c6ae1118621 # pin@v1.10.0 + uses: lycheeverse/lychee-action@2b973e86fc7b1f6b36a93795fe2c9c6ae1118621 # v1.10.0 with: token: ${{ secrets.GITHUB_TOKEN }} output: ${{ env.LYCHEE_OUT }} @@ -38,14 +38,14 @@ jobs: './**/*.md' - name: Find the last report issue open - uses: micalevisk/last-issue-action@0d40124cc99ac8601c2516007f0c98ef3d27537b # pin@v2.3 + uses: micalevisk/last-issue-action@0d40124cc99ac8601c2516007f0c98ef3d27537b # v2.3.0 id: last-issue with: state: open labels: broken-links - name: Create or update report - uses: peter-evans/create-issue-from-file@e8ef132d6df98ed982188e460ebb3b5d4ef3a9cd # pin@v4 + uses: peter-evans/create-issue-from-file@e8ef132d6df98ed982188e460ebb3b5d4ef3a9cd # v5.0.1 with: title: Link checker report content-filepath: ${{ env.LYCHEE_OUT }} diff --git a/.github/workflows/nightly.yml b/.github/workflows/nightly.yml index 60f3267e804..27268340ad9 100644 --- a/.github/workflows/nightly.yml +++ b/.github/workflows/nightly.yml @@ -51,10 +51,10 @@ jobs: run: | brew install postgresql - - uses: actions/checkout@eef61447b9ff4aafe5dcd4e0bbf5d482be7e7871 # pin@v4 + - uses: actions/checkout@eef61447b9ff4aafe5dcd4e0bbf5d482be7e7871 # v4.2.1 - name: cargo build - uses: actions-rs/cargo@ae10961054e4aa8b4aa7dffede299aaf087aa33b # pin@v1.0.3 + uses: actions-rs/cargo@ae10961054e4aa8b4aa7dffede299aaf087aa33b # v1.0.1 with: command: build args: --all-targets --all-features --release diff --git a/.github/workflows/preview_wiki.yml b/.github/workflows/preview_wiki.yml index 9057346f314..fa9b9733b3a 100644 --- a/.github/workflows/preview_wiki.yml +++ b/.github/workflows/preview_wiki.yml @@ -24,15 +24,15 @@ jobs: runs-on: self-hosted if: github.event.pull_request.draft == false steps: - - uses: actions/checkout@eef61447b9ff4aafe5dcd4e0bbf5d482be7e7871 # pin@v4 + - uses: actions/checkout@eef61447b9ff4aafe5dcd4e0bbf5d482be7e7871 # v4.2.1 - name: Install pnpm - uses: pnpm/action-setup@fe02b34f77f8bc703788d5817da081398fad5dd2 # pin@v4 + uses: pnpm/action-setup@fe02b34f77f8bc703788d5817da081398fad5dd2 # v4.0.0 with: run_install: false - name: Set up Node.js - uses: actions/setup-node@0a44ba7841725637a19e28fa30b79a866c81b0a6 # pin@v4 + uses: actions/setup-node@0a44ba7841725637a19e28fa30b79a866c81b0a6 # v4.0.4 with: node-version: 20 cache: "pnpm" @@ -61,7 +61,7 @@ jobs: working-directory: ./docs/site - name: Update PR with Deployment URL - uses: actions/github-script@60a0d83039c74a4aee543508d2ffcb1c3799cdea # pin@v7 + uses: actions/github-script@60a0d83039c74a4aee543508d2ffcb1c3799cdea # v7.0.1 with: github-token: ${{ secrets.GITHUB_TOKEN }} script: | diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index d63f45ebb51..7addd9967a9 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -64,7 +64,7 @@ jobs: echo "iota_version=${iota_version}" >> $GITHUB_ENV - name: Check out ${{ env.iota_tag }} - uses: actions/checkout@eef61447b9ff4aafe5dcd4e0bbf5d482be7e7871 # pin@v4 + uses: actions/checkout@eef61447b9ff4aafe5dcd4e0bbf5d482be7e7871 # v4.2.1 with: ref: ${{ env.iota_tag }} @@ -96,11 +96,11 @@ jobs: - name: Setup caching # Fork of 'Swatinem/rust-cache' which allows caching additional paths - uses: bmwill/rust-cache@fb63fcd7a959767755b88b5af2f5cbf65fb8a127 # pin@v1 + uses: bmwill/rust-cache@cb2cf0cc7c5198d3364b9630e2c3d457f160790c # v1.4.0 - name: Install nexttest (Windows) if: ${{ matrix.os == 'windows-latest' }} - uses: taiki-e/install-action@375e0c7f08a66b8c2ba7e7eef31a6f91043a81b0 # pin@v2 + uses: taiki-e/install-action@375e0c7f08a66b8c2ba7e7eef31a6f91043a81b0 # v2.44.38 with: tool: nextest @@ -187,7 +187,7 @@ jobs: # choco push iota.${{ env.iota_version }}.nupkg --source https://push.chocolatey.org/ - name: Upload release artifacts for ${{ matrix.os }} platform - uses: actions/upload-artifact@b4b15b8c7c6ac21ea08fcf65892d2ee8f75cf882 # pin@v4 + uses: actions/upload-artifact@b4b15b8c7c6ac21ea08fcf65892d2ee8f75cf882 # v4.4.3 with: name: iota-binaries-${{ matrix.os }} if-no-files-found: error @@ -195,7 +195,7 @@ jobs: ./tmp/iota-${{ env.iota_tag }}-${{ env.os_type }}.tgz - name: Attach artifacts to ${{ env.iota_tag }} release in GH - uses: softprops/action-gh-release@c062e08bd532815e2082a85e87e3ef29c3e6d191 # pin@v2 + uses: softprops/action-gh-release@c062e08bd532815e2082a85e87e3ef29c3e6d191 # v2.0.8 with: tag_name: ${{ env.iota_tag }} files: | @@ -213,7 +213,7 @@ jobs: # run: | # echo "iota_tag=$(echo ${{ env.TAG_NAME }} | sed s/'refs\/tags\/'//)" >> $GITHUB_ENV # echo "versionless_tag=$(echo ${{ env.TAG_NAME }} | sed s/'refs\/tags\/'// | sed s/'testnet\-v'//)" >> $GITHUB_ENV -# - uses: mislav/bump-homebrew-formula-action@b3327118b2153c82da63fd9cbf58942146ee99f0 # pin@v3 +# - uses: mislav/bump-homebrew-formula-action@b3327118b2153c82da63fd9cbf58942146ee99f0 # v3.1.0 # with: # formula-name: iota # create-pullrequest: true @@ -233,7 +233,7 @@ jobs: # runs-on: ubuntu-latest # steps: # - name: Dispatch Tagging of images in DockerHub, in MystenLabs/sui-operations -# uses: peter-evans/repository-dispatch@ff45666b9427631e3450c54a1bcbee4d9ff4d7c0 # pin@v3.0.0 +# uses: peter-evans/repository-dispatch@ff45666b9427631e3450c54a1bcbee4d9ff4d7c0 # v3.0.0 # with: # repository: iotaledger/iota # token: ${{ secrets.DOCKER_BINARY_BUILDS_DISPATCH }} diff --git a/.github/workflows/release_docker.yml b/.github/workflows/release_docker.yml index 0a729c2e815..ba9cb957cad 100644 --- a/.github/workflows/release_docker.yml +++ b/.github/workflows/release_docker.yml @@ -33,17 +33,17 @@ jobs: environment: release steps: - name: Checkout code - uses: actions/checkout@eef61447b9ff4aafe5dcd4e0bbf5d482be7e7871 # pin@v4 + uses: actions/checkout@eef61447b9ff4aafe5dcd4e0bbf5d482be7e7871 # v4.2.1 - name: Set up QEMU - uses: docker/setup-qemu-action@49b3bc8e6bdd4a60e6116a5414239cba5943d3cf # pin@v3 + uses: docker/setup-qemu-action@49b3bc8e6bdd4a60e6116a5414239cba5943d3cf # v3.2.0 - name: Set up Docker Buildx - uses: docker/setup-buildx-action@c47758b77c9736f4b2ef4073d4d51994fabfe349 # pin@v3 + uses: docker/setup-buildx-action@c47758b77c9736f4b2ef4073d4d51994fabfe349 # v3.7.1 - name: Docker meta for iota-node id: meta-node - uses: docker/metadata-action@8e5442c4ef9f78752691e2d8f8d19755c6f78e81 # pin@v5 + uses: docker/metadata-action@8e5442c4ef9f78752691e2d8f8d19755c6f78e81 # v5.5.1 with: images: iotaledger/iota-node # mapping semver tags to networks @@ -61,7 +61,7 @@ jobs: type=raw,value=mainnet,enable=${{ github.event_name == 'release' && !contains(github.ref, '-alpha') && !contains(github.ref, '-beta') && !contains(github.ref, '-rc') }} - name: Login to Docker Registry - uses: docker/login-action@9780b0c442fbb1117ed29e0efdff1e18412f7567 # pin@v3 + uses: docker/login-action@9780b0c442fbb1117ed29e0efdff1e18412f7567 # v3.3.0 with: username: ${{ secrets.DOCKER_REGISTRY_USERNAME }} password: ${{ secrets.DOCKER_REGISTRY_PASSWORD }} @@ -74,7 +74,7 @@ jobs: echo "BUILD_DATE=$(date -u +'%Y-%m-%d')" >> $GITHUB_ENV - name: Build and push Docker image for iota-node - uses: docker/build-push-action@4f58ea79222b3b9dc2c8bbdd6debcef730109a75 # pin@v6 + uses: docker/build-push-action@4f58ea79222b3b9dc2c8bbdd6debcef730109a75 # v6.9.0 with: context: . file: docker/iota-node/Dockerfile @@ -92,17 +92,17 @@ jobs: environment: release steps: - name: Checkout code - uses: actions/checkout@eef61447b9ff4aafe5dcd4e0bbf5d482be7e7871 # pin@v4 + uses: actions/checkout@eef61447b9ff4aafe5dcd4e0bbf5d482be7e7871 # v4.2.1 - name: Set up QEMU - uses: docker/setup-qemu-action@49b3bc8e6bdd4a60e6116a5414239cba5943d3cf # pin@v3 + uses: docker/setup-qemu-action@49b3bc8e6bdd4a60e6116a5414239cba5943d3cf # v3.2.0 - name: Set up Docker Buildx - uses: docker/setup-buildx-action@c47758b77c9736f4b2ef4073d4d51994fabfe349 # pin@v3 + uses: docker/setup-buildx-action@c47758b77c9736f4b2ef4073d4d51994fabfe349 # v3.7.1 - name: Docker meta for iota-indexer id: meta-indexer - uses: docker/metadata-action@8e5442c4ef9f78752691e2d8f8d19755c6f78e81 # pin@v5 + uses: docker/metadata-action@8e5442c4ef9f78752691e2d8f8d19755c6f78e81 # v5.5.1 with: images: iotaledger/iota-indexer # mapping semver tags to networks @@ -120,7 +120,7 @@ jobs: type=raw,value=mainnet,enable=${{ github.event_name == 'release' && !contains(github.ref, '-alpha') && !contains(github.ref, '-beta') && !contains(github.ref, '-rc') }} - name: Login to Docker Registry - uses: docker/login-action@9780b0c442fbb1117ed29e0efdff1e18412f7567 # pin@v3 + uses: docker/login-action@9780b0c442fbb1117ed29e0efdff1e18412f7567 # v3.3.0 with: username: ${{ secrets.DOCKER_REGISTRY_USERNAME }} password: ${{ secrets.DOCKER_REGISTRY_PASSWORD }} @@ -133,7 +133,7 @@ jobs: echo "BUILD_DATE=$(date -u +'%Y-%m-%d')" >> $GITHUB_ENV - name: Build and push Docker image for iota-indexer - uses: docker/build-push-action@4f58ea79222b3b9dc2c8bbdd6debcef730109a75 # pin@v6 + uses: docker/build-push-action@4f58ea79222b3b9dc2c8bbdd6debcef730109a75 # v6.9.0 with: context: . file: docker/iota-indexer/Dockerfile @@ -151,17 +151,17 @@ jobs: environment: release steps: - name: Checkout code - uses: actions/checkout@eef61447b9ff4aafe5dcd4e0bbf5d482be7e7871 # pin@v4 + uses: actions/checkout@eef61447b9ff4aafe5dcd4e0bbf5d482be7e7871 # v4.2.1 - name: Set up QEMU - uses: docker/setup-qemu-action@49b3bc8e6bdd4a60e6116a5414239cba5943d3cf # pin@v3 + uses: docker/setup-qemu-action@49b3bc8e6bdd4a60e6116a5414239cba5943d3cf # v3.2.0 - name: Set up Docker Buildx - uses: docker/setup-buildx-action@c47758b77c9736f4b2ef4073d4d51994fabfe349 # pin@v3 + uses: docker/setup-buildx-action@c47758b77c9736f4b2ef4073d4d51994fabfe349 # v3.7.1 - name: Docker meta for iota-tools id: meta-tools - uses: docker/metadata-action@8e5442c4ef9f78752691e2d8f8d19755c6f78e81 # pin@v5 + uses: docker/metadata-action@8e5442c4ef9f78752691e2d8f8d19755c6f78e81 # v5.5.1 with: images: iotaledger/iota-tools # mapping semver tags to networks @@ -179,7 +179,7 @@ jobs: type=raw,value=mainnet,enable=${{ github.event_name == 'release' && !contains(github.ref, '-alpha') && !contains(github.ref, '-beta') && !contains(github.ref, '-rc') }} - name: Login to Docker Registry - uses: docker/login-action@9780b0c442fbb1117ed29e0efdff1e18412f7567 # pin@v3 + uses: docker/login-action@9780b0c442fbb1117ed29e0efdff1e18412f7567 # v3.3.0 with: username: ${{ secrets.DOCKER_REGISTRY_USERNAME }} password: ${{ secrets.DOCKER_REGISTRY_PASSWORD }} @@ -192,7 +192,7 @@ jobs: echo "BUILD_DATE=$(date -u +'%Y-%m-%d')" >> $GITHUB_ENV - name: Build and push Docker image for iota-tools - uses: docker/build-push-action@4f58ea79222b3b9dc2c8bbdd6debcef730109a75 # pin@v6 + uses: docker/build-push-action@4f58ea79222b3b9dc2c8bbdd6debcef730109a75 # v6.9.0 with: context: . file: docker/iota-tools/Dockerfile @@ -210,17 +210,17 @@ jobs: environment: release steps: - name: Checkout code - uses: actions/checkout@eef61447b9ff4aafe5dcd4e0bbf5d482be7e7871 # pin@v4 + uses: actions/checkout@eef61447b9ff4aafe5dcd4e0bbf5d482be7e7871 # v4.2.1 - name: Set up QEMU - uses: docker/setup-qemu-action@49b3bc8e6bdd4a60e6116a5414239cba5943d3cf # pin@v3 + uses: docker/setup-qemu-action@49b3bc8e6bdd4a60e6116a5414239cba5943d3cf # v3.2.0 - name: Set up Docker Buildx - uses: docker/setup-buildx-action@c47758b77c9736f4b2ef4073d4d51994fabfe349 # pin@v3 + uses: docker/setup-buildx-action@c47758b77c9736f4b2ef4073d4d51994fabfe349 # v3.7.1 - name: Docker meta for iota-graphql-rpc id: meta-tools - uses: docker/metadata-action@8e5442c4ef9f78752691e2d8f8d19755c6f78e81 # pin@v5 + uses: docker/metadata-action@8e5442c4ef9f78752691e2d8f8d19755c6f78e81 # v5.5.1 with: images: iotaledger/iota-graphql-rpc # mapping semver tags to networks @@ -238,7 +238,7 @@ jobs: type=raw,value=mainnet,enable=${{ github.event_name == 'release' && !contains(github.ref, '-alpha') && !contains(github.ref, '-beta') && !contains(github.ref, '-rc') }} - name: Login to Docker Registry - uses: docker/login-action@9780b0c442fbb1117ed29e0efdff1e18412f7567 # pin@v3 + uses: docker/login-action@9780b0c442fbb1117ed29e0efdff1e18412f7567 # v3.3.0 with: username: ${{ secrets.DOCKER_REGISTRY_USERNAME }} password: ${{ secrets.DOCKER_REGISTRY_PASSWORD }} @@ -251,7 +251,7 @@ jobs: echo "BUILD_DATE=$(date -u +'%Y-%m-%d')" >> $GITHUB_ENV - name: Build and push Docker image for iota-graphql-rpc - uses: docker/build-push-action@4f58ea79222b3b9dc2c8bbdd6debcef730109a75 # pin@v6 + uses: docker/build-push-action@4f58ea79222b3b9dc2c8bbdd6debcef730109a75 # v6.9.0 with: context: . file: docker/iota-graphql-rpc/Dockerfile diff --git a/.github/workflows/release_notes_monitor.yml b/.github/workflows/release_notes_monitor.yml index f19fc19bb40..c3c18d815f1 100644 --- a/.github/workflows/release_notes_monitor.yml +++ b/.github/workflows/release_notes_monitor.yml @@ -18,7 +18,7 @@ jobs: steps: - name: Checkout iota repo develop branch - uses: actions/checkout@eef61447b9ff4aafe5dcd4e0bbf5d482be7e7871 # pin@v4 + uses: actions/checkout@eef61447b9ff4aafe5dcd4e0bbf5d482be7e7871 # v4.2.1 with: fetch-depth: 0 ref: develop @@ -63,7 +63,7 @@ jobs: echo "release_notes=${rel_notes}" >> $GITHUB_ENV - name: Configure AWS credentials - uses: aws-actions/configure-aws-credentials@e3dd6a429d7300a6a4c196c26e071d42e0343502 # pin@v4 + uses: aws-actions/configure-aws-credentials@e3dd6a429d7300a6a4c196c26e071d42e0343502 # v4.0.2 with: aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }} aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }} @@ -78,7 +78,7 @@ jobs: echo "slack_id=$(echo ${slack_id} | tr -d '"')" >> $GITHUB_ENV - name: Post to a Slack channel - uses: slackapi/slack-github-action@34c3fd73326693ef04728f8611669d918a2d781d # pin@v1.19.0 + uses: slackapi/slack-github-action@34c3fd73326693ef04728f8611669d918a2d781d # v1.19.0 env: SLACK_BOT_TOKEN: ${{ secrets.SLACK_BOT_TOKEN }} with: diff --git a/.github/workflows/release_wiki.yml b/.github/workflows/release_wiki.yml index a62173cd58a..84570f0c164 100644 --- a/.github/workflows/release_wiki.yml +++ b/.github/workflows/release_wiki.yml @@ -13,15 +13,15 @@ jobs: wiki-release: runs-on: self-hosted steps: - - uses: actions/checkout@eef61447b9ff4aafe5dcd4e0bbf5d482be7e7871 # pin@v4 + - uses: actions/checkout@eef61447b9ff4aafe5dcd4e0bbf5d482be7e7871 # v4.2.1 - name: Install pnpm - uses: pnpm/action-setup@fe02b34f77f8bc703788d5817da081398fad5dd2 # pin@v4 + uses: pnpm/action-setup@fe02b34f77f8bc703788d5817da081398fad5dd2 # v4.0.0 with: run_install: false - name: Set up Node.js - uses: actions/setup-node@0a44ba7841725637a19e28fa30b79a866c81b0a6 # pin@v4 + uses: actions/setup-node@0a44ba7841725637a19e28fa30b79a866c81b0a6 # v4.0.4 with: node-version: 20 cache: "pnpm" diff --git a/.github/workflows/simulator_nightly.yml b/.github/workflows/simulator_nightly.yml index 55c4ceeee16..234a9013788 100644 --- a/.github/workflows/simulator_nightly.yml +++ b/.github/workflows/simulator_nightly.yml @@ -35,12 +35,12 @@ jobs: steps: - name: Install Teleport - uses: teleport-actions/setup@176c25dfcd19cd31a252f275d579822b243e7b9c # pin@v1 + uses: teleport-actions/setup@176c25dfcd19cd31a252f275d579822b243e7b9c # v1.0.6 with: version: 11.3.1 - name: Authorize against Teleport id: auth - uses: teleport-actions/auth@685adaf480dc79262a99220eb158a92136d5abd9 # pin@v2 + uses: teleport-actions/auth@685adaf480dc79262a99220eb158a92136d5abd9 # v2.0.3 with: # Specify the publically accessible address of your Teleport proxy. proxy: proxy.iota-int.com:443 @@ -84,10 +84,10 @@ jobs: if: github.event_name == 'schedule' && failure() steps: - - uses: technote-space/workflow-conclusion-action@45ce8e0eb155657ab8ccf346ade734257fd196a5 # pin@v3 + - uses: technote-space/workflow-conclusion-action@45ce8e0eb155657ab8ccf346ade734257fd196a5 # v3.0.3 - name: Checkout iota repo develop branch - uses: actions/checkout@eef61447b9ff4aafe5dcd4e0bbf5d482be7e7871 # pin@v4 + uses: actions/checkout@eef61447b9ff4aafe5dcd4e0bbf5d482be7e7871 # v4.2.1 - name: Get iota commit env: @@ -122,7 +122,7 @@ jobs: echo "oncall_name=$(echo ${oncall_name})" >> $GITHUB_ENV - name: Configure AWS credentials - uses: aws-actions/configure-aws-credentials@e3dd6a429d7300a6a4c196c26e071d42e0343502 # pin@v4 + uses: aws-actions/configure-aws-credentials@e3dd6a429d7300a6a4c196c26e071d42e0343502 # v4.0.2 with: aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }} aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }} @@ -134,7 +134,7 @@ jobs: echo "slack_id=$(echo ${slack_id} | tr -d '"')" >> $GITHUB_ENV - name: Post to slack - uses: slackapi/slack-github-action@37ebaef184d7626c5f204ab8d3baff4262dd30f0 # pin@v1 + uses: slackapi/slack-github-action@37ebaef184d7626c5f204ab8d3baff4262dd30f0 # v1.27.0 env: SLACK_BOT_TOKEN: ${{ secrets.SLACK_BOT_TOKEN }} IOTA_SHA: ${{ env.iota_sha }} diff --git a/.github/workflows/split_cluster.yml b/.github/workflows/split_cluster.yml index 31ce2cc9389..3c45c361d91 100644 --- a/.github/workflows/split_cluster.yml +++ b/.github/workflows/split_cluster.yml @@ -18,7 +18,7 @@ jobs: # runs-on: self-hosted # steps: # - name: Checkout code repository - # uses: actions/checkout@eef61447b9ff4aafe5dcd4e0bbf5d482be7e7871 # pin@v4 + # uses: actions/checkout@eef61447b9ff4aafe5dcd4e0bbf5d482be7e7871 # v4.2.1 # with: # fetch-depth: 0 # - name: Run split cluster check script @@ -31,7 +31,7 @@ jobs: runs-on: self-hosted steps: - name: Checkout code repository - uses: actions/checkout@eef61447b9ff4aafe5dcd4e0bbf5d482be7e7871 # pin@v4 + uses: actions/checkout@eef61447b9ff4aafe5dcd4e0bbf5d482be7e7871 # v4.2.1 with: fetch-depth: 0 - name: Run split cluster check script diff --git a/.github/workflows/stale.yml b/.github/workflows/stale.yml index 35b73fe7bb7..f0c82a67fa7 100644 --- a/.github/workflows/stale.yml +++ b/.github/workflows/stale.yml @@ -11,7 +11,7 @@ jobs: issues: write pull-requests: write steps: - - uses: actions/stale@28ca1036281a5e5922ead5184a1bbf96e5fc984e # pin@v9 + - uses: actions/stale@28ca1036281a5e5922ead5184a1bbf96e5fc984e # v9.0.0 with: repo-token: ${{ secrets.GITHUB_TOKEN }} days-before-stale: 60 diff --git a/.github/workflows/tag.yml b/.github/workflows/tag.yml index 9063759a502..62b3c8d8943 100644 --- a/.github/workflows/tag.yml +++ b/.github/workflows/tag.yml @@ -36,10 +36,10 @@ jobs: steps: - name: Checkout - uses: actions/checkout@eef61447b9ff4aafe5dcd4e0bbf5d482be7e7871 # pin@v4 + uses: actions/checkout@eef61447b9ff4aafe5dcd4e0bbf5d482be7e7871 # v4.2.1 - name: Tag - uses: julbme/gh-action-manage-tag@8daf6387badea2c6b8f989bd0f82b5a9ef1d84e6 # pin@v1 + uses: julbme/gh-action-manage-tag@8daf6387badea2c6b8f989bd0f82b5a9ef1d84e6 # v1.0.1 with: name: ${{ env.TAG_NAME }} state: present From a8a7a0f67fb1d456c46144027edd321184104bae Mon Sep 17 00:00:00 2001 From: /alex/ Date: Tue, 3 Dec 2024 11:24:49 +0100 Subject: [PATCH 119/124] align action pinning --- .github/workflows/cargo_llvm_cov.yml | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/.github/workflows/cargo_llvm_cov.yml b/.github/workflows/cargo_llvm_cov.yml index 76fba0a1048..61b23b4c37b 100644 --- a/.github/workflows/cargo_llvm_cov.yml +++ b/.github/workflows/cargo_llvm_cov.yml @@ -36,20 +36,19 @@ jobs: # from transient network timeouts or other issues. CARGO_NET_RETRY: 10 steps: - - uses: actions/checkout@eef61447b9ff4aafe5dcd4e0bbf5d482be7e7871 # pin@v4 + - uses: actions/checkout@eef61447b9ff4aafe5dcd4e0bbf5d482be7e7871 # v4.2.1 with: ref: ${{ github.event.inputs.sui_repo_ref || github.ref }} - - uses: bmwill/rust-cache@fb63fcd7a959767755b88b5af2f5cbf65fb8a127 # pin@v1 + - uses: bmwill/rust-cache@cb2cf0cc7c5198d3364b9630e2c3d457f160790c # v1.4.0 - - name: Install cargo-llvm-cov - uses: taiki-e/install-action@125e82eef6e60d2b0c20d4d1f4cf81db37f68bf3 # pin@cargo-llvm-cov - - - name: Install nextest - uses: taiki-e/install-action@7e58f89e24a544d88f7a74c6eed8a3df3fd4c658 # pin@nextest + - name: Install nextest and cargo-llvm-cov + uses: taiki-e/install-action@375e0c7f08a66b8c2ba7e7eef31a6f91043a81b0 # v2.44.38 + with: + tool: nextest,cargo-llvm-cov - name: Set Swap Space - uses: actionhippie/swap-space@v1 + uses: actionhippie/swap-space@73376950a0019f8e1f6a3d3d2673fe2aed74ae17 # v1.0.2 with: size: 256G From 508f5bfa575acad664ca44085dd0682b099fb10e Mon Sep 17 00:00:00 2001 From: /alex/ Date: Tue, 3 Dec 2024 11:31:03 +0100 Subject: [PATCH 120/124] dprint --- .github/workflows/cargo_llvm_cov.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/cargo_llvm_cov.yml b/.github/workflows/cargo_llvm_cov.yml index 61b23b4c37b..cd8a1b972fe 100644 --- a/.github/workflows/cargo_llvm_cov.yml +++ b/.github/workflows/cargo_llvm_cov.yml @@ -48,7 +48,7 @@ jobs: tool: nextest,cargo-llvm-cov - name: Set Swap Space - uses: actionhippie/swap-space@73376950a0019f8e1f6a3d3d2673fe2aed74ae17 # v1.0.2 + uses: actionhippie/swap-space@73376950a0019f8e1f6a3d3d2673fe2aed74ae17 # v1.0.2 with: size: 256G From 8d1b26a0cf633034917213e92e39dc574a0f25f1 Mon Sep 17 00:00:00 2001 From: /alex/ Date: Tue, 3 Dec 2024 14:15:01 +0100 Subject: [PATCH 121/124] review --- .github/workflows/cargo_llvm_cov.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/cargo_llvm_cov.yml b/.github/workflows/cargo_llvm_cov.yml index cd8a1b972fe..546e87ce16e 100644 --- a/.github/workflows/cargo_llvm_cov.yml +++ b/.github/workflows/cargo_llvm_cov.yml @@ -5,8 +5,8 @@ on: - cron: "0 1 * * *" # every day at 1am (UTC) workflow_dispatch: inputs: - sui_repo_ref: - description: "Branch / commit to test" + branch-or-commit: + description: "Branch or commit to test code coverage." type: string required: false default: "" @@ -150,7 +150,7 @@ jobs: sed --in-place "s#${{ github.workspace }}#.#g" lcov.info - name: Backup report - uses: actions/upload-artifact@b4b15b8c7c6ac21ea08fcf65892d2ee8f75cf882 # pin@v4 + uses: actions/upload-artifact@b4b15b8c7c6ac21ea08fcf65892d2ee8f75cf882 # v4.4.3 with: name: lcov.info path: target/lcov.info @@ -158,7 +158,7 @@ jobs: retention-days: 30 - name: Upload coverage to Coveralls - uses: coverallsapp/github-action@v2 + uses: coverallsapp/github-action@cfd0633edbd2411b532b808ba7a8b5e04f76d2c8 # v2.3.4 with: github-token: ${{ secrets.GITHUB_TOKEN }} path-to-lcov: target/lcov.info From 88648dca7f48c1621c6a7e61ec1df447946f776c Mon Sep 17 00:00:00 2001 From: /alex/ Date: Tue, 3 Dec 2024 14:48:33 +0100 Subject: [PATCH 122/124] review 2 --- .github/workflows/cargo_llvm_cov.yml | 4 ++-- scripts/simtest/simtest-cov.sh | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/cargo_llvm_cov.yml b/.github/workflows/cargo_llvm_cov.yml index 546e87ce16e..e439bdfc988 100644 --- a/.github/workflows/cargo_llvm_cov.yml +++ b/.github/workflows/cargo_llvm_cov.yml @@ -38,7 +38,7 @@ jobs: steps: - uses: actions/checkout@eef61447b9ff4aafe5dcd4e0bbf5d482be7e7871 # v4.2.1 with: - ref: ${{ github.event.inputs.sui_repo_ref || github.ref }} + ref: ${{ github.event.inputs.branch-or-commit || github.ref }} - uses: bmwill/rust-cache@cb2cf0cc7c5198d3364b9630e2c3d457f160790c # v1.4.0 @@ -71,7 +71,7 @@ jobs: set +e echo "Generating coverage data (.profraw files)." - IOTA_SKIP_SIMTESTS=1 cargo llvm-cov --ignore-run-fail --no-report nextest -vv + IOTA_SKIP_SIMTESTS=1 cargo llvm-cov --ignore-run-fail --no-report nextest echo "Scanning for corrupted .profraw files. This might take a while." find target/llvm-cov-target -name '*.profraw' | while read file; do diff --git a/scripts/simtest/simtest-cov.sh b/scripts/simtest/simtest-cov.sh index a81fbfbf95d..a8701b87c0c 100755 --- a/scripts/simtest/simtest-cov.sh +++ b/scripts/simtest/simtest-cov.sh @@ -16,7 +16,7 @@ git apply ./scripts/simtest/config-patch root_dir=$(git rev-parse --show-toplevel) export SIMTEST_STATIC_INIT_MOVE=$root_dir"/examples/move/basics" -MSIM_WATCHDOG_TIMEOUT_MS=60000 MSIM_TEST_SEED=1 cargo llvm-cov --ignore-run-fail --no-report nextest -vv +MSIM_WATCHDOG_TIMEOUT_MS=60000 MSIM_TEST_SEED=1 cargo llvm-cov --ignore-run-fail --no-report nextest # remove the patch git checkout .cargo/config.toml Cargo.toml Cargo.lock From f08d266d8792e23f9e8e35c9e08fa834b4a2c89a Mon Sep 17 00:00:00 2001 From: /alex/ Date: Tue, 3 Dec 2024 14:51:19 +0100 Subject: [PATCH 123/124] reduce log output --- .github/workflows/cargo_llvm_cov.yml | 4 ---- 1 file changed, 4 deletions(-) diff --git a/.github/workflows/cargo_llvm_cov.yml b/.github/workflows/cargo_llvm_cov.yml index e439bdfc988..5c92c4726df 100644 --- a/.github/workflows/cargo_llvm_cov.yml +++ b/.github/workflows/cargo_llvm_cov.yml @@ -78,8 +78,6 @@ jobs: if ! "$LLVM_PROFDATA" show "$file" > /dev/null 2>&1; then echo "$file: corruped -> removing" rm "$file" - else - echo "$file: good" fi done @@ -109,8 +107,6 @@ jobs: if ! "$LLVM_PROFDATA" show "$file" > /dev/null 2>&1; then echo "$file: corruped -> removing" rm "$file" - else - echo "$file: good" fi done From c8faab024083f5153c0a5de973016ac9157aac04 Mon Sep 17 00:00:00 2001 From: /alex/ Date: Wed, 4 Dec 2024 11:01:32 +0100 Subject: [PATCH 124/124] rm backing up lcov.info --- .github/workflows/cargo_llvm_cov.yml | 8 -------- 1 file changed, 8 deletions(-) diff --git a/.github/workflows/cargo_llvm_cov.yml b/.github/workflows/cargo_llvm_cov.yml index 5c92c4726df..15000ad8e5b 100644 --- a/.github/workflows/cargo_llvm_cov.yml +++ b/.github/workflows/cargo_llvm_cov.yml @@ -145,14 +145,6 @@ jobs: echo "Removing absolute path prefix: ${{ github.workspace }} from report." sed --in-place "s#${{ github.workspace }}#.#g" lcov.info - - name: Backup report - uses: actions/upload-artifact@b4b15b8c7c6ac21ea08fcf65892d2ee8f75cf882 # v4.4.3 - with: - name: lcov.info - path: target/lcov.info - if-no-files-found: error - retention-days: 30 - - name: Upload coverage to Coveralls uses: coverallsapp/github-action@cfd0633edbd2411b532b808ba7a8b5e04f76d2c8 # v2.3.4 with: