Skip to content

Commit

Permalink
ci: use composite
Browse files Browse the repository at this point in the history
  • Loading branch information
scivision committed Jun 26, 2024
1 parent 7441aaa commit 8cde827
Show file tree
Hide file tree
Showing 4 changed files with 100 additions and 66 deletions.
71 changes: 5 additions & 66 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -52,74 +52,13 @@ jobs:

steps:

- name: Install prereqs (Linux)
if: runner.os == 'Linux'
run: |
sudo apt update
sudo apt install --no-install-recommends libopenmpi-dev openmpi-bin liblapack-dev libscalapack-openmpi-dev ninja-build
- name: Install prereqs (macOS)
if: runner.os == 'macOS'
run: brew install open-mpi ninja scalapack

- name: Install OpenBLAS (Linux)
if: ${{ matrix.lapack_vendor == 'OpenBLAS' }}
run: sudo apt install --no-install-recommends libopenblas-dev

- uses: actions/checkout@v4

- name: Build METIS
if: ${{ matrix.metis }}
run: cmake -P scripts/build_metis.cmake

- name: Build scotch
if: ${{ matrix.scotch }}
run: cmake -P scripts/build_scotch.cmake

- name: configure
run: >-
cmake
--preset default
-Dparallel:BOOL=${{ matrix.parallel }}
-Dscotch:BOOL=${{ matrix.scotch }}
-Dmetis:BOOL=${{ matrix.metis }}
-DLAPACK_VENDOR=${{ matrix.lapack_vendor }}
- name: build, test release
run: cmake --workflow --preset default
- name: install prereqs
uses: ./.github/workflows/composite-deps

- name: install package
run: cmake --install build

- name: configure example
run: cmake -S example -B example/build
- name: build and install
uses: ./.github/workflows/composite-build

- name: build example
run: cmake --build example/build

- name: test example
run: ctest --test-dir example/build -V

- name: Scotch example
if: ${{ matrix.scotch }}
run: |
cmake -S example/scotch -Bexample/scotch/build
cmake --build example/scotch/build
ctest --test-dir example/scotch/build
- name: print config log
if: ${{ failure() && matrix.scotch }}
run: |
cat example/scotch/build/CMakeFiles/CMakeConfigureLog.yaml
- name: METIS example
if: ${{ matrix.metis }}
run: |
cmake -S example/metis -Bexample/metis/build
cmake --build example/metis/build
ctest --test-dir example/metis/build
- name: print config log
if: ${{ failure() && matrix.metis }}
run: |
cat example/metis/build/CMakeFiles/CMakeConfigureLog.yaml
uses: ./.github/workflows/composite-example
22 changes: 22 additions & 0 deletions .github/workflows/composite-build/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
runs:
using: "composite"

steps:

- name: configure
shell: bash
run: >-
cmake
--preset default
-Dparallel:BOOL=${{ matrix.parallel }}
-Dscotch:BOOL=${{ matrix.scotch }}
-Dmetis:BOOL=${{ matrix.metis }}
-DLAPACK_VENDOR=${{ matrix.lapack_vendor }}
- name: build, test release
shell: bash
run: cmake --workflow --preset default

- name: install package
shell: bash
run: cmake --install build
31 changes: 31 additions & 0 deletions .github/workflows/composite-deps/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
runs:
using: "composite"

steps:

- name: Install prereqs (Linux)
shell: bash
if: runner.os == 'Linux'
run: |
sudo apt update
sudo apt install --no-install-recommends libopenmpi-dev openmpi-bin liblapack-dev libscalapack-openmpi-dev ninja-build
- name: Install prereqs (macOS)
shell: bash
if: runner.os == 'macOS'
run: brew install open-mpi ninja scalapack

- name: Install OpenBLAS (Linux)
shell: bash
if: ${{ matrix.lapack_vendor == 'OpenBLAS' }}
run: sudo apt install --no-install-recommends libopenblas-dev

- name: Build METIS
shell: bash
if: ${{ matrix.metis }}
run: cmake -P scripts/build_metis.cmake

- name: Build scotch
shell: bash
if: ${{ matrix.scotch }}
run: cmake -P scripts/build_scotch.cmake
42 changes: 42 additions & 0 deletions .github/workflows/composite-example/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
runs:
using: "composite"

steps:

- name: configure example
shell: bash
run: cmake -S example -B example/build

- name: build example
shell: bash
run: cmake --build example/build

- name: test example
shell: bash
run: ctest --test-dir example/build -V

- name: Scotch example
shell: bash
if: ${{ matrix.scotch }}
run: |
cmake -S example/scotch -Bexample/scotch/build
cmake --build example/scotch/build
ctest --test-dir example/scotch/build
- name: print config log
shell: bash
if: ${{ failure() && matrix.scotch }}
run: cat example/scotch/build/CMakeFiles/CMakeConfigureLog.yaml

- name: METIS example
shell: bash
if: ${{ matrix.metis }}
run: |
cmake -S example/metis -Bexample/metis/build
cmake --build example/metis/build
ctest --test-dir example/metis/build
- name: print config log
shell: bash
if: ${{ failure() && matrix.metis }}
run: cat example/metis/build/CMakeFiles/CMakeConfigureLog.yaml

0 comments on commit 8cde827

Please sign in to comment.