From 63367f271707bd0f6d8ccd0111d55ac3a9168db5 Mon Sep 17 00:00:00 2001 From: Islam El-Ashi Date: Thu, 21 Mar 2024 11:12:31 +0100 Subject: [PATCH 01/25] add ci test --- .github/workflows/CommentPR.yml | 53 +++++++++++++++++++++++++++++++++ .github/workflows/ReceivePR.yml | 23 ++++++++++++++ 2 files changed, 76 insertions(+) create mode 100644 .github/workflows/CommentPR.yml create mode 100644 .github/workflows/ReceivePR.yml diff --git a/.github/workflows/CommentPR.yml b/.github/workflows/CommentPR.yml new file mode 100644 index 0000000..6ffa8b2 --- /dev/null +++ b/.github/workflows/CommentPR.yml @@ -0,0 +1,53 @@ +name: Comment on the pull request + +# read-write repo token +# access to secrets +on: + workflow_run: + workflows: ["Receive PR"] + types: + - completed + +jobs: + upload: + runs-on: ubuntu-latest + if: > + github.event.workflow_run.event == 'pull_request' && + github.event.workflow_run.conclusion == 'success' + steps: + - name: 'Download artifact' + uses: actions/github-script@v3.1.0 + with: + script: | + var artifacts = await github.actions.listWorkflowRunArtifacts({ + owner: context.repo.owner, + repo: context.repo.repo, + run_id: ${{github.event.workflow_run.id }}, + }); + var matchArtifact = artifacts.data.artifacts.filter((artifact) => { + return artifact.name == "pr" + })[0]; + var download = await github.actions.downloadArtifact({ + owner: context.repo.owner, + repo: context.repo.repo, + artifact_id: matchArtifact.id, + archive_format: 'zip', + }); + var fs = require('fs'); + fs.writeFileSync('${{github.workspace}}/pr.zip', Buffer.from(download.data)); + - run: unzip pr.zip + + - name: 'Comment on PR' + uses: actions/github-script@v3 + with: + github-token: ${{ secrets.GITHUB_TOKEN }} + script: | + var fs = require('fs'); + var issue_number = Number(fs.readFileSync('./NR')); + await github.issues.createComment({ + owner: context.repo.owner, + repo: context.repo.repo, + issue_number: issue_number, + body: 'Everything is OK. Thank you for the PR!' + }); + diff --git a/.github/workflows/ReceivePR.yml b/.github/workflows/ReceivePR.yml new file mode 100644 index 0000000..25a1276 --- /dev/null +++ b/.github/workflows/ReceivePR.yml @@ -0,0 +1,23 @@ +name: Receive PR + +# read-only repo token +# no access to secrets +on: + pull_request: + +jobs: + build: + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v2 + + - name: Save PR number + run: | + mkdir -p ./pr + echo ${{ github.event.number }} > ./pr/NR + - uses: actions/upload-artifact@v2 + with: + name: pr + path: pr/ + From 121b6a6302451fdc650098200ea71798b9f982da Mon Sep 17 00:00:00 2001 From: Islam El-Ashi Date: Thu, 21 Mar 2024 11:14:12 +0100 Subject: [PATCH 02/25] . --- .github/workflows/ci.yml | 168 --------------------------------------- 1 file changed, 168 deletions(-) delete mode 100644 .github/workflows/ci.yml diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml deleted file mode 100644 index 9f18ff5..0000000 --- a/.github/workflows/ci.yml +++ /dev/null @@ -1,168 +0,0 @@ -name: CI -on: [pull_request] - -env: - RUST_VERSION: 1.75.0 - -jobs: - build: - strategy: - matrix: - os: [ ubuntu-latest, macos-latest ] - - runs-on: ${{ matrix.os }} - - steps: - - uses: actions/checkout@v2 - - - name: Cache Cargo - uses: actions/cache@v2 - with: - path: | - ~/.cargo/registry - ~/.cargo/git - target - key: ${{ matrix.build }}-cargo-${{ hashFiles('**/Cargo.lock') }} - restore-keys: | - ${{ matrix.build }}-cargo- - - - name: Install Rust - run: | - rustup update $RUST_VERSION --no-self-update - rustup default $RUST_VERSION - rustup component add rustfmt - rustup component add clippy - - - name: Check Format - run: cargo fmt --all -- --check - - - name: Clippy - run: cargo clippy --tests --benches -- -D clippy::all - - - name: Test - run: cargo test --all-features -- --test-threads=1 - env: - RUST_BACKTRACE: 1 - - benchmark-fibonacci-example: - runs-on: ubuntu-latest - needs: [build] - env: - PROJECT_DIR: examples/fibonacci - steps: - - name: Checkout current PR - uses: actions/checkout@v4 - - - name: Checkout main branch - uses: actions/checkout@v4 - with: - ref: main - path: _canbench_main_branch - - - uses: actions/cache@v3 - with: - path: | - ~/.cargo/registry - ~/.cargo/git - target - key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}-1 - - - name: Install Rust - run: | - rustup update $RUST_VERSION --no-self-update - rustup default $RUST_VERSION - rustup target add wasm32-unknown-unknown - - - name: Benchmark - run: | - bash ./scripts/ci_run_benchmark.sh $PROJECT_DIR - - - name: Post comment - uses: thollander/actions-comment-pull-request@v2 - with: - filePath: /tmp/canbench_comment_message.txt - comment_tag: ${{ env.PROJECT_DIR }} - - - name: Pass or fail - run: | - bash ./scripts/ci_post_run_benchmark.sh - - benchmark-btreemap-vs-hashmap-example: - runs-on: ubuntu-latest - needs: [build] - env: - PROJECT_DIR: examples/btreemap_vs_hashmap - steps: - - name: Checkout current PR - uses: actions/checkout@v4 - - - name: Checkout main branch - uses: actions/checkout@v4 - with: - ref: main - path: _canbench_main_branch - - - uses: actions/cache@v3 - with: - path: | - ~/.cargo/registry - ~/.cargo/git - target - key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}-1 - - - name: Install Rust - run: | - rustup update $RUST_VERSION --no-self-update - rustup default $RUST_VERSION - rustup target add wasm32-unknown-unknown - - - name: Benchmark - run: | - bash ./scripts/ci_run_benchmark.sh $PROJECT_DIR - - - name: Post comment - uses: thollander/actions-comment-pull-request@v2 - with: - filePath: /tmp/canbench_comment_message.txt - comment_tag: ${{ env.PROJECT_DIR }} - - - name: Pass or fail - run: | - bash ./scripts/ci_post_run_benchmark.sh - - shell-checks: - name: ShellCheck - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v4 - - name: Run ShellCheck - uses: ludeeus/action-shellcheck@master - env: - SHELLCHECK_OPTS: -e SC1090 -e SC2119 -e SC1091 - - checks-pass: - # Always run this job! - if: always() - needs: [ - build, - shell-checks, - benchmark-fibonacci-example, - benchmark-btreemap-vs-hashmap-example - ] - runs-on: ubuntu-latest - steps: - - name: check build result - if: ${{ needs.build.result != 'success' }} - run: exit 1 - - - name: check shell-checks result - if: ${{ needs.shell-checks.result != 'success' }} - run: exit 1 - - - name: check benchmark-fibonacci-example result - if: ${{ needs.benchmark-fibonacci-example.result != 'success' }} - run: exit 1 - - - name: check benchmark-btreemap-vs-hashmap-example result - if: ${{ needs.benchmark-btreemap-vs-hashmap-example.result != 'success' }} - run: exit 1 From fe6560c4ba6dc065e242575714edb2ab91aff7d3 Mon Sep 17 00:00:00 2001 From: Islam El-Ashi Date: Thu, 21 Mar 2024 11:17:13 +0100 Subject: [PATCH 03/25] test 2 --- .github/workflows/ReceivePR.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/ReceivePR.yml b/.github/workflows/ReceivePR.yml index 25a1276..7d69a63 100644 --- a/.github/workflows/ReceivePR.yml +++ b/.github/workflows/ReceivePR.yml @@ -5,6 +5,7 @@ name: Receive PR on: pull_request: + jobs: build: runs-on: ubuntu-latest From cf940749089d9ef765ee0914569c8647e4ec6da8 Mon Sep 17 00:00:00 2001 From: Islam El-Ashi Date: Thu, 21 Mar 2024 11:20:41 +0100 Subject: [PATCH 04/25] . --- .github/workflows/CommentPR.yml | 19 ++++--------------- 1 file changed, 4 insertions(+), 15 deletions(-) diff --git a/.github/workflows/CommentPR.yml b/.github/workflows/CommentPR.yml index 6ffa8b2..a1d4501 100644 --- a/.github/workflows/CommentPR.yml +++ b/.github/workflows/CommentPR.yml @@ -11,9 +11,6 @@ on: jobs: upload: runs-on: ubuntu-latest - if: > - github.event.workflow_run.event == 'pull_request' && - github.event.workflow_run.conclusion == 'success' steps: - name: 'Download artifact' uses: actions/github-script@v3.1.0 @@ -37,17 +34,9 @@ jobs: fs.writeFileSync('${{github.workspace}}/pr.zip', Buffer.from(download.data)); - run: unzip pr.zip - - name: 'Comment on PR' - uses: actions/github-script@v3 + - name: Post comment + uses: thollander/actions-comment-pull-request@v2 with: - github-token: ${{ secrets.GITHUB_TOKEN }} - script: | - var fs = require('fs'); - var issue_number = Number(fs.readFileSync('./NR')); - await github.issues.createComment({ - owner: context.repo.owner, - repo: context.repo.repo, - issue_number: issue_number, - body: 'Everything is OK. Thank you for the PR!' - }); + message: "this is a message" + comment_tag: comment_tag From 77973842d95b8c65a3a2a6bb8b8f9d0f23b1eb70 Mon Sep 17 00:00:00 2001 From: Islam El-Ashi Date: Thu, 21 Mar 2024 11:21:51 +0100 Subject: [PATCH 05/25] test: test 3 --- .github/workflows/ReceivePR.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/ReceivePR.yml b/.github/workflows/ReceivePR.yml index 7d69a63..25a1276 100644 --- a/.github/workflows/ReceivePR.yml +++ b/.github/workflows/ReceivePR.yml @@ -5,7 +5,6 @@ name: Receive PR on: pull_request: - jobs: build: runs-on: ubuntu-latest From f310fa39cbc6ebd3d5ac315ea2e9391f0fe6d69a Mon Sep 17 00:00:00 2001 From: Islam El-Ashi Date: Thu, 21 Mar 2024 11:34:47 +0100 Subject: [PATCH 06/25] . --- .github/workflows/CommentPR.yml | 41 +++++++++++++++++++++++++++++---- .github/workflows/ReceivePR.yml | 12 ++++++++++ 2 files changed, 48 insertions(+), 5 deletions(-) diff --git a/.github/workflows/CommentPR.yml b/.github/workflows/CommentPR.yml index a1d4501..ed78be7 100644 --- a/.github/workflows/CommentPR.yml +++ b/.github/workflows/CommentPR.yml @@ -12,7 +12,7 @@ jobs: upload: runs-on: ubuntu-latest steps: - - name: 'Download artifact' + - name: 'Download PR' uses: actions/github-script@v3.1.0 with: script: | @@ -34,9 +34,40 @@ jobs: fs.writeFileSync('${{github.workspace}}/pr.zip', Buffer.from(download.data)); - run: unzip pr.zip - - name: Post comment - uses: thollander/actions-comment-pull-request@v2 + - name: 'Download canbench comments' + uses: actions/github-script@v3.1.0 with: - message: "this is a message" - comment_tag: comment_tag + script: | + var artifacts = await github.actions.listWorkflowRunArtifacts({ + owner: context.repo.owner, + repo: context.repo.repo, + run_id: ${{github.event.workflow_run.id }}, + }); + var matchArtifact = artifacts.data.artifacts.filter((artifact) => { + return artifact.name == "canbench_comments" + })[0]; + var download = await github.actions.downloadArtifact({ + owner: context.repo.owner, + repo: context.repo.repo, + artifact_id: matchArtifact.id, + archive_format: 'zip', + }); + var fs = require('fs'); + fs.writeFileSync('${{github.workspace}}/canbench_comments.zip', Buffer.from(download.data)); + - run: unzip canbench_comments.zip + + - name: 'Comment on PR' + uses: actions/github-script@v3 + with: + github-token: ${{ secrets.GITHUB_TOKEN }} + script: | + var fs = require('fs'); + var issue_number = Number(fs.readFileSync('./NR')); + var message = Number(fs.readFileSync('./canbench_comment')); + await github.issues.createComment({ + owner: context.repo.owner, + repo: context.repo.repo, + issue_number: issue_number, + body: message, + }); diff --git a/.github/workflows/ReceivePR.yml b/.github/workflows/ReceivePR.yml index 25a1276..643c836 100644 --- a/.github/workflows/ReceivePR.yml +++ b/.github/workflows/ReceivePR.yml @@ -16,8 +16,20 @@ jobs: run: | mkdir -p ./pr echo ${{ github.event.number }} > ./pr/NR + + - name: Save canbench comments + run: | + mkdir -p ./canbench_comments + echo "# \`canbench\`" > ./canbench_comments/canbench_comment + - uses: actions/upload-artifact@v2 with: name: pr path: pr/ + - uses: actions/upload-artifact@v2 + with: + name: canbench_comments + path: canbench_comments/ + + From f2022d1274a828d9571eff6a1b3b10e513b3ed67 Mon Sep 17 00:00:00 2001 From: Islam El-Ashi Date: Thu, 21 Mar 2024 11:36:14 +0100 Subject: [PATCH 07/25] test --- .github/workflows/ReceivePR.yml | 2 -- 1 file changed, 2 deletions(-) diff --git a/.github/workflows/ReceivePR.yml b/.github/workflows/ReceivePR.yml index 643c836..e240803 100644 --- a/.github/workflows/ReceivePR.yml +++ b/.github/workflows/ReceivePR.yml @@ -31,5 +31,3 @@ jobs: with: name: canbench_comments path: canbench_comments/ - - From e8754bea42407db4346906fe0e55317cc2f300f3 Mon Sep 17 00:00:00 2001 From: Islam El-Ashi Date: Thu, 21 Mar 2024 11:39:21 +0100 Subject: [PATCH 08/25] . --- .github/workflows/CommentPR.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/CommentPR.yml b/.github/workflows/CommentPR.yml index ed78be7..fd429ec 100644 --- a/.github/workflows/CommentPR.yml +++ b/.github/workflows/CommentPR.yml @@ -63,7 +63,7 @@ jobs: script: | var fs = require('fs'); var issue_number = Number(fs.readFileSync('./NR')); - var message = Number(fs.readFileSync('./canbench_comment')); + var message = fs.readFileSync('./canbench_comment'); await github.issues.createComment({ owner: context.repo.owner, repo: context.repo.repo, From b697b5d0ea8448e3e296b9cc730808655691924e Mon Sep 17 00:00:00 2001 From: Islam El-Ashi Date: Thu, 21 Mar 2024 11:40:52 +0100 Subject: [PATCH 09/25] test: test 6 --- .github/workflows/ReceivePR.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/ReceivePR.yml b/.github/workflows/ReceivePR.yml index e240803..7c3d97e 100644 --- a/.github/workflows/ReceivePR.yml +++ b/.github/workflows/ReceivePR.yml @@ -31,3 +31,4 @@ jobs: with: name: canbench_comments path: canbench_comments/ + From 867feabf0ae088607a98e77ae5909ee016ed00d3 Mon Sep 17 00:00:00 2001 From: Islam El-Ashi Date: Thu, 21 Mar 2024 11:42:44 +0100 Subject: [PATCH 10/25] . --- .github/workflows/CommentPR.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/CommentPR.yml b/.github/workflows/CommentPR.yml index fd429ec..583104d 100644 --- a/.github/workflows/CommentPR.yml +++ b/.github/workflows/CommentPR.yml @@ -63,7 +63,7 @@ jobs: script: | var fs = require('fs'); var issue_number = Number(fs.readFileSync('./NR')); - var message = fs.readFileSync('./canbench_comment'); + var message = fs.readFileSync('./canbench_comment', 'utf8'); await github.issues.createComment({ owner: context.repo.owner, repo: context.repo.repo, From 7ab79231b36e7b558bc8e622f28409ec86d12547 Mon Sep 17 00:00:00 2001 From: Islam El-Ashi Date: Thu, 21 Mar 2024 11:44:28 +0100 Subject: [PATCH 11/25] test: test 7 --- .github/workflows/ReceivePR.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/ReceivePR.yml b/.github/workflows/ReceivePR.yml index e240803..7c3d97e 100644 --- a/.github/workflows/ReceivePR.yml +++ b/.github/workflows/ReceivePR.yml @@ -31,3 +31,4 @@ jobs: with: name: canbench_comments path: canbench_comments/ + From c176ccbdf349ba7f0a6e8849b7a2f6efcb56694b Mon Sep 17 00:00:00 2001 From: Islam El-Ashi Date: Thu, 21 Mar 2024 11:55:45 +0100 Subject: [PATCH 12/25] test: test 8 --- .github/workflows/CommentPR.yml | 15 ++++++++++++++- .github/workflows/ReceivePR.yml | 1 - 2 files changed, 14 insertions(+), 2 deletions(-) diff --git a/.github/workflows/CommentPR.yml b/.github/workflows/CommentPR.yml index fd429ec..5e86605 100644 --- a/.github/workflows/CommentPR.yml +++ b/.github/workflows/CommentPR.yml @@ -56,6 +56,15 @@ jobs: fs.writeFileSync('${{github.workspace}}/canbench_comments.zip', Buffer.from(download.data)); - run: unzip canbench_comments.zip + - name: 'Set PR' + uses: actions/github-script@v3.1.0 + id: set_pr + run: echo "::set-output name=number::$(echo 42)" + + - name: 'Read PR' + uses: actions/github-script@v3.1.0 + run: echo "The number is ${{ steps.set_pr.outputs.number }}" + - name: 'Comment on PR' uses: actions/github-script@v3 with: @@ -63,7 +72,11 @@ jobs: script: | var fs = require('fs'); var issue_number = Number(fs.readFileSync('./NR')); - var message = fs.readFileSync('./canbench_comment'); + var message = fs.readFileSync('./canbench_comment', {encoding: 'utf8'}); + console.log("issue_number"); + console.log(issue_number); + console.log("message"); + console.log(message); await github.issues.createComment({ owner: context.repo.owner, repo: context.repo.repo, diff --git a/.github/workflows/ReceivePR.yml b/.github/workflows/ReceivePR.yml index 7c3d97e..e240803 100644 --- a/.github/workflows/ReceivePR.yml +++ b/.github/workflows/ReceivePR.yml @@ -31,4 +31,3 @@ jobs: with: name: canbench_comments path: canbench_comments/ - From 469accca130a0adc6c97b6460b3fec008dbedb05 Mon Sep 17 00:00:00 2001 From: Islam El-Ashi Date: Thu, 21 Mar 2024 11:59:05 +0100 Subject: [PATCH 13/25] test: test 8 --- .github/workflows/ReceivePR.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/ReceivePR.yml b/.github/workflows/ReceivePR.yml index 7c3d97e..643c836 100644 --- a/.github/workflows/ReceivePR.yml +++ b/.github/workflows/ReceivePR.yml @@ -32,3 +32,4 @@ jobs: name: canbench_comments path: canbench_comments/ + From 5d231e76ee6a46cdf72d39a0d431cbc831fc1d38 Mon Sep 17 00:00:00 2001 From: Islam El-Ashi Date: Thu, 21 Mar 2024 12:00:53 +0100 Subject: [PATCH 14/25] . --- .github/workflows/CommentPR.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/CommentPR.yml b/.github/workflows/CommentPR.yml index 3e38166..a705aa8 100644 --- a/.github/workflows/CommentPR.yml +++ b/.github/workflows/CommentPR.yml @@ -57,7 +57,6 @@ jobs: - run: unzip canbench_comments.zip - name: 'Set PR' - uses: actions/github-script@v3.1.0 id: set_pr run: echo "::set-output name=number::$(echo 42)" From fe13ee2842829012a18d0cdc5d23f5286ccfa768 Mon Sep 17 00:00:00 2001 From: Islam El-Ashi Date: Thu, 21 Mar 2024 12:01:35 +0100 Subject: [PATCH 15/25] test: test 9 --- .github/workflows/ReceivePR.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/ReceivePR.yml b/.github/workflows/ReceivePR.yml index 643c836..9b545ed 100644 --- a/.github/workflows/ReceivePR.yml +++ b/.github/workflows/ReceivePR.yml @@ -33,3 +33,4 @@ jobs: path: canbench_comments/ + From 45300d083d249901b5c5076432e4d8a5f73901e4 Mon Sep 17 00:00:00 2001 From: Islam El-Ashi Date: Thu, 21 Mar 2024 12:02:34 +0100 Subject: [PATCH 16/25] . --- .github/workflows/CommentPR.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/CommentPR.yml b/.github/workflows/CommentPR.yml index a705aa8..38a0821 100644 --- a/.github/workflows/CommentPR.yml +++ b/.github/workflows/CommentPR.yml @@ -61,7 +61,6 @@ jobs: run: echo "::set-output name=number::$(echo 42)" - name: 'Read PR' - uses: actions/github-script@v3.1.0 run: echo "The number is ${{ steps.set_pr.outputs.number }}" - name: 'Comment on PR' From 78a5dedc6d38bb2940f93943775322a454cdc249 Mon Sep 17 00:00:00 2001 From: Islam El-Ashi Date: Thu, 21 Mar 2024 12:04:29 +0100 Subject: [PATCH 17/25] test: 10 --- .github/workflows/ReceivePR.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/ReceivePR.yml b/.github/workflows/ReceivePR.yml index 9b545ed..ac1c511 100644 --- a/.github/workflows/ReceivePR.yml +++ b/.github/workflows/ReceivePR.yml @@ -34,3 +34,4 @@ jobs: + From 6a861d8bdf368f567995f1f4421751aafa430926 Mon Sep 17 00:00:00 2001 From: Islam El-Ashi Date: Thu, 21 Mar 2024 12:07:29 +0100 Subject: [PATCH 18/25] . --- .github/workflows/CommentPR.yml | 22 +++++++--------------- 1 file changed, 7 insertions(+), 15 deletions(-) diff --git a/.github/workflows/CommentPR.yml b/.github/workflows/CommentPR.yml index 38a0821..6440a0f 100644 --- a/.github/workflows/CommentPR.yml +++ b/.github/workflows/CommentPR.yml @@ -58,23 +58,15 @@ jobs: - name: 'Set PR' id: set_pr - run: echo "::set-output name=number::$(echo 42)" + run: echo "::set-output name=pr_number::$(cat ./NR)" - name: 'Read PR' - run: echo "The number is ${{ steps.set_pr.outputs.number }}" + run: echo "The number is ${{ steps.set_pr.outputs.pr_number }}" - - name: 'Comment on PR' - uses: actions/github-script@v3 + - name: Post comment + uses: thollander/actions-comment-pull-request@v2 with: - github-token: ${{ secrets.GITHUB_TOKEN }} - script: | - var fs = require('fs'); - var issue_number = Number(fs.readFileSync('./NR')); - var message = fs.readFileSync('./canbench_comment', 'utf8'); - await github.issues.createComment({ - owner: context.repo.owner, - repo: context.repo.repo, - issue_number: issue_number, - body: message, - }); + filePath: ./canbench_comment + comment_tag: test + pr_number: ${{ steps.set_pr.outputs.pr_number }} From 0d9ed7e136ba1b71d7a571b56c2b1d64476edb16 Mon Sep 17 00:00:00 2001 From: Islam El-Ashi Date: Thu, 21 Mar 2024 12:08:18 +0100 Subject: [PATCH 19/25] test: test 11 --- .github/workflows/ReceivePR.yml | 4 ---- 1 file changed, 4 deletions(-) diff --git a/.github/workflows/ReceivePR.yml b/.github/workflows/ReceivePR.yml index ac1c511..e240803 100644 --- a/.github/workflows/ReceivePR.yml +++ b/.github/workflows/ReceivePR.yml @@ -31,7 +31,3 @@ jobs: with: name: canbench_comments path: canbench_comments/ - - - - From a8d5a4b65f54c6f0f5d2e51d2d36dea5036bea23 Mon Sep 17 00:00:00 2001 From: Islam El-Ashi Date: Thu, 21 Mar 2024 12:13:27 +0100 Subject: [PATCH 20/25] . --- .github/workflows/CommentPR.yml | 26 +++++--------------------- .github/workflows/ReceivePR.yml | 4 ++-- 2 files changed, 7 insertions(+), 23 deletions(-) diff --git a/.github/workflows/CommentPR.yml b/.github/workflows/CommentPR.yml index 6440a0f..8ca1a14 100644 --- a/.github/workflows/CommentPR.yml +++ b/.github/workflows/CommentPR.yml @@ -12,27 +12,11 @@ jobs: upload: runs-on: ubuntu-latest steps: - - name: 'Download PR' - uses: actions/github-script@v3.1.0 + + - name: Download artifact + uses: actions/download-artifact@v2 with: - script: | - var artifacts = await github.actions.listWorkflowRunArtifacts({ - owner: context.repo.owner, - repo: context.repo.repo, - run_id: ${{github.event.workflow_run.id }}, - }); - var matchArtifact = artifacts.data.artifacts.filter((artifact) => { - return artifact.name == "pr" - })[0]; - var download = await github.actions.downloadArtifact({ - owner: context.repo.owner, - repo: context.repo.repo, - artifact_id: matchArtifact.id, - archive_format: 'zip', - }); - var fs = require('fs'); - fs.writeFileSync('${{github.workspace}}/pr.zip', Buffer.from(download.data)); - - run: unzip pr.zip + name: pr-number - name: 'Download canbench comments' uses: actions/github-script@v3.1.0 @@ -58,7 +42,7 @@ jobs: - name: 'Set PR' id: set_pr - run: echo "::set-output name=pr_number::$(cat ./NR)" + run: echo "::set-output name=pr_number::$(cat ./pr-number)" - name: 'Read PR' run: echo "The number is ${{ steps.set_pr.outputs.pr_number }}" diff --git a/.github/workflows/ReceivePR.yml b/.github/workflows/ReceivePR.yml index e240803..3ee8a29 100644 --- a/.github/workflows/ReceivePR.yml +++ b/.github/workflows/ReceivePR.yml @@ -24,8 +24,8 @@ jobs: - uses: actions/upload-artifact@v2 with: - name: pr - path: pr/ + name: pr-number + path: pr/NR - uses: actions/upload-artifact@v2 with: From 69106f28cc9c2a2f8bf501d790d23cf236cbd8de Mon Sep 17 00:00:00 2001 From: Islam El-Ashi Date: Thu, 21 Mar 2024 12:14:26 +0100 Subject: [PATCH 21/25] test: test 13 --- .github/workflows/ReceivePR.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/ReceivePR.yml b/.github/workflows/ReceivePR.yml index 3ee8a29..af433b3 100644 --- a/.github/workflows/ReceivePR.yml +++ b/.github/workflows/ReceivePR.yml @@ -31,3 +31,4 @@ jobs: with: name: canbench_comments path: canbench_comments/ + From d8210f5009c0827a8e6fe7008cb5c94daf589978 Mon Sep 17 00:00:00 2001 From: Islam El-Ashi Date: Thu, 21 Mar 2024 12:18:22 +0100 Subject: [PATCH 22/25] . --- .github/workflows/CommentPR.yml | 2 +- .github/workflows/ReceivePR.yml | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/CommentPR.yml b/.github/workflows/CommentPR.yml index 8ca1a14..fc8399f 100644 --- a/.github/workflows/CommentPR.yml +++ b/.github/workflows/CommentPR.yml @@ -14,7 +14,7 @@ jobs: steps: - name: Download artifact - uses: actions/download-artifact@v2 + uses: actions/download-artifact@v4 with: name: pr-number diff --git a/.github/workflows/ReceivePR.yml b/.github/workflows/ReceivePR.yml index af433b3..146b37f 100644 --- a/.github/workflows/ReceivePR.yml +++ b/.github/workflows/ReceivePR.yml @@ -22,12 +22,12 @@ jobs: mkdir -p ./canbench_comments echo "# \`canbench\`" > ./canbench_comments/canbench_comment - - uses: actions/upload-artifact@v2 + - uses: actions/upload-artifact@v4 with: name: pr-number path: pr/NR - - uses: actions/upload-artifact@v2 + - uses: actions/upload-artifact@v4 with: name: canbench_comments path: canbench_comments/ From 7fae33651bc8c83d64c834a0952d6e050b736835 Mon Sep 17 00:00:00 2001 From: Islam El-Ashi Date: Thu, 21 Mar 2024 12:19:17 +0100 Subject: [PATCH 23/25] test: test 14 --- .github/workflows/ReceivePR.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/ReceivePR.yml b/.github/workflows/ReceivePR.yml index 146b37f..b86b840 100644 --- a/.github/workflows/ReceivePR.yml +++ b/.github/workflows/ReceivePR.yml @@ -32,3 +32,4 @@ jobs: name: canbench_comments path: canbench_comments/ + From 4d0427d8ee6fbdea11d536dd88a54b11e18e922f Mon Sep 17 00:00:00 2001 From: Islam El-Ashi Date: Thu, 21 Mar 2024 12:21:34 +0100 Subject: [PATCH 24/25] test: test 14 --- .github/workflows/CommentPR.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/CommentPR.yml b/.github/workflows/CommentPR.yml index fc8399f..08004ae 100644 --- a/.github/workflows/CommentPR.yml +++ b/.github/workflows/CommentPR.yml @@ -16,7 +16,8 @@ jobs: - name: Download artifact uses: actions/download-artifact@v4 with: - name: pr-number + name: pr-number.zip + - run: unzip pr-number.zip - name: 'Download canbench comments' uses: actions/github-script@v3.1.0 From 3b6d7620602a1654bfa75425ab66f8a7d8fefa12 Mon Sep 17 00:00:00 2001 From: Islam El-Ashi Date: Thu, 21 Mar 2024 12:22:32 +0100 Subject: [PATCH 25/25] test: test 15 --- .github/workflows/ReceivePR.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/ReceivePR.yml b/.github/workflows/ReceivePR.yml index b86b840..146b37f 100644 --- a/.github/workflows/ReceivePR.yml +++ b/.github/workflows/ReceivePR.yml @@ -32,4 +32,3 @@ jobs: name: canbench_comments path: canbench_comments/ -