Skip to content

Commit

Permalink
Merge branch 'develop' into feature/rk_defaults
Browse files Browse the repository at this point in the history
  • Loading branch information
Steven-Roberts committed Jan 9, 2025
2 parents 872ad0b + 792686d commit 3d66641
Show file tree
Hide file tree
Showing 864 changed files with 117,579 additions and 10,550 deletions.
1 change: 1 addition & 0 deletions .cmake-format.py
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@
'EXTRA_ARGS': '+',
'FLOAT_PRECISION': 1,
'INTEGER_PRECISION': 1,
'LABELS': '+',
'MPI_NPROCS': 1,
'TEST_ARGS': '+'},
'pargs': {'flags': ['NODIFF'], 'nargs': '2+'}},
Expand Down
45 changes: 45 additions & 0 deletions .github/actions/apply-style/checkout.sh
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
10 changes: 9 additions & 1 deletion .github/actions/test-driver/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,9 @@ inputs:
indexsize:
description: SUNDIALS_INDEX_SIZE
required: true
tpls:
description: "enable/disable TPLs"
required: true

runs:
using: composite
Expand All @@ -26,5 +29,10 @@ runs:
run: |
git config --global --add safe.directory $GITHUB_WORKSPACE
cd test
./test_driver.sh --testtype CUSTOM --env env/docker.sh --tpls --sunrealtype ${{ inputs.precision }} --indexsize ${{ inputs.indexsize }}
./test_driver.sh \
--testtype CUSTOM \
--env env/docker.sh \
--tpls ${{ inputs.tpls }} \
--sunrealtype ${{ inputs.precision }} \
--indexsize ${{ inputs.indexsize }}
shell: bash
1 change: 1 addition & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,4 @@ updates:
schedule:
# Check for updates to GitHub Actions every week
interval: "weekly"
target-branch: "develop"
4 changes: 2 additions & 2 deletions .github/workflows/build-ci-containers-e4s.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ jobs:
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Build and push Docker images
uses: docker/build-push-action@v6.7.0
uses: docker/build-push-action@v6.10.0
with:
context: "./docker/sundials-ci/e4s-base"
build-args: e4s_version=22.05
Expand Down Expand Up @@ -56,7 +56,7 @@ jobs:
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Build and push Docker images
uses: docker/build-push-action@v6.7.0
uses: docker/build-push-action@v6.10.0
with:
context: "./docker/sundials-ci/e4s-quarterly"
build-args: spack_yaml=./int${{ matrix.indexsize }}-${{ matrix.precision }}/spack.yaml
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/build-ci-containers-nightly.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ jobs:
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Build and push Docker images
uses: docker/build-push-action@v6.7.0
uses: docker/build-push-action@v6.10.0
with:
context: "./docker/sundials-ci/spack-nightly"
build-args: spack_yaml=./int${{ matrix.indexsize }}-${{ matrix.precision }}/spack.yaml
Expand Down
58 changes: 57 additions & 1 deletion .github/workflows/check-format.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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"

Expand All @@ -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
58 changes: 57 additions & 1 deletion .github/workflows/check-spelling.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand All @@ -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
67 changes: 63 additions & 4 deletions .github/workflows/check-swig.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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"

Expand All @@ -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
Loading

0 comments on commit 3d66641

Please sign in to comment.