Skip to content

Commit

Permalink
#97: try a fix in ci
Browse files Browse the repository at this point in the history
  • Loading branch information
tlamonthezie committed Aug 28, 2024
1 parent c9d7edf commit ee3b8d7
Showing 1 changed file with 37 additions and 47 deletions.
84 changes: 37 additions & 47 deletions .github/workflows/build-and-test-macos.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Build and Test (macos)
name: Build and Test

# Trigger the workflow on push or pull request
on:
Expand All @@ -11,24 +11,21 @@ jobs:
strategy:
fail-fast: false
matrix:
host: [
{ os: macos-latest, compiler: { name: clang, cc: clang, cxx: clang++ }, gcov: gcov },
{ os: macos-latest, compiler: { name: gcc12, cc: gcc-12, cxx: g++-12 }, gcov: gcov-12 }
]
os: [ macos-latest ]
vtk_version: [ 9.3.1 ]
runs-on: ${{ matrix.host.os }}
compiler: [
[gcc-12, g++-12, gcov-12]
]
runs-on: ${{ matrix.os }}
name: vt-tv build and test
env:
VTK_SRC_DIR: /opt/src/vtk
VTK_BUILD_DIR: /opt/build/vtk
VTK_CACHE_KEY: ${{ matrix.host.os }}-${{ matrix.host.compiler.name }}-vtk-${{ matrix.vtk_version }}
VT_TV_BUILD_DIR: /opt/build/vt-tv
VT_TV_TESTS_ENABLED: "ON"
VT_TV_COVERAGE_ENABLED: "ON"
VT_TV_OUTPUT_DIR: /var/vt-tv/output
VT_TV_ARTIFACTS_DIR: /tmp/artifacts
CC: ~
CXX: ~
VTK_SRC_DIR: /opt/src/vtk
VTK_BUILD_DIR: /opt/build/vtk
VT_TV_BUILD_DIR: /opt/build/vt-tv
VT_TV_TESTS_ENABLED: "ON"
VT_TV_COVERAGE_ENABLED: "ON"
VT_TV_OUTPUT_DIR: /var/vt-tv/output
VT_TV_ARTIFACTS_DIR: /tmp/artifacts
steps:
- uses: actions/checkout@v4

Expand All @@ -37,33 +34,30 @@ jobs:
sudo mkdir -p ${{ env.VTK_SRC_DIR }} ${{ env.VTK_BUILD_DIR }}
sudo chown -R $(whoami) ${{ env.VTK_SRC_DIR }} ${{ env.VTK_BUILD_DIR }}
- name: Set environment variables
run: |
echo "CC=$(which ${{ matrix.host.compiler.cc }})" >> $GITHUB_ENV
echo "CXX=$(which ${{ matrix.host.compiler.cc }})" >> $GITHUB_ENV
# - name: Set environment variables
# run: |
# echo "CC=$(which ${{ matrix.host.compiler.cc }})" >> $GITHUB_ENV
# echo "CXX=$(which ${{ matrix.host.compiler.cc }})" >> $GITHUB_ENV

- name: Install dependencies
run: |
brew update && brew install coreutils lcov && brew install xquartz --cask
- name: Load VTK from cache
- name: Set up cache
id: vtk-cache
uses: actions/cache@v3
with:
path: |
${{ env.VTK_SRC_DIR }}
${{ env.VTK_BUILD_DIR }}
key: ${{ env.VTK_CACHE_KEY }}
path: ${{ env.VTK_BUILD_DIR }}
key: ${{ matrix.os }}-vtk-build-${{ matrix.vtk_version }}

- name: Setup VTK ${{ matrix.vtk_version }}
- name: Build VTK
id: cache-vtk-build
if: ${{steps.vtk-cache.outputs.cache-hit != 'true'}}
run: |
git clone --recursive --branch v${{ matrix.vtk_version }} https://gitlab.kitware.com/vtk/vtk.git ${{ env.VTK_SRC_DIR }}
sudo git clone --recursive --branch v${{ matrix.vtk_version }} https://gitlab.kitware.com/vtk/vtk.git /opt/src/vtk
cd ${{ env.VTK_SRC_DIR }}
cmake \
sudo cmake \
-DCMAKE_BUILD_TYPE:STRING=Release \
-DCMAKE_C_COMPILER="${{ env.CC }}" \
-DCMAKE_CXX_COMPILER="${{ env.CXX }}" \
-DBUILD_TESTING:BOOL=OFF \
-DVTK_OPENGL_HAS_OSMESA:BOOL=OFF \
-DVTK_DEFAULT_RENDER_WINDOW_OFFSCREEN:BOOL=OFF \
Expand All @@ -72,24 +66,20 @@ jobs:
-DVTK_USE_SDL2:BOOL=OFF \
-DVTK_Group_Rendering:BOOL=OFF \
-DBUILD_SHARED_LIBS:BOOL=ON \
-S /opt/src/vtk -B ${{ env.VTK_BUILD_DIR }}
cmake --build ${{ env.VTK_BUILD_DIR }} -j$(nproc)
-S ${{ env.VTK_SRC_DIR }} -B ${{ env.VTK_BUILD_DIR }}
sudo cmake --build ${{ env.VTK_BUILD_DIR }} -j$(sysctl -n hw.logicalcpu)
# - name: Build
# run: |
# cd ${{ github.workspace }}
# chmod +x ./ci/build.sh

# VTK_DIR=${{ env.VTK_BUILD_DIR }} \
# CC="${{ env.CC }}" \
# CXX="${{ env.CXX }}" \
# VT_TV_BUILD_DIR=${{ env.VT_TV_BUILD_DIR }} \
# VT_TV_TESTS_ENABLED=${{ env.VT_TV_TESTS_ENABLED }} \
# VT_TV_COVERAGE_ENABLED=${{ env.VT_TV_COVERAGE_ENABLED }} \
# GCOV=${{ matrix.host.gcov }}
# VT_TV_PYTHON_BINDINGS_ENABLED=OFF \
# VT_TV_WERROR_ENABLED=ON \
# ./build.sh
# sudo chmod +x ./ci/build.sh
# sudo \
# VTK_DIR=${{ env.VTK_DIR }} \
# VT_TV_BUILD_DIR=${{ env.VT_TV_BUILD_DIR }} \
# VT_TV_TESTS_ENABLED=${{ env.VT_TV_TESTS_ENABLED }} \
# VT_TV_COVERAGE_ENABLED=${{ env.VT_TV_COVERAGE_ENABLED }} \
# VT_TV_PYTHON_BINDINGS_ENABLED=OFF \
# VT_TV_WERROR_ENABLED=ON \
# ./build.sh

# - name: Test
# run: |
Expand Down Expand Up @@ -158,4 +148,4 @@ jobs:
# if: always()
# with:
# name: vt-tv-artifacts
# path: ${{ env.VT_TV_ARTIFACTS_DIR }}
# path: ${{ env.VT_TV_ARTIFACTS_DIR }}

0 comments on commit ee3b8d7

Please sign in to comment.