Skip to content

Commit

Permalink
#97: restore steps in macos ci action
Browse files Browse the repository at this point in the history
  • Loading branch information
tlamonthezie committed Aug 28, 2024
1 parent 3700e43 commit d3bab6f
Show file tree
Hide file tree
Showing 2 changed files with 83 additions and 83 deletions.
162 changes: 81 additions & 81 deletions .github/workflows/build-and-test-macos.yml
Original file line number Diff line number Diff line change
Expand Up @@ -61,84 +61,84 @@ jobs:
-S /opt/src/vtk -B ${{ env.VTK_DIR }}
sudo cmake --build ${{ env.VTK_DIR }} -j$(sysctl -n hw.logicalcpu)
# - name: Build
# run: |
# cd ${{ github.workspace }}
# 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: |
# cd ${{ github.workspace }}
# sudo \
# VT_TV_BUILD=OFF \
# VT_TV_RUN_TESTS=ON \
# VT_TV_BUILD_DIR=${{ env.VT_TV_BUILD_DIR }}
# ./build.sh

# - name: Build and Test Python bindings
# run: |
# # TODO: add conda
# # Activate conda environment
# # . /opt/conda/etc/profile.d/conda.sh && conda activate deves
# # Build
# # pip install PyYAML
# # pip install .
# # Test
# # python ./tests/test_bindings.py

# - name: Collect artifacts
# run: |
# # Add artifacts
# mkdir -p ${{ env.VT_TV_ARTIFACTS_DIR }}

# # > go to output directory
# pushd ${{ env.VT_TV_OUTPUT_DIR }}

# # > add the unit tests report artifact
# cp "junit-report.xml" ${{ env.VT_TV_ARTIFACTS_DIR }}/ || true

# # > add mesh files and png artifacts
# if [ -d "${{ env.VT_TV_OUTPUT_DIR }}" ]; then
# cp "${{ env.VT_TV_OUTPUT_DIR }}/"*".vtp" ${{ env.VT_TV_ARTIFACTS_DIR }}/
# cp "${{ env.VT_TV_OUTPUT_DIR }}/"*".png" ${{ env.VT_TV_ARTIFACTS_DIR }}/
# fi

# if [[ "${{ env.VT_TV_COVERAGE_ENABLED }}" == "ON" ]]; then
# # > add `coverage --list` file artifact
# lcov --list lcov_vt-tv_test_no_deps.info > ${{ env.VT_TV_ARTIFACTS_DIR }}/lcov-list-report.txt

# # > add total lines coverage file artifact (percentage of lines covered)
# # might be useful for generating later a badge in ci
# LCOV_SUMMARY=$(lcov --summary lcov_vt-tv_test_no_deps.info)
# LCOV_TOTAL_LINES_COV=$(echo $LCOV_SUMMARY | grep -E -o 'lines......: ([0-9.]+)*' | grep -o -E '[0-9]+.[0-9]+')
# echo $LCOV_TOTAL_LINES_COV > lcov-lines-total.txt
# cp lcov-lines-total.txt ${{ env.VT_TV_ARTIFACTS_DIR }}/
# fi
# popd

# # list artifacts dir content
# ls ${{ env.VT_TV_ARTIFACTS_DIR }}

# - name: Unit tests
# if: ${{ env.VT_TV_TESTS_ENABLED == 'ON' }}
# uses: phoenix-actions/test-reporting@v15
# with:
# name: Tests report
# path: ${{ env.VT_TV_ARTIFACTS_DIR }}/junit-report.xml
# reporter: java-junit
# output-to: step-summary

# - name: Upload artifacts
# uses: actions/upload-artifact@v4
# if: always()
# with:
# name: vt-tv-artifacts
# path: ${{ env.VT_TV_ARTIFACTS_DIR }}
- name: Build
run: |
cd ${{ github.workspace }}
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: |
cd ${{ github.workspace }}
sudo \
VT_TV_BUILD=OFF \
VT_TV_RUN_TESTS=ON \
VT_TV_BUILD_DIR=${{ env.VT_TV_BUILD_DIR }}
./build.sh
- name: Build and Test Python bindings
run: |
# TODO: add conda
# Activate conda environment
# . /opt/conda/etc/profile.d/conda.sh && conda activate deves
# Build
# pip install PyYAML
# pip install .
# Test
# python ./tests/test_bindings.py
- name: Collect artifacts
run: |
# Add artifacts
mkdir -p ${{ env.VT_TV_ARTIFACTS_DIR }}
# > go to output directory
pushd ${{ env.VT_TV_OUTPUT_DIR }}
# > add the unit tests report artifact
cp "junit-report.xml" ${{ env.VT_TV_ARTIFACTS_DIR }}/ || true
# > add mesh files and png artifacts
if [ -d "${{ env.VT_TV_OUTPUT_DIR }}" ]; then
cp "${{ env.VT_TV_OUTPUT_DIR }}/"*".vtp" ${{ env.VT_TV_ARTIFACTS_DIR }}/
cp "${{ env.VT_TV_OUTPUT_DIR }}/"*".png" ${{ env.VT_TV_ARTIFACTS_DIR }}/
fi
if [[ "${{ env.VT_TV_COVERAGE_ENABLED }}" == "ON" ]]; then
# > add `coverage --list` file artifact
lcov --list lcov_vt-tv_test_no_deps.info > ${{ env.VT_TV_ARTIFACTS_DIR }}/lcov-list-report.txt
# > add total lines coverage file artifact (percentage of lines covered)
# might be useful for generating later a badge in ci
LCOV_SUMMARY=$(lcov --summary lcov_vt-tv_test_no_deps.info)
LCOV_TOTAL_LINES_COV=$(echo $LCOV_SUMMARY | grep -E -o 'lines......: ([0-9.]+)*' | grep -o -E '[0-9]+.[0-9]+')
echo $LCOV_TOTAL_LINES_COV > lcov-lines-total.txt
cp lcov-lines-total.txt ${{ env.VT_TV_ARTIFACTS_DIR }}/
fi
popd
# list artifacts dir content
ls ${{ env.VT_TV_ARTIFACTS_DIR }}
- name: Unit tests
if: ${{ env.VT_TV_TESTS_ENABLED == 'ON' }}
uses: phoenix-actions/test-reporting@v15
with:
name: Tests report
path: ${{ env.VT_TV_ARTIFACTS_DIR }}/junit-report.xml
reporter: java-junit
output-to: step-summary

- name: Upload artifacts
uses: actions/upload-artifact@v4
if: always()
with:
name: vt-tv-artifacts
path: ${{ env.VT_TV_ARTIFACTS_DIR }}
4 changes: 2 additions & 2 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,8 @@ set(VT_TV_N_THREADS "2" CACHE STRING "Number of OpenMP threads to use")

include(cmake/load_packages.cmake)

if(APPLE)
add_compile_options(-ffat-lto-objects -Wno-ignored-optimization-argument)
if(APPLE AND NOT CMAKE_CXX_COMPILER_ID MATCHES "AppleClang")
add_compile_options(-ffat-lto-objects)
endif()

add_definitions(-DVT_TV_N_THREADS=${VT_TV_N_THREADS})
Expand Down

0 comments on commit d3bab6f

Please sign in to comment.