diff --git a/.github/workflows/cmake.yml b/.github/workflows/ci.yml similarity index 56% rename from .github/workflows/cmake.yml rename to .github/workflows/ci.yml index afbc93bc9..5efe64b36 100644 --- a/.github/workflows/cmake.yml +++ b/.github/workflows/ci.yml @@ -1,4 +1,4 @@ -name: CMake +name: CI on: push: @@ -22,7 +22,7 @@ jobs: build: # Skip CI if PR is a draft if: github.event.pull_request.draft == false - name: ${{matrix.os}}-${{matrix.cxx}}-mpi:${{matrix.mpi}}-openmp:${{matrix.omp}} + name: build (${{matrix.os}}-${{matrix.cxx}}-mpi:${{matrix.mpi}}-openmp:${{matrix.omp}}) # The CMake configure and build commands are platform agnostic and should work equally # well on Windows or Mac. You can convert this to a matrix build if you need # cross-platform coverage. @@ -35,15 +35,13 @@ jobs: fail-fast: false matrix: os: - - ubuntu-20.04 + - ubuntu-22.04 - macos-14 cc: - - gcc-10 - - gcc-11 + - gcc-12 - clang cxx: - - g++-10 - - g++-11 + - g++-12 - clang++ mpi: - "ON" @@ -52,32 +50,16 @@ jobs: - "ON" - "OFF" exclude: - - cc: gcc-11 - cxx: clang++ - - cc: clang - cxx: g++-11 - - cc: gcc-10 - cxx: clang++ - - cc: clang - cxx: g++-10 - - os: ubuntu-20.04 + - os: ubuntu-22.04 cc: clang + - os: ubuntu-22.04 cxx: clang++ - os: macos-14 - cxx: g++-10 - - os: macos-14 - cc: gcc-10 - - os: ubuntu-20.04 - cxx: g++-11 - - os: ubuntu-20.04 - cc: gcc-11 + cc: gcc-12 - os: macos-14 - mpi: "on" + cxx: g++-12 - os: macos-14 - cxx: g++-11 - - cxx: clang++ - omp: "on" - + mpi: "ON" steps: - uses: actions/checkout@v4 @@ -93,7 +75,7 @@ jobs: shell: bash run: echo "CCACHE_DIR=${{runner.workspace}}/.ccache" >> "${GITHUB_ENV}" - name: Cache ccache files - uses: actions/cache@v3 + uses: actions/cache@v4 with: path: ${{runner.workspace}}/.ccache key: ${{matrix.os}}-${{matrix.cxx}}-${{matrix.mpi}}-${{matrix.omp}}-${{ steps.ccache_cache_timestamp.outputs.date_and_time }} @@ -110,12 +92,12 @@ jobs: if: ${{ contains(matrix.os, 'ubuntu') }} run: | sudo apt update - sudo apt install openmpi-bin libopenmpi-dev ccache graphviz libeigen3-dev libspdlog-dev libtiff-dev libcfitsio-dev libbenchmark-dev libboost-all-dev libyaml-cpp-dev + sudo apt install openmpi-bin libopenmpi-dev libyaml-cpp-dev libeigen3-dev libtiff-dev ccache - name: Install Dependencies on MacOS if: ${{ contains(matrix.os, 'macos') }} run: | - brew install gcc libtiff open-mpi libomp eigen libyaml ccache cfitsio boost yaml-cpp + brew install open-mpi libomp yaml-cpp eigen cfitsio ccache echo "CMAKE_PREFIX_PATH=/opt/homebrew/opt/libomp" >> $GITHUB_ENV echo "/opt/homebrew/opt/ccache/libexec" >> $GITHUB_PATH @@ -157,13 +139,77 @@ jobs: cmake .. --fresh -DCMAKE_INSTALL_PREFIX=${{github.workspace}}/local -Ddompi=${{matrix.mpi}} -Dopenmp=${{matrix.omp}} -Dtests=OFF -Dexamples=OFF make -j$(nproc --ignore 1) install - - name: Install + - uses: actions/upload-artifact@v4 + with: + name: dependencies-${{ matrix.os }}-${{ matrix.cxx }}-${{ matrix.mpi }}-${{ matrix.omp }} + path: ${{github.workspace}}/local + + + test: + needs: + build + name: test (${{matrix.os}}-${{matrix.cxx}}-mpi:${{matrix.mpi}}-openmp:${{matrix.omp}}) + runs-on: ${{matrix.os}} + env: + CC: ${{ matrix.cc }} + CXX: ${{ matrix.cxx }} + strategy: + fail-fast: false + matrix: + os: + - ubuntu-22.04 + - macos-14 + cc: + - gcc-12 + - clang + cxx: + - g++-12 + - clang++ + mpi: + - "ON" + - "OFF" + omp: + - "ON" + - "OFF" + exclude: + - os: ubuntu-22.04 + cc: clang + - os: ubuntu-22.04 + cxx: clang++ + - os: macos-14 + cc: gcc-12 + - os: macos-14 + cxx: g++-12 + - os: macos-14 + mpi: "ON" + steps: + - uses: actions/checkout@v4 + + - uses: actions/download-artifact@v4 + with: + name: dependencies-${{ matrix.os }}-${{ matrix.cxx }}-${{ matrix.mpi }}-${{ matrix.omp }} + path: ${{github.workspace}}/local + + - name: Install Dependencies on Ubunutu + if: ${{ contains(matrix.os, 'ubuntu') }} + run: | + sudo apt update + sudo apt install openmpi-bin libopenmpi-dev ccache graphviz libeigen3-dev libtiff-dev libcfitsio-dev libboost-all-dev libyaml-cpp-dev + + - name: Install Dependencies on MacOS + if: ${{ contains(matrix.os, 'macos') }} + run: | + brew install open-mpi libomp eigen ccache cfitsio boost yaml-cpp + echo "CMAKE_PREFIX_PATH=/opt/homebrew/opt/libomp" >> $GITHUB_ENV + echo "/opt/homebrew/opt/ccache/libexec" >> $GITHUB_PATH + + - name: Build tests # Build your program with the given configuration run: | export CMAKE_PREFIX_PATH=${{github.workspace}}/local:$CMAKE_PREFIX_PATH mkdir -p ${{github.workspace}}/build cd ${{github.workspace}}/build - cmake .. --fresh -DCMAKE_INSTALL_PREFIX=${{github.workspace}}/local -Ddocasa=OFF -Ddompi=${{matrix.mpi}} -Dopenmp=${{matrix.omp}} + cmake .. --fresh -DCMAKE_INSTALL_PREFIX=${{github.workspace}}/local -Ddocasa=OFF -Ddompi=${{matrix.mpi}} -Dopenmp=${{matrix.omp}} -Dtests=ON make -j$(nproc --ignore 1) install - name: Test @@ -173,3 +219,60 @@ jobs: run: | export LD_LIBRARY_PATH=${{github.workspace}}/local/lib:${{github.workspace}}/local/external/lib:${LD_LIBRARY_PATH} ctest -C ${{env.BUILD_TYPE}} --output-on-failure + + doc: + needs: + build + name: doc (${{matrix.os}}-${{matrix.cxx}}-mpi:${{matrix.mpi}}-openmp:${{matrix.omp}}) + runs-on: ${{matrix.os}} + env: + CC: ${{ matrix.cc }} + CXX: ${{ matrix.cxx }} + strategy: + fail-fast: false + matrix: + os: + - ubuntu-22.04 + cc: + - gcc-12 + cxx: + - g++-12 + mpi: + - "OFF" + omp: + - "OFF" + steps: + - uses: actions/checkout@v4 + + - uses: actions/download-artifact@v4 + with: + name: dependencies-${{ matrix.os }}-${{ matrix.cxx }}-${{ matrix.mpi }}-${{ matrix.omp }} + path: ${{github.workspace}}/local + + - name: Install Dependencies on Ubunutu + if: ${{ contains(matrix.os, 'ubuntu') }} + run: | + sudo apt update + sudo apt install ccache doxygen graphviz libeigen3-dev libtiff-dev libcfitsio-dev libboost-all-dev libyaml-cpp-dev + + - name: Install Dependencies on MacOS + if: ${{ contains(matrix.os, 'macos') }} + run: | + brew install gcc libtiff eigen libyaml ccache cfitsio boost yaml-cpp + echo "CMAKE_PREFIX_PATH=/opt/homebrew/opt/libomp" >> $GITHUB_ENV + echo "/opt/homebrew/opt/ccache/libexec" >> $GITHUB_PATH + + - name: Build docs + run: | + export CMAKE_PREFIX_PATH=${{github.workspace}}/local:$CMAKE_PREFIX_PATH + mkdir -p ${{github.workspace}}/build + cd ${{github.workspace}}/build + cmake .. --fresh -DCMAKE_INSTALL_PREFIX=${{github.workspace}}/local -Ddompi=OFF -Dopenmp=OFF -Ddocs=ON + make -j$(nproc --ignore 1) install + + - name: Deploy to GH pages + if: ${{github.event_name == 'push'}} + uses: JamesIves/github-pages-deploy-action@4.1.6 + with: + branch: gh-pages # The branch the action should deploy to. + folder: build/cpp/docs/html # The folder the action should deploy. diff --git a/.github/workflows/documentation.yml b/.github/workflows/documentation.yml deleted file mode 100644 index 259e25345..000000000 --- a/.github/workflows/documentation.yml +++ /dev/null @@ -1,78 +0,0 @@ -name: Documentation - -on: - push: - branches: [ development ] - pull_request: - branches: [ development ] - if: github.event.pull_request.draft == false - -jobs: - make-documentation: - runs-on: ubuntu-20.04 - steps: - - - name: Check out Purify - uses: actions/checkout@v3 - #with: - # submodules: recursive - - - name: Install dependencies - run: | - sudo apt update - sudo apt install openmpi-bin libopenmpi-dev ccache casacore-dev doxygen graphviz libeigen3-dev libspdlog-dev libtiff-dev libcfitsio-dev libbenchmark-dev libboost-all-dev libyaml-cpp-dev - wget --no-check-certificate --no-verbose http://www.fftw.org/fftw-3.3.10.tar.gz -O- | tar --no-same-owner -xz; - - - name: Checkout Catch2 - uses: actions/checkout@v4 - with: - repository: catchorg/Catch2.git - path: Catch2 - ref: v3.4.0 - - - name: Build Catch2 - run: | - mkdir Catch2/build - cd Catch2/build - cmake .. -DBUILD_TESTING=OFF -DCMAKE_INSTALL_PREFIX=${{github.workspace}}/local - make -j$(nproc --ignore 1) install - - - name: Install FFTW - run: | - wget --no-check-certificate --no-verbose http://www.fftw.org/fftw-3.3.10.tar.gz -O- | tar --no-same-owner -xz; - cd fftw-3.3.10 - ./configure --prefix=${{github.workspace}}/local --enable-shared - make -j$(nproc --ignore 1) install CFLAGS=-fPIC - # Fix bug in FFT3 (cf. https://github.com/FFTW/fftw3/issues/332) - sed -i -e 's/^.*FFTW3LibraryDepends.cmake.*$//1' ${{github.workspace}}/local/lib*/cmake/*/FFTW3Config.cmake - - - name: Checkout SOPT - uses: actions/checkout@v3 - with: - repository: astro-informatics/sopt.git - path: sopt - ref: development - - - name: Create SOPT package - run : | - export CMAKE_PREFIX_PATH=${{github.workspace}}/local:$CMAKE_PREFIX_PATH - mkdir sopt/build - cd sopt/build - cmake .. --fresh -DCMAKE_INSTALL_PREFIX=${{github.workspace}}/local -Ddocasa=OFF -Ddompi=OFF -Dopenmp=OFF -Ddocs=OFF -Dtests=OFF -Dexamples=OFF - make -j$(nproc --ignore 1) install - - - name: Configure - run: | - export CMAKE_PREFIX_PATH=${{github.workspace}}/local:$CMAKE_PREFIX_PATH - mkdir -p ${{github.workspace}}/build - cd ${{github.workspace}}/build - cmake .. --fresh -DCMAKE_INSTALL_PREFIX=${{github.workspace}}/local -Ddompi=OFF -Dopenmp=OFF -Ddocs=ON - make -j$(nproc --ignore 1) install - - - name: Deploy to GH pages - if: ${{github.event_name == 'push'}} - uses: JamesIves/github-pages-deploy-action@4.1.6 - with: - branch: gh-pages # The branch the action should deploy to. - folder: build/cpp/docs/html # The folder the action should deploy. - diff --git a/.github/workflows/linting.yml b/.github/workflows/linting.yml index 21546a4af..5555e8d2a 100644 --- a/.github/workflows/linting.yml +++ b/.github/workflows/linting.yml @@ -9,14 +9,14 @@ on: jobs: linting: - runs-on: ubuntu-20.04 + runs-on: ubuntu-22.04 steps: - name: Checkout repo - uses: actions/checkout@v3 + uses: actions/checkout@v4 # Check code meets Google C++ style guide https://google.github.io/styleguide/cppguide.html - name: Run linting - uses: DoozyX/clang-format-lint-action@v0.16.2 + uses: DoozyX/clang-format-lint-action@v0.18.2 with: source: '.' extensions: 'h,cc'