From 39d6123cd280415672521fa590b7c1a5c7153eb8 Mon Sep 17 00:00:00 2001 From: Ben Nibbelink Date: Fri, 22 Mar 2024 19:59:14 -0500 Subject: [PATCH 01/14] 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 14a22ce817..eb048d9478 100644 --- a/.github/workflows/build_test.yml +++ b/.github/workflows/build_test.yml @@ -143,15 +143,22 @@ jobs: runs-on: ubuntu-latest if: github.event_name == 'pull_request' steps: - - name: Save PR number to file + - name: Save PR number and Commit hash to file run: | echo "${{ github.event.number }}" > pr_number + echo "${{ github.sha }}" > commit_hash - - name: Upload artifact + - name: Upload PR number artifact uses: actions/upload-artifact@v4 with: name: pr_number path: pr_number + + - name: Upload Commit hash artifact + uses: actions/upload-artifact@v4 + with: + name: commit_hash + path: commit_hash build-test-rocky: runs-on: ubuntu-latest diff --git a/.github/workflows/pr_comment.yml b/.github/workflows/pr_comment.yml index b7fcc124b6..104930645f 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 "### Downstream Build Status Report" > artifacts_merged.md + echo "### Downstream Build Status Report ($(cat commit_hash))" > artifacts_merged.md cat ./*.txt >> artifacts_merged.md echo "PR_NUMBER=$(cat pr_number)" >> "$GITHUB_ENV" From 16dd83cf7f89f625850b7ae061fcf291915359c1 Mon Sep 17 00:00:00 2001 From: Ben Nibbelink Date: Fri, 22 Mar 2024 20:02:08 -0500 Subject: [PATCH 02/14] add timestamp to pr comment --- .github/workflows/pr_comment.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/pr_comment.yml b/.github/workflows/pr_comment.yml index 104930645f..8c098a0132 100644 --- a/.github/workflows/pr_comment.yml +++ b/.github/workflows/pr_comment.yml @@ -20,7 +20,8 @@ jobs: - name: Merge artifacts and get PR number run: | - echo "### Downstream Build Status Report ($(cat commit_hash))" > artifacts_merged.md + echo "### Downstream Build Status Report" > artifacts_merged.md + echo "# $(echo "$(date +'%m/%d/%Y %H:%M')") ($(cat commit_hash))" > artifacts_merged.md cat ./*.txt >> artifacts_merged.md echo "PR_NUMBER=$(cat pr_number)" >> "$GITHUB_ENV" From 98243207f496cad510cf45cb5b1683de55ecdb6c Mon Sep 17 00:00:00 2001 From: bennibbelink <79653949+bennibbelink@users.noreply.github.com> Date: Fri, 22 Mar 2024 20:35:26 -0500 Subject: [PATCH 03/14] Append to file --- .github/workflows/pr_comment.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/pr_comment.yml b/.github/workflows/pr_comment.yml index 8c098a0132..aa20c0ad2d 100644 --- a/.github/workflows/pr_comment.yml +++ b/.github/workflows/pr_comment.yml @@ -21,7 +21,7 @@ jobs: - name: Merge artifacts and get PR number run: | echo "### Downstream Build Status Report" > artifacts_merged.md - echo "# $(echo "$(date +'%m/%d/%Y %H:%M')") ($(cat commit_hash))" > artifacts_merged.md + echo "# $(echo "$(date +'%m/%d/%Y %H:%M')") ($(cat commit_hash))" >> artifacts_merged.md cat ./*.txt >> artifacts_merged.md echo "PR_NUMBER=$(cat pr_number)" >> "$GITHUB_ENV" From 4879f3404c7993c6083357cda2431de15e4be2d8 Mon Sep 17 00:00:00 2001 From: Ben Nibbelink Date: Fri, 22 Mar 2024 21:00:38 -0500 Subject: [PATCH 04/14] update CHANGELOG --- CHANGELOG.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG.rst b/CHANGELOG.rst index 0572a899b4..d3c4a5b931 100644 --- a/CHANGELOG.rst +++ b/CHANGELOG.rst @@ -17,7 +17,7 @@ Since last release will fail unless update-alternatives has been used to point python at the correct python3 version (#1558) * build and test are now fown on githubAction in place or CircleCI (#1569) -* Have separate workflows for testing, publishing dependency images, and publishing release images (#1597, #1602, #1606, #1609, #1629, #1633, #1637, #1668, #1672, #1676) +* Have separate workflows for testing, publishing dependency images, and publishing release images (#1597, #1602, #1606, #1609, #1629, #1633, #1637, #1668, #1672, #1676, #1708) * Add Ubuntu 20.04 to the list of supported platforms (#1605, #1608) * Add random number generator (Mersenne Twister 19937, from boost) and the ability to set the seed in the simulation control block (#1599, #1677) * Added code coverage reporting to GitHub workflows (#1616, #1679) From 9f2c10e5c130b4335390cf7eebebbb31a36b9066 Mon Sep 17 00:00:00 2001 From: Ben Nibbelink Date: Fri, 22 Mar 2024 21:08:02 -0500 Subject: [PATCH 05/14] use git rev-parse instead of github.sha --- .github/workflows/build_test.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build_test.yml b/.github/workflows/build_test.yml index eb048d9478..0e9131d3db 100644 --- a/.github/workflows/build_test.yml +++ b/.github/workflows/build_test.yml @@ -146,7 +146,7 @@ jobs: - name: Save PR number and Commit hash to file run: | echo "${{ github.event.number }}" > pr_number - echo "${{ github.sha }}" > commit_hash + echo "$(git rev-parse --short HEAD)" > commit_hash - name: Upload PR number artifact uses: actions/upload-artifact@v4 From 52a02e3206ec2e2ddd144fb780d43429e84c43fc Mon Sep 17 00:00:00 2001 From: Ben Nibbelink Date: Fri, 22 Mar 2024 21:23:24 -0500 Subject: [PATCH 06/14] checkout repo to get git commit hash --- .github/workflows/build_test.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/workflows/build_test.yml b/.github/workflows/build_test.yml index 0e9131d3db..3fd3446f4d 100644 --- a/.github/workflows/build_test.yml +++ b/.github/workflows/build_test.yml @@ -143,6 +143,9 @@ jobs: runs-on: ubuntu-latest if: github.event_name == 'pull_request' steps: + - name: Checkout Cyclus + uses: actions/checkout@v4 + - name: Save PR number and Commit hash to file run: | echo "${{ github.event.number }}" > pr_number From 534663f165ffc48d5796cf6d1266b0c44c1c46bb Mon Sep 17 00:00:00 2001 From: Ben Nibbelink Date: Fri, 22 Mar 2024 21:28:41 -0500 Subject: [PATCH 07/14] use GITHUB_SHA to get commit hash --- .github/workflows/build_test.yml | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/.github/workflows/build_test.yml b/.github/workflows/build_test.yml index 3fd3446f4d..bb643f2188 100644 --- a/.github/workflows/build_test.yml +++ b/.github/workflows/build_test.yml @@ -143,13 +143,10 @@ jobs: runs-on: ubuntu-latest if: github.event_name == 'pull_request' steps: - - name: Checkout Cyclus - uses: actions/checkout@v4 - - name: Save PR number and Commit hash to file run: | echo "${{ github.event.number }}" > pr_number - echo "$(git rev-parse --short HEAD)" > commit_hash + echo "$(git rev-parse --short "{$GITHUB_SHA}")" > commit_hash - name: Upload PR number artifact uses: actions/upload-artifact@v4 From e8db85b7e4ed3c7f46365e977c38fa1c3910a771 Mon Sep 17 00:00:00 2001 From: Ben Nibbelink Date: Fri, 22 Mar 2024 21:32:05 -0500 Subject: [PATCH 08/14] checkout repo --- .github/workflows/build_test.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/workflows/build_test.yml b/.github/workflows/build_test.yml index bb643f2188..b563b3468c 100644 --- a/.github/workflows/build_test.yml +++ b/.github/workflows/build_test.yml @@ -143,6 +143,9 @@ jobs: runs-on: ubuntu-latest if: github.event_name == 'pull_request' steps: + - name: Checkout Cyclus + uses: actions/checkout@v4 + - name: Save PR number and Commit hash to file run: | echo "${{ github.event.number }}" > pr_number From 10ba101d0441f422383be2e32236827102c6f316 Mon Sep 17 00:00:00 2001 From: Ben Nibbelink Date: Fri, 22 Mar 2024 21:35:05 -0500 Subject: [PATCH 09/14] use pull_request.head.sha --- .github/workflows/build_test.yml | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/.github/workflows/build_test.yml b/.github/workflows/build_test.yml index b563b3468c..3218e3480f 100644 --- a/.github/workflows/build_test.yml +++ b/.github/workflows/build_test.yml @@ -143,13 +143,10 @@ jobs: runs-on: ubuntu-latest if: github.event_name == 'pull_request' steps: - - name: Checkout Cyclus - uses: actions/checkout@v4 - - name: Save PR number and Commit hash to file run: | echo "${{ github.event.number }}" > pr_number - echo "$(git rev-parse --short "{$GITHUB_SHA}")" > commit_hash + echo "${{ github.event.pull_request.head.sha }}" > commit_hash - name: Upload PR number artifact uses: actions/upload-artifact@v4 From 2f8ee304ad282254ff437e9dc5a32ace8b6f56a0 Mon Sep 17 00:00:00 2001 From: Ben Nibbelink Date: Fri, 22 Mar 2024 21:49:44 -0500 Subject: [PATCH 10/14] reformat comment --- .github/workflows/pr_comment.yml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.github/workflows/pr_comment.yml b/.github/workflows/pr_comment.yml index aa20c0ad2d..db0ecb96f1 100644 --- a/.github/workflows/pr_comment.yml +++ b/.github/workflows/pr_comment.yml @@ -20,8 +20,7 @@ jobs: - name: Merge artifacts and get PR number run: | - echo "### Downstream Build Status Report" > artifacts_merged.md - echo "# $(echo "$(date +'%m/%d/%Y %H:%M')") ($(cat commit_hash))" >> artifacts_merged.md + echo "### Downstream Build Status Report - $(echo "$(date +'%m/%d/%Y %H:%M')") - $(cat commit_hash)" > artifacts_merged.md cat ./*.txt >> artifacts_merged.md echo "PR_NUMBER=$(cat pr_number)" >> "$GITHUB_ENV" From c8110d5b50b7c7b69fffef6051e07ba3d310aa73 Mon Sep 17 00:00:00 2001 From: Ben Nibbelink Date: Fri, 22 Mar 2024 21:54:36 -0500 Subject: [PATCH 11/14] remove timestamp, dont think its super relevant --- .github/workflows/pr_comment.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/pr_comment.yml b/.github/workflows/pr_comment.yml index db0ecb96f1..89437699fc 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 "### Downstream Build Status Report - $(echo "$(date +'%m/%d/%Y %H:%M')") - $(cat commit_hash)" > artifacts_merged.md + echo "### Downstream Build Status Report - $(cat commit_hash)" > artifacts_merged.md cat ./*.txt >> artifacts_merged.md echo "PR_NUMBER=$(cat pr_number)" >> "$GITHUB_ENV" From d913ec8b171d02e9dc54f335ffa7ae4692186d80 Mon Sep 17 00:00:00 2001 From: bennibbelink <79653949+bennibbelink@users.noreply.github.com> Date: Sun, 24 Mar 2024 11:01:07 -0500 Subject: [PATCH 12/14] add timestamp back in --- .github/workflows/pr_comment.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/pr_comment.yml b/.github/workflows/pr_comment.yml index 89437699fc..db0ecb96f1 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 "### Downstream Build Status Report - $(cat commit_hash)" > artifacts_merged.md + echo "### Downstream Build Status Report - $(echo "$(date +'%m/%d/%Y %H:%M')") - $(cat commit_hash)" > artifacts_merged.md cat ./*.txt >> artifacts_merged.md echo "PR_NUMBER=$(cat pr_number)" >> "$GITHUB_ENV" From 6929d940888b31e8dcabc9314a74dbfb719c79bb Mon Sep 17 00:00:00 2001 From: bennibbelink <79653949+bennibbelink@users.noreply.github.com> Date: Sun, 24 Mar 2024 11:06:20 -0500 Subject: [PATCH 13/14] use correct timestamp of commit --- .github/workflows/build_test.yml | 9 ++++++--- .github/workflows/pr_comment.yml | 2 +- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/.github/workflows/build_test.yml b/.github/workflows/build_test.yml index 3218e3480f..c565880b79 100644 --- a/.github/workflows/build_test.yml +++ b/.github/workflows/build_test.yml @@ -143,10 +143,13 @@ jobs: runs-on: ubuntu-latest if: github.event_name == 'pull_request' steps: + - name: Checkout cyclus + uses: actions/checkout@v4 + - name: Save PR number and Commit hash to file run: | echo "${{ github.event.number }}" > pr_number - echo "${{ github.event.pull_request.head.sha }}" > commit_hash + echo "$(git show -s --format=%cd --date=format:'%m/%d/%Y %H:%M' ${{ github.event.pull_request.head.sha }}) - ${{ github.event.pull_request.head.sha }}" > commit_hash_timestamp - name: Upload PR number artifact uses: actions/upload-artifact@v4 @@ -157,8 +160,8 @@ jobs: - name: Upload Commit hash artifact uses: actions/upload-artifact@v4 with: - name: commit_hash - path: commit_hash + name: commit_hash_timestamp + path: commit_hash_timestamp build-test-rocky: runs-on: ubuntu-latest diff --git a/.github/workflows/pr_comment.yml b/.github/workflows/pr_comment.yml index db0ecb96f1..6ca74e1098 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 "### Downstream Build Status Report - $(echo "$(date +'%m/%d/%Y %H:%M')") - $(cat commit_hash)" > artifacts_merged.md + echo "### Downstream Build Status Report - $(cat commit_hash_timestamp)" > artifacts_merged.md cat ./*.txt >> artifacts_merged.md echo "PR_NUMBER=$(cat pr_number)" >> "$GITHUB_ENV" From 0459ffdc4004001287c35cf685d4cbd1a253fd74 Mon Sep 17 00:00:00 2001 From: bennibbelink <79653949+bennibbelink@users.noreply.github.com> Date: Sun, 24 Mar 2024 11:15:08 -0500 Subject: [PATCH 14/14] use git log to get timestamp --- .github/workflows/build_test.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build_test.yml b/.github/workflows/build_test.yml index c565880b79..937d1f30eb 100644 --- a/.github/workflows/build_test.yml +++ b/.github/workflows/build_test.yml @@ -149,7 +149,7 @@ jobs: - name: Save PR number and Commit hash to file run: | echo "${{ github.event.number }}" > pr_number - echo "$(git show -s --format=%cd --date=format:'%m/%d/%Y %H:%M' ${{ github.event.pull_request.head.sha }}) - ${{ github.event.pull_request.head.sha }}" > commit_hash_timestamp + 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