-
Notifications
You must be signed in to change notification settings - Fork 133
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'develop' into feature/rk_defaults
- Loading branch information
Showing
864 changed files
with
117,579 additions
and
10,550 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
#!/bin/bash | ||
|
||
### | ||
# Attempt to find the branch of the PR from the detached head state | ||
## | ||
|
||
echo "~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~" | ||
echo "Attempting to find branch that matches commit..." | ||
|
||
# Get the current commit SHA | ||
current_commit_sha=$(git rev-parse HEAD) | ||
# List all branches containing the current commit SHA | ||
branches=$(git branch -r --contains $current_commit_sha) | ||
|
||
echo "all branches:" | ||
echo "$(git branch -a)" | ||
echo "branches with SHA $current_commit_sha:" | ||
echo "$branches" | ||
|
||
# Loop over the string split by whitespace | ||
branch="" | ||
num_branches_found=0 | ||
for _possible_branch in $branches; do | ||
# Skip items that start with "pull/" | ||
if [[ $_possible_branch == pull/* ]]; then | ||
continue | ||
fi | ||
if [[ $_possible_branch == origin/* ]]; then | ||
_possible_branch=$(echo "$_possible_branch" | sed 's/origin\///') | ||
fi | ||
echo "Possible Branch: $_possible_branch" | ||
branch=$_possible_branch | ||
num_branches_found=$((num_branches_found+1)) | ||
done | ||
|
||
if [ "$num_branches_found" -ne 1 ]; then | ||
echo "Error: Unable to find a single branch that matched git sha $current_commit_sha" | ||
exit 1 | ||
fi | ||
|
||
echo "Found branch: $branch" | ||
echo "~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~" | ||
|
||
git checkout $branch | ||
git submodule update --init --recursive |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -6,3 +6,4 @@ updates: | |
schedule: | ||
# Check for updates to GitHub Actions every week | ||
interval: "weekly" | ||
target-branch: "develop" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,9 +3,16 @@ name: Checks - formatting | |
on: | ||
pull_request: | ||
workflow_dispatch: | ||
issue_comment: | ||
types: [created] | ||
|
||
concurrency: | ||
group: ${{ github.workflow }}-${{ github.head_ref || github.ref_name }} | ||
cancel-in-progress: true | ||
|
||
jobs: | ||
format_check: | ||
if: ${{ github.event_name != 'issue_comment' || (github.event_name == 'issue_comment' && startsWith(github.event.comment.body, '/autofix')) }} | ||
runs-on: ubuntu-latest | ||
container: | ||
image: ghcr.io/llnl/sundials_spack_cache:llvm-17.0.4-h4lflucc3v2vage45opbo2didtcuigsn.spack | ||
|
@@ -37,10 +44,18 @@ jobs: | |
run: clang-format --version | ||
|
||
- name: Check out repository code | ||
if: github.event_name != 'issue_comment' | ||
uses: actions/checkout@v4 | ||
with: | ||
submodules: true | ||
|
||
- name: Check out repository code | ||
if: github.event_name == 'issue_comment' | ||
uses: actions/checkout@v4 | ||
with: | ||
ref: refs/pull/${{ github.event.issue.number }}/head | ||
fetch-depth: 0 | ||
|
||
- name: Add safe directory | ||
run: git config --global --add safe.directory "$GITHUB_WORKSPACE" | ||
|
||
|
@@ -56,9 +71,50 @@ jobs: | |
run: /usr/bin/git diff > format.patch | ||
|
||
- name: Archive diff as a patch if we failed | ||
uses: actions/upload-artifact@v3 | ||
uses: actions/upload-artifact@v4 | ||
if: failure() | ||
with: | ||
name: format.patch | ||
path: | | ||
${{ github.workspace }}/format.patch | ||
apply_format: | ||
if: ${{ always() && contains(join(needs.*.result, ','), 'failure') && (github.event_name == 'issue_comment' && startsWith(github.event.comment.body, '/autofix')) }} | ||
needs: format_check | ||
runs-on: ubuntu-latest | ||
steps: | ||
# Checkout the GitHub created reference for the PR. | ||
# The only way to do this is by using the "issue" number | ||
# but that is really the PR number in this context. | ||
# This is due to using an `issue_comment` event which | ||
# is due to the GitHub Actions API that does not have | ||
# a `pull_request_comment` event or something similar. | ||
# This leaves us in a detached head state which is corrected | ||
# in `apply-style/checkout.sh` | ||
- name: Checkout repository code | ||
uses: actions/checkout@v4 | ||
with: | ||
ref: refs/pull/${{ github.event.issue.number }}/head | ||
fetch-depth: 0 | ||
|
||
- name: Checkout the right git ref | ||
run: ./.github/actions/apply-style/checkout.sh | ||
|
||
- name: Download the git diff from format_check | ||
uses: actions/download-artifact@v4 | ||
with: | ||
name: format.patch | ||
|
||
- name: Apply patch | ||
run: | | ||
git apply format.patch | ||
rm format.patch | ||
- name: Commit fixes | ||
run: | | ||
git config user.name "format-robot" | ||
git config user.email "[email protected]" | ||
if [ -n "$(git status --porcelain)" ]; then | ||
git commit -am 'apply format updates' | ||
git push | ||
fi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,9 +3,16 @@ name: Checks - spelling | |
on: | ||
pull_request: | ||
workflow_dispatch: | ||
issue_comment: | ||
types: [created] | ||
|
||
concurrency: | ||
group: ${{ github.workflow }}-${{ github.head_ref || github.ref_name }} | ||
cancel-in-progress: true | ||
|
||
jobs: | ||
spelling_check: | ||
if: ${{ github.event_name != 'issue_comment' || (github.event_name == 'issue_comment' && startsWith(github.event.comment.body, '/autofix')) }} | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Install python3-pip | ||
|
@@ -20,10 +27,18 @@ jobs: | |
run: codespell --version | ||
|
||
- name: Check out repository code | ||
if: github.event_name != 'issue_comment' | ||
uses: actions/checkout@v4 | ||
with: | ||
submodules: true | ||
|
||
- name: Check out repository code | ||
if: github.event_name == 'issue_comment' | ||
uses: actions/checkout@v4 | ||
with: | ||
ref: refs/pull/${{ github.event.issue.number }}/head | ||
fetch-depth: 0 | ||
|
||
- name: Run codespell | ||
run: | | ||
./scripts/spelling.sh | ||
|
@@ -36,9 +51,50 @@ jobs: | |
run: /usr/bin/git diff > spelling.patch | ||
|
||
- name: Archive diff as a patch if we failed | ||
uses: actions/upload-artifact@v3 | ||
uses: actions/upload-artifact@v4 | ||
if: failure() | ||
with: | ||
name: spelling.patch | ||
path: | | ||
${{ github.workspace }}/spelling.patch | ||
apply_spelling: | ||
if: ${{ always() && contains(join(needs.*.result, ','), 'failure') && (github.event_name == 'issue_comment' && startsWith(github.event.comment.body, '/autofix')) }} | ||
needs: spelling_check | ||
runs-on: ubuntu-latest | ||
steps: | ||
# Checkout the GitHub created reference for the PR. | ||
# The only way to do this is by using the "issue" number | ||
# but that is really the PR number in this context. | ||
# This is due to using an `issue_comment` event which | ||
# is due to the GitHub Actions API that does not have | ||
# a `pull_request_comment` event or something similar. | ||
# This leaves us in a detached head state which is corrected | ||
# in `apply-style/checkout.sh` | ||
- name: Checkout repository code | ||
uses: actions/checkout@v4 | ||
with: | ||
ref: refs/pull/${{ github.event.issue.number }}/head | ||
fetch-depth: 0 | ||
|
||
- name: Checkout the right git ref | ||
run: ./.github/actions/apply-style/checkout.sh | ||
|
||
- name: Download the git diff from spelling_check | ||
uses: actions/download-artifact@v4 | ||
with: | ||
name: spelling.patch | ||
|
||
- name: Apply patch | ||
run: | | ||
git apply spelling.patch | ||
rm spelling.patch | ||
- name: Commit fixes | ||
run: | | ||
git config user.name "format-robot" | ||
git config user.email "[email protected]" | ||
if [ -n "$(git status --porcelain)" ]; then | ||
git commit -am 'apply spelling updates' | ||
git push | ||
fi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,27 +3,45 @@ name: Checks - swig | |
on: | ||
pull_request: | ||
workflow_dispatch: | ||
issue_comment: | ||
types: [created] | ||
|
||
concurrency: | ||
group: ${{ github.workflow }}-${{ github.head_ref || github.ref_name }} | ||
cancel-in-progress: true | ||
|
||
jobs: | ||
swig: | ||
swig_check: | ||
if: ${{ github.event_name != 'issue_comment' || (github.event_name == 'issue_comment' && startsWith(github.event.comment.body, '/autofix')) }} | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: Install pcre | ||
run: | | ||
sudo apt install libpcre3-dev | ||
- name: Install swig | ||
run: | | ||
git clone https://github.com/sundials-codes/swig | ||
cd swig | ||
./autogen.sh | ||
./configure --prefix=/usr/ | ||
make | ||
make | ||
sudo make install | ||
swig -version | ||
- name: Check out repository code | ||
if: github.event_name != 'issue_comment' | ||
uses: actions/checkout@v4 | ||
with: | ||
submodules: true | ||
|
||
- name: Check out repository code | ||
if: github.event_name == 'issue_comment' | ||
uses: actions/checkout@v4 | ||
with: | ||
ref: refs/pull/${{ github.event.issue.number }}/head | ||
fetch-depth: 0 | ||
|
||
- name: Add safe directory | ||
run: git config --global --add safe.directory "$GITHUB_WORKSPACE" | ||
|
||
|
@@ -41,9 +59,50 @@ jobs: | |
run: /usr/bin/git diff > swig.patch | ||
|
||
- name: Archive diff as a patch if we failed | ||
uses: actions/upload-artifact@v3 | ||
uses: actions/upload-artifact@v4 | ||
if: failure() | ||
with: | ||
name: swig.patch | ||
path: | | ||
${{ github.workspace }}/swig.patch | ||
apply_swig: | ||
if: ${{ always() && contains(join(needs.*.result, ','), 'failure') && (github.event_name == 'issue_comment' && startsWith(github.event.comment.body, '/autofix')) }} | ||
needs: swig_check | ||
runs-on: ubuntu-latest | ||
steps: | ||
# Checkout the GitHub created reference for the PR. | ||
# The only way to do this is by using the "issue" number | ||
# but that is really the PR number in this context. | ||
# This is due to using an `issue_comment` event which | ||
# is due to the GitHub Actions API that does not have | ||
# a `pull_request_comment` event or something similar. | ||
# This leaves us in a detached head state which is corrected | ||
# in `apply-style/checkout.sh` | ||
- name: Checkout repository code | ||
uses: actions/checkout@v4 | ||
with: | ||
ref: refs/pull/${{ github.event.issue.number }}/head | ||
fetch-depth: 0 | ||
|
||
- name: Checkout the right git ref | ||
run: ./.github/actions/apply-style/checkout.sh | ||
|
||
- name: Download the git diff from swig_check | ||
uses: actions/download-artifact@v4 | ||
with: | ||
name: swig.patch | ||
|
||
- name: Apply patch | ||
run: | | ||
git apply swig.patch | ||
rm swig.patch | ||
- name: Commit fixes | ||
run: | | ||
git config user.name "format-robot" | ||
git config user.email "[email protected]" | ||
if [ -n "$(git status --porcelain)" ]; then | ||
git commit -am 'apply swig updates' | ||
git push | ||
fi |
Oops, something went wrong.