Skip to content

Commit

Permalink
ci: use composite workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
scivision committed Jun 5, 2024
1 parent 61724bd commit 89f1c5d
Show file tree
Hide file tree
Showing 3 changed files with 63 additions and 41 deletions.
45 changes: 4 additions & 41 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ env:
CMAKE_BUILD_TYPE: Release
CMAKE_INSTALL_PREFIX: ~/libgem
GEMINI_ROOT: ~/libgem
CMAKE_GENERATOR: Ninja
HOMEBREW_NO_INSTALL_CLEANUP: 1
CMAKE_BUILD_PARALLEL_LEVEL: 4

Expand Down Expand Up @@ -75,50 +76,12 @@ jobs:
with:
python-version: ${{ matrix.python-version }}

- name: Checkout GemGI (for simulation config.nml inputs)
- name: Git Checkout ${{ github.action_repository }}
uses: actions/checkout@v4
with:
repository: gemini3d/gemci
path: ${{ github.workspace }}/gemci

- name: Install Prereqs (Linux)
if: runner.os == 'Linux'
run: |
sudo apt update
sudo apt install --no-install-recommends libopenmpi-dev openmpi-bin libhdf5-dev
- name: Install Prereqs (Macos)
if: runner.os == 'macOS'
run: brew install open-mpi hdf5 scalapack

- name: Cache install Gemini3D
id: cache-gemini
uses: actions/cache@v4
with:
path: |
${{ env.CMAKE_INSTALL_PREFIX }}
key: ${{ runner.os }}-gemini-${{ hashFiles('gemini3d/CMakeLists.txt') }}
# weak check that gemini3d has changed since last cache update

- name: Checkout Gemini3D
if: steps.cache-gemini.outputs.cache-hit != 'true'
uses: actions/checkout@v4
with:
repository: gemini3d/gemini3d
path: gemini3d
submodules: true
- uses: ./.github/workflows/composite-pkg

- name: non-cache Install Gemini3D
if: steps.cache-gemini.outputs.cache-hit != 'true'
timeout-minutes: 15
run: |
cmake -B build
cmake --build build
cmake --install build
working-directory: gemini3d

- name: Git Checkout ${{ github.action_repository }}
uses: actions/checkout@v4
- uses: ./.github/workflows/composite-gemini3d

- name: Install Python packages
run: python -m pip install .[tests,plots]
Expand Down
38 changes: 38 additions & 0 deletions .github/workflows/composite-gemini3d/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
runs:

using: 'composite'

steps:

- name: Checkout GemGI (for simulation config.nml inputs)
uses: actions/checkout@v4
with:
repository: gemini3d/gemci
path: ${{ github.workspace }}/gemci

- name: Cache install Gemini3D
id: cache-gemini
uses: actions/cache@v4
with:
path: |
${{ env.CMAKE_INSTALL_PREFIX }}
key: ${{ runner.os }}-gemini-${{ hashFiles('gemini3d/CMakeLists.txt') }}
# weak check that gemini3d has changed since last cache update

- name: Checkout Gemini3D
if: steps.cache-gemini.outputs.cache-hit != 'true'
uses: actions/checkout@v4
with:
repository: gemini3d/gemini3d
path: gemini3d
submodules: true

- name: non-cache Install Gemini3D
if: steps.cache-gemini.outputs.cache-hit != 'true'
timeout-minutes: 15
shell: bash
run: |
cmake -B build
cmake --build build
cmake --install build
working-directory: gemini3d
21 changes: 21 additions & 0 deletions .github/workflows/composite-pkg/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
runs:

using: 'composite'

steps:

# don't install libscalapack-openmpi-dev, it is broken CMake package

# don't remove sudo apt update or every once in a while all the jobs will fail when the GA runner
# is out of sync with the upstream Ubuntu package repos
- name: Install packages (Linux)
shell: bash
if: runner.os == 'Linux'
run: |
sudo apt update
sudo apt install --no-install-recommends libopenmpi-dev openmpi-bin libhdf5-dev ninja-build liblapack-dev
- name: Install packages (MacOS)
shell: bash
if: runner.os == 'macOS'
run: brew install ninja open-mpi hdf5 scalapack

0 comments on commit 89f1c5d

Please sign in to comment.