diff --git a/.github/workflows/build-BinaryBH-example.yml b/.github/workflows/build-BinaryBH-example.yml index 9b85b04..5ea7c99 100644 --- a/.github/workflows/build-BinaryBH-example.yml +++ b/.github/workflows/build-BinaryBH-example.yml @@ -1,14 +1,14 @@ name: Build BinaryBH example with TwoPunctures on: - push: + push: schedule: # Run once per month - cron: '0 0 1 * *' jobs: build-BinaryBH-example: - runs-on: ubuntu-20.04 + runs-on: ubuntu-24.04 env: CHOMBO_HOME: ${{ github.workspace }}/Chombo/lib TWOPUNCTURES_SOURCE: ${{ github.workspace }}/TwoPunctures/Source @@ -16,36 +16,39 @@ jobs: steps: - name: Checkout Chombo - uses: actions/checkout@v2 + uses: actions/checkout@v6 with: repository: GRChombo/Chombo path: Chombo - name: Checkout GRChombo - uses: actions/checkout@v2 + uses: actions/checkout@v6 with: repository: GRChombo/GRChombo path: GRChombo - name: Checkout TwoPunctures - uses: actions/checkout@v2 + uses: actions/checkout@v6 with: path: TwoPunctures - - name: Install Chombo dependencies + - name: Install Chombo and TwoPunctures dependencies run: | sudo apt-get update - sudo apt-get -y --no-install-recommends install csh gfortran-10 g++-10 cpp-10 libhdf5-dev libhdf5-openmpi-dev openmpi-bin libblas-dev liblapack-dev libgetopt-complete-perl - - - name: Set Compilers - run: | - sudo update-alternatives --install /usr/bin/g++ g++ /usr/bin/g++-10 100 - sudo update-alternatives --install /usr/bin/gfortran gfortran /usr/bin/gfortran-10 100 - sudo update-alternatives --install /usr/bin/cpp cpp /usr/bin/cpp-10 100 + sudo apt-get -y --no-install-recommends install \ + csh \ + libhdf5-dev \ + libhdf5-openmpi-dev \ + openmpi-bin \ + libblas-dev \ + liblapack-dev \ + libgetopt-complete-perl \ + libgsl-dev - name: Build Chombo run: | - cp $GITHUB_WORKSPACE/GRChombo/InstallNotes/MakeDefsLocalExamples/ubuntu-gcc.Make.defs.local $CHOMBO_HOME/mk/Make.defs.local + cp $GITHUB_WORKSPACE/GRChombo/InstallNotes/MakeDefsLocalExamples/ubuntu-gcc.Make.defs.local \ + $CHOMBO_HOME/mk/Make.defs.local make -j 4 AMRTimeDependent AMRTools BaseTools BoxTools working-directory: ${{ env.CHOMBO_HOME }} diff --git a/.github/workflows/style.yml b/.github/workflows/style.yml new file mode 100644 index 0000000..866c614 --- /dev/null +++ b/.github/workflows/style.yml @@ -0,0 +1,38 @@ +name: Style + +on: push + +concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: true + +jobs: + cpp-linter: + name: clang-format + runs-on: ubuntu-latest + env: + LLVM_VERSION: '19' + + steps: + - name: Checkout TwoPunctures + uses: actions/checkout@v6 + + + - name: Run clang-format on modified files + uses: cpp-linter/cpp-linter-action@v2 + id: linter + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + with: + style: 'file' # Clang-Format style + tidy-checks: '-*' # Don't run clang-tidy + version: ${{ env.LLVM_VERSION }} + files-changed-only: true + lines-changed-only: false + # Write a comment to the PR with the output + step-summary: 'true' # Print output in the worflow job summary + + - name: Fail job if checks fail + if: steps.linter.outputs.checks-failed > 0 + run: exit 1 + diff --git a/.github/workflows/test-clang-format.yml b/.github/workflows/test-clang-format.yml deleted file mode 100644 index cfeea42..0000000 --- a/.github/workflows/test-clang-format.yml +++ /dev/null @@ -1,15 +0,0 @@ -name: Check Clang Format - -on: [push] - -jobs: - format: - runs-on: ubuntu-latest - - steps: - - uses: actions/checkout@v2 - - uses: DoozyX/clang-format-lint-action@v0.11 - with: - source: '.' - extensions: 'hpp,cpp' - clangFormatVersion: 10 diff --git a/README.md b/README.md index 6d32629..aec160b 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,7 @@ # TwoPunctures (GRChombo) ![Build BinaryBH example with TwoPunctures](https://github.com/GRChombo/TwoPunctures/workflows/Build%20BinaryBH%20example%20with%20TwoPunctures/badge.svg) -![Check Clang Format](https://github.com/GRChombo/TwoPunctures/workflows/Check%20Clang%20Format/badge.svg) +![Style](https://github.com/GRChombo/TwoPunctures/workflows/Style/badge.svg) This repository originates from the [standalone TwoPunctures](https://bitbucket.org/relastro/twopunctures-standalone)