Test macOS CI #3707
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Copyright (C) The DDC development team, see COPYRIGHT.md file | |
# | |
# SPDX-License-Identifier: MIT | |
name: Tests | |
on: | |
schedule: | |
- cron: "0 1 * * *" # every day at 1am | |
pull_request: | |
push: | |
branches: | |
- main | |
concurrency: | |
group: ${{ github.workflow }}-${{ github.ref == github.ref_protected && github.run_id || github.event.pull_request.number || github.ref }} | |
cancel-in-progress: true | |
jobs: | |
id_repo: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Identify repository | |
id: identify_repo | |
run: | | |
echo "in_base_repo=${{ (github.event_name == 'push' && github.repository == 'CExA-project/ddc') || github.event.pull_request.head.repo.full_name == 'CExA-project/ddc' }}" >> "$GITHUB_OUTPUT" | |
outputs: { in_base_repo: '${{ steps.identify_repo.outputs.in_base_repo }}' } | |
test-macos: | |
if: github.ref_name != 'main' | |
strategy: | |
fail-fast: false | |
matrix: | |
backend: | |
- name: 'cpu' | |
c_compiler: 'gcc' | |
cxx_compiler: 'g++' | |
ddc_extra_cxx_flags: '-Wextra-semi -Wold-style-cast' | |
kokkos_extra_cmake_flags: '' | |
cxx_version: ['17', '20', '23'] | |
cmake_build_type: ['Debug', 'Release'] | |
runs-on: macos-latest | |
needs: [id_repo] | |
steps: | |
- name: Checkout built branch | |
uses: actions/checkout@v4 | |
with: { submodules: true } | |
- name: Install fftw | |
run: brew install fftw | |
- name: Install lapack | |
run: brew install lapack | |
- name: Test | |
id: test | |
run: | | |
git config --global --add safe.directory '*' | |
export benchmark_ROOT=$PWD/opt/benchmark | |
export DDC_ROOT=$PWD/opt/ddc | |
export Ginkgo_ROOT=$PWD/opt/ginkgo | |
export GTest_ROOT=$PWD/opt/gtest | |
export Kokkos_ROOT=$PWD/opt/kokkos | |
export KokkosFFT_ROOT=$PWD/opt/kokkos-fft | |
export KokkosKernels_ROOT=$PWD/opt/kokkos-kernels | |
export PKG_CONFIG_PATH="/opt/homebrew/opt/lapack/lib/pkgconfig" | |
export LAPACKE_DIR="/opt/homebrew/opt/lapack" | |
export CMAKE_BUILD_PARALLEL_LEVEL=4 | |
export CMAKE_BUILD_TYPE=${{matrix.cmake_build_type}} | |
export CC=${{matrix.backend.c_compiler}} | |
export CXX=${{matrix.backend.cxx_compiler}} | |
git clone --branch v1.8.0 --depth 1 https://github.com/ginkgo-project/ginkgo.git | |
cmake \ | |
-DCMAKE_CXX_STANDARD=${{matrix.cxx_version}} \ | |
-DGINKGO_BUILD_BENCHMARKS=OFF \ | |
-DGINKGO_BUILD_EXAMPLES=OFF \ | |
-DGINKGO_BUILD_MPI=OFF \ | |
-DGINKGO_BUILD_REFERENCE=ON \ | |
-DGINKGO_BUILD_TESTS=OFF \ | |
-B build \ | |
-S ./ginkgo | |
cmake --build build | |
cmake --install build --prefix $Ginkgo_ROOT | |
rm -rf build | |
cmake \ | |
-DCMAKE_CXX_STANDARD=${{matrix.cxx_version}} \ | |
-DBENCHMARK_ENABLE_GTEST_TESTS=OFF \ | |
-DBENCHMARK_ENABLE_TESTING=OFF \ | |
-DBENCHMARK_INSTALL_DOCS=OFF \ | |
-DBENCHMARK_USE_BUNDLED_GTEST=OFF \ | |
-B build \ | |
-S ./vendor/benchmark | |
cmake --build build | |
cmake --install build --prefix $benchmark_ROOT | |
rm -rf build | |
cmake \ | |
-DCMAKE_CXX_STANDARD=${{matrix.cxx_version}} \ | |
-B build \ | |
-S ./vendor/googletest | |
cmake --build build | |
cmake --install build --prefix $GTest_ROOT | |
rm -rf build | |
cmake \ | |
-DCMAKE_CXX_STANDARD=${{matrix.cxx_version}} \ | |
-DKokkos_ENABLE_DEPRECATED_CODE_4=OFF \ | |
-DKokkos_ENABLE_DEPRECATION_WARNINGS=OFF \ | |
-DKokkos_ENABLE_SERIAL=ON \ | |
${{matrix.backend.kokkos_extra_cmake_flags}} \ | |
-B build \ | |
-S ./vendor/kokkos | |
cmake --build build | |
cmake --install build --prefix $Kokkos_ROOT | |
rm -rf build | |
cmake \ | |
-DCMAKE_CXX_STANDARD=${{matrix.cxx_version}} \ | |
-DKokkosFFT_ENABLE_HOST_AND_DEVICE=ON \ | |
-B build \ | |
-S ./vendor/kokkos-fft | |
cmake --build build | |
cmake --install build --prefix $KokkosFFT_ROOT | |
rm -rf build | |
cmake \ | |
-DCMAKE_CXX_STANDARD=${{matrix.cxx_version}} \ | |
-DKokkosKernels_ADD_DEFAULT_ETI=OFF \ | |
-DKokkosKernels_ENABLE_ALL_COMPONENTS=OFF \ | |
-DKokkosKernels_ENABLE_COMPONENT_BLAS=ON \ | |
-DKokkosKernels_ENABLE_COMPONENT_BATCHED=ON \ | |
-DKokkosKernels_ENABLE_COMPONENT_LAPACK=OFF \ | |
-DKokkosKernels_ENABLE_TPL_BLAS=OFF \ | |
-DKokkosKernels_ENABLE_TPL_CUSOLVER=OFF \ | |
-DKokkosKernels_ENABLE_TPL_LAPACK=OFF \ | |
-B build \ | |
-S ./vendor/kokkos-kernels | |
cmake --build build | |
cmake --install build --prefix $KokkosKernels_ROOT | |
rm -rf build | |
cmake \ | |
-DCMAKE_CXX_FLAGS="-Werror -Wall -Wextra -Wpedantic -Wno-sign-compare -pedantic-errors ${{matrix.backend.ddc_extra_cxx_flags}}" \ | |
-DCMAKE_CXX_STANDARD=${{matrix.cxx_version}} \ | |
-DDDC_BUILD_BENCHMARKS=ON \ | |
-DDDC_benchmark_DEPENDENCY_POLICY=INSTALLED \ | |
-DDDC_GTest_DEPENDENCY_POLICY=INSTALLED \ | |
-DDDC_Kokkos_DEPENDENCY_POLICY=INSTALLED \ | |
-DDDC_KokkosFFT_DEPENDENCY_POLICY=INSTALLED \ | |
-DDDC_BUILD_PDI_WRAPPER=OFF \ | |
-DBLA_PREFER_PKGCONFIG=ON \ | |
-B build | |
cmake --build build | |
ctest --test-dir build --output-on-failure --timeout 10 --output-junit tests.xml | |
./build/examples/characteristics_advection | |
./build/examples/game_of_life | |
./build/examples/heat_equation_spectral | |
./build/examples/heat_equation | |
./build/examples/non_uniform_heat_equation | |
./build/examples/uniform_heat_equation | |
cmake --install build --prefix $DDC_ROOT | |
rm -rf build | |
cmake \ | |
-B build \ | |
-S ./install_test | |
cmake --build build | |
- name: Publish Test Report | |
uses: mikepenz/action-junit-report@v5 | |
if: ( success() || failure() ) # always run even if the previous step fails | |
with: | |
report_paths: '/home/runner/work/ddc/ddc/tests.xml' |