Skip to content

Commit

Permalink
Export preCICE_DIR for CI
Browse files Browse the repository at this point in the history
  • Loading branch information
Crazy-Rich-Meghan authored Dec 9, 2024
1 parent fadc8de commit 4308f16
Showing 1 changed file with 38 additions and 22 deletions.
60 changes: 38 additions & 22 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,11 @@ on:
- main

concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.sha }}
cancel-in-progress: true
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true

env:
BUILD_TYPE: RelWithDebInfo
PRECICE_VERSION: v3.1.2

jobs:
build:
Expand All @@ -24,39 +23,56 @@ jobs:
matrix:
os: [macos-latest, ubuntu-latest]
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@master
with:
repository: gismo/gismo
ref: stable
path: ./gismo

- uses: actions/checkout@v3
- uses: actions/checkout@master
with:
path: ./gismo/optional/${{ github.event.repository.name }}
#token: ${{ secrets.GH_PAT }}

# Step to install preCICE
- name: Install preCICE
if: runner.os == 'Linux'
run: |
if [[ "$RUNNER_OS" == "Linux" ]]; then
sudo apt update
sudo apt install -y build-essential cmake libeigen3-dev libxml2-dev libboost-all-dev petsc-dev python3-dev python3-numpy
elif [[ "$RUNNER_OS" == "macOS" ]]; then
brew install cmake eigen libxml2 boost petsc openmpi python3 numpy
fi
wget https://github.com/precice/precice/archive/$PRECICE_VERSION.tar.gz
tar -xzvf $PRECICE_VERSION.tar.gz
cd precice-${PRECICE_VERSION/v/}
cmake -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=/usr/local ..
sudo apt update
sudo apt install -y build-essential cmake libeigen3-dev libxml2-dev libboost-all-dev petsc-dev python3-dev python3-numpy
wget https://github.com/precice/precice/archive/v3.1.2.tar.gz
tar -xzvf v3.1.2.tar.gz
cd precice-3.1.2
cmake --preset=production # Configure using the production preset
cd build
make -j 10
sudo make install
export precice_DIR=$(pwd)/..
precice_DIR=$(pwd)
export precice_DIR=$(pwd)
- name: Run Tests
# Step to install preCICE
- name: Install preCICE for mac
if: runner.os == 'macOS'
run: |
brew install cmake eigen libxml2 boost petsc openmpi python3 numpy
wget https://github.com/precice/precice/archive/v3.1.2.tar.gz
tar -xzvf v3.1.2.tar.gz
cd precice-3.1.2
cmake --preset=production # Configure using the production preset
cd build
make -j 10
sudo make install
precice_DIR=$(pwd)
export precice_DIR=$(pwd)
- name: "Run for ${{ matrix.os }}"
shell: bash
working-directory: ${{ github.workspace }}
working-directory: ${{ runner.workspace }}
run: |
ctest -S ${{ github.repository }}/gismo/cmake/ctest_script.cmake \
-D CTEST_BUILD_NAME="${{ github.repository }}_actions_$GITHUB_RUN_NUMBER" \
# Use the precice_DIR set from the environment variable
ctest -S ${{ github.event.repository.name }}/gismo/cmake/ctest_script.cmake \
-D CTEST_BUILD_NAME="${{ github.event.repository.name }}_actions_$GITHUB_RUN_NUMBER" \
-D CTEST_SITE="${{ matrix.os }}_[actions]" \
-D LABELS_FOR_SUBPROJECTS="gsPreCICE-examples" \
-D LABELS_FOR_SUBPROJECTS="gsPreCICE-examples" \
-D CMAKE_ARGS="-DCMAKE_BUILD_TYPE=$BUILD_TYPE;-DCMAKE_CXX_STANDARD=11;-DGISMO_WITH_XDEBUG=ON;-DGISMO_BUILD_UNITTESTS=ON;-Dprecice_DIR=$precice_DIR" \
-D GISMO_OPTIONAL="gsElasticity\\;${{ github.repository }}"
-D GISMO_OPTIONAL="gsElasticity\\;${{ github.event.repository.name }}" -Q

0 comments on commit 4308f16

Please sign in to comment.