From 6fc19eb3d36037197ebdd10ab0c8be559e237b27 Mon Sep 17 00:00:00 2001 From: Ben Nibbelink Date: Fri, 22 Mar 2024 22:02:54 -0500 Subject: [PATCH 1/4] add commit hash to pr comment --- .github/workflows/build_test.yml | 11 +++++++++-- .github/workflows/pr_comment.yml | 2 +- 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/.github/workflows/build_test.yml b/.github/workflows/build_test.yml index 8d62f4bcb..8a5579ef3 100644 --- a/.github/workflows/build_test.yml +++ b/.github/workflows/build_test.yml @@ -123,9 +123,16 @@ jobs: - name: Save PR number to file run: | echo "${{ github.event.number }}" > pr_number + echo "${{ github.event.pull_request.head.sha }}" > commit_hash - - name: Upload artifact + - name: Upload PR number artifact uses: actions/upload-artifact@v4 with: name: pr_number - path: pr_number \ No newline at end of file + path: pr_number + + - name: Upload Commit hash artifact + uses: actions/upload-artifact@v4 + with: + name: commit_hash + path: commit_hash \ No newline at end of file diff --git a/.github/workflows/pr_comment.yml b/.github/workflows/pr_comment.yml index a2632a915..361089378 100644 --- a/.github/workflows/pr_comment.yml +++ b/.github/workflows/pr_comment.yml @@ -20,7 +20,7 @@ jobs: - name: Merge artifacts and get PR number run: | - echo "### Build Status Report" > artifacts_merged.md + echo "### Build Status Report - $(cat commit_hash)" > artifacts_merged.md cat ./*.txt >> artifacts_merged.md echo "PR_NUMBER=$(cat pr_number)" >> "$GITHUB_ENV" From 4bc59a34ee033ebcbe822245001cb4934d616dc2 Mon Sep 17 00:00:00 2001 From: Ben Nibbelink Date: Fri, 22 Mar 2024 22:04:46 -0500 Subject: [PATCH 2/4] update CHANGELOG --- CHANGELOG.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG.rst b/CHANGELOG.rst index baf3cc3ea..1b75d0c8b 100644 --- a/CHANGELOG.rst +++ b/CHANGELOG.rst @@ -7,7 +7,7 @@ cycamore Change Log * Downstream testing in CI workflows (#573, #580, #582, #583) * GitHub workflow for publishing images on release (#573, #582, #583) -* GitHub workflows for building/testing on a PR and push to `main` (#549, #564, #573, #582, #583) +* GitHub workflows for building/testing on a PR and push to `main` (#549, #564, #573, #582, #583, #590) * Add functionality for random behavior on the size (#550) and frequency (#565) of a sink * GitHub workflow to check that the CHANGELOG has been updated (#562) * Added inventory policies to Storage through the material buy policy (#574, #588) From 0a0eeb9b936078fc9ade5bcd0ea7f035bbdb7dbe Mon Sep 17 00:00:00 2001 From: bennibbelink <79653949+bennibbelink@users.noreply.github.com> Date: Sun, 24 Mar 2024 11:19:30 -0500 Subject: [PATCH 3/4] add timestamp back in --- .github/workflows/build_test.yml | 5 ++++- .github/workflows/pr_comment.yml | 2 +- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build_test.yml b/.github/workflows/build_test.yml index 8a5579ef3..d8949b775 100644 --- a/.github/workflows/build_test.yml +++ b/.github/workflows/build_test.yml @@ -120,10 +120,13 @@ jobs: runs-on: ubuntu-latest if: github.event_name == 'pull_request' steps: + - name: Checkout cycamore + uses: actions/checkout@v4 + - name: Save PR number to file run: | echo "${{ github.event.number }}" > pr_number - echo "${{ github.event.pull_request.head.sha }}" > commit_hash + echo "${{ github.event.pull_request.head.sha }} - $(git log -1 --format=%ci)" > commit_hash_timestamp - name: Upload PR number artifact uses: actions/upload-artifact@v4 diff --git a/.github/workflows/pr_comment.yml b/.github/workflows/pr_comment.yml index 361089378..afbf3e838 100644 --- a/.github/workflows/pr_comment.yml +++ b/.github/workflows/pr_comment.yml @@ -20,7 +20,7 @@ jobs: - name: Merge artifacts and get PR number run: | - echo "### Build Status Report - $(cat commit_hash)" > artifacts_merged.md + echo "### Build Status Report - $(cat commit_hash_timestamp)" > artifacts_merged.md cat ./*.txt >> artifacts_merged.md echo "PR_NUMBER=$(cat pr_number)" >> "$GITHUB_ENV" From 9ab624acce4a8b20aa8557b47140c6e764d1e15b Mon Sep 17 00:00:00 2001 From: bennibbelink <79653949+bennibbelink@users.noreply.github.com> Date: Sun, 24 Mar 2024 12:20:25 -0500 Subject: [PATCH 4/4] fix upload artifact name --- .github/workflows/build_test.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build_test.yml b/.github/workflows/build_test.yml index d8949b775..5f352b368 100644 --- a/.github/workflows/build_test.yml +++ b/.github/workflows/build_test.yml @@ -137,5 +137,5 @@ jobs: - name: Upload Commit hash artifact uses: actions/upload-artifact@v4 with: - name: commit_hash - path: commit_hash \ No newline at end of file + name: commit_hash_timestamp + path: commit_hash_timestamp \ No newline at end of file