Merge trilinos/develop into e3sm-project/develop #13
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
name: Check MueLu clang-format | |
on: [pull_request] | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- uses: DoozyX/[email protected] | |
with: | |
source: './packages/muelu' | |
exclude: '' | |
extensions: 'cpp,hpp' | |
clangFormatVersion: 14 | |
inplace: true | |
- run: git diff HEAD > format_patch.txt | |
- run: if [ "$(cat format_patch.txt)" == "" ] ; then rm format_patch.txt ; fi | |
- uses: actions/upload-artifact@v4 | |
id: upload-artf | |
if: ${{ hashFiles('format_patch.txt') != '' }} | |
with: | |
name: MueLu format patch | |
path: format_patch.txt | |
- name: Artifact ID test | |
run: | | |
echo "Artifact ID is ${{ steps.upload-artf.outputs.artifact-id }}" | |
echo "Link: https://github.com/$GITHUB_REPOSITORY/actions/runs/$GITHUB_RUN_ID/artifacts/${{ steps.upload-artf.outputs.artifact-id }}" | |
- name: Post artifact in issue comment | |
uses: mshick/[email protected] | |
if: ${{ hashFiles('format_patch.txt') != '' }} | |
with: | |
message: | | |
Your PR updated files in MueLu, but did not respect the clang formatting settings. Please apply the patch found [here](https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}/artifacts/${{ steps.upload-artf.outputs.artifact-id }}) | |
- uses: actions/github-script@v3 | |
if: ${{ hashFiles('format_patch.txt') != '' }} | |
with: | |
script: | | |
core.setFailed('Please download and apply the formatting patch! It is located at the bottom of the summary tab for this workflow.') |