diff --git a/.github/workflows/conda-style-builds.yml b/.github/workflows/conda-style-builds.yml new file mode 100644 index 000000000..48b43b78b --- /dev/null +++ b/.github/workflows/conda-style-builds.yml @@ -0,0 +1,84 @@ +name: Conda-compatible builds + +on: + push: + branches: + - main + pull_request: + workflow_dispatch: + +defaults: + run: + # Enable Conda environment by using the login shell: + shell: bash -leo pipefail {0} + +jobs: + CI: + strategy: + fail-fast: false + matrix: + os: [ubuntu-24.04, macos-13, macos-latest, windows-2022] + build-type: [RelWithDebugInfo] + env: + FC: gfortran + CMAKE_BUILD_PARALLEL_LEVEL: 8 + VERBOSE: + CTEST_PARALLEL_LEVEL: 8 + CTEST_OUTPUT_ON_FAILURE: 1 + runs-on: ${{ matrix.os }} + steps: + # + # Check out repository under $GITHUB_WORKSPACE + # + - name: Check out code + uses: actions/checkout@v4 + # + # Cache Conda packages + # + - name: Cache Conda packages + uses: actions/cache@v4 + with: + path: ~/conda_pkgs_dir + key: conda-pkgs-${{ matrix.os }} + # + # Set up Conda + # + - name: Set up Conda (testing scripts only) + uses: conda-incubator/setup-miniconda@v3 + with: + miniforge-version: latest + activate-environment: rte_rrtmgp_test + environment-file: environment-noplots.yml + python-version: 3.11 + auto-activate-base: false + conda-remove-defaults: true + # Use the cache properly: + use-only-tar-bz2: false + # + # Install compiler and dependencies + # + - name: Install compiler, dependencies + run: | + conda install -c conda-forge "${FC}" netcdf-fortran ninja -y + # + # Adjust toolchain + # + - name: Adjust Windows toolchain + if: matrix.os == 'windows-2022' + run: echo "FC=${FC}.exe" >> "$GITHUB_ENV" + # + # Build libraries, examples, and tests + # + - name: Build libraries and tests + run: | + cmake -S . -B build -G "Ninja" \ + -DCMAKE_BUILD_TYPE=${{ matrix.build-type}} \ + -DRTE_ENABLE_SP=OFF \ + -DBUILD_TESTING=ON + cmake --build build + # + # Run examples, tests and checks + # + - name: Run examples, tests and checks + working-directory: build + run: ctest diff --git a/.github/workflows/continuous-integration.yml b/.github/workflows/continuous-integration.yml index 6df7f2a79..ae0f0a395 100644 --- a/.github/workflows/continuous-integration.yml +++ b/.github/workflows/continuous-integration.yml @@ -9,120 +9,46 @@ on: defaults: run: - # Enable Conda environment by using the login shell: - shell: bash -leo pipefail {0} + shell: bash -eo pipefail {0} jobs: CI: strategy: fail-fast: false matrix: - os: [ubuntu-24.04, macos-13, macos-latest, windows-2022] - gfortran-version: [12, 13, 14] - gfortran-from: [system, conda] + rte-kernels: [default, accel] fpmodel: [DP, SP] - exclude: - - os: ubuntu-24.04 - gfortran-from: conda - - os: macos-13 - gfortran-from: system - - os: macos-13 - gfortran-version: 14 - gfortran-from: conda - - os: macos-latest - gfortran-from: system - - os: macos-latest - gfortran-version: 14 - gfortran-from: conda - - os: windows-2022 - include: - - os: ubuntu-24.04 - gfortran-version: 13 - gfortran-from: conda - fpmodel: DP - - os: windows-2022 - gfortran-version: 13 - gfortran-from: conda - fpmodel: DP - - os: windows-2022 - gfortran-version: 13 - gfortran-from: conda - fpmodel: SP - - os: windows-2022 - gfortran-version: 14 - gfortran-from: conda - fpmodel: DP - - os: windows-2022 - gfortran-version: 14 - gfortran-from: conda - fpmodel: SP + env: - FC: gfortran-${{ matrix.gfortran-version }} - FFLAGS: "-m64 -std=f2008 -march=native -fbounds-check -fmodule-private -fimplicit-none -finit-real=nan" + FFLAGS: -std=f2008 -fbounds-check -fmodule-private -fimplicit-none -finit-real=nan CMAKE_BUILD_PARALLEL_LEVEL: 8 VERBOSE: CTEST_PARALLEL_LEVEL: 8 CTEST_OUTPUT_ON_FAILURE: 1 - runs-on: ${{ matrix.os }} + runs-on: ubuntu-24.04 steps: - # - # Check out repository under $GITHUB_WORKSPACE - # - - name: Check out code + - name: Check out uses: actions/checkout@v4 - # - # Cache Conda packages - # - - name: Cache Conda packages - uses: actions/cache@v4 - with: - path: ~/conda_pkgs_dir - key: conda-pkgs-${{ matrix.os }} - # - # Set up Conda - # - - name: Set up Conda - uses: conda-incubator/setup-miniconda@v3 - with: - miniforge-version: latest - activate-environment: rte_rrtmgp_test - environment-file: environment-noplots.yml - python-version: 3.11 - auto-activate-base: false - # Use the cache properly: - use-only-tar-bz2: false - # - # Install compiler - # - - name: Install compiler - if: matrix.gfortran-from == 'conda' - run: | - conda install -c conda-forge gfortran=${{ matrix.gfortran-version }} -y - echo "FC=gfortran" >> "$GITHUB_ENV" - # - # Install dependencies - # - name: Install dependencies - run: conda install -c conda-forge netcdf-fortran ninja -y - # - # Adjust toolchain - # - - name: Adjust toolchain - if: matrix.os == 'windows-2022' - run: echo "FC=${FC}.exe" >> "$GITHUB_ENV" - # - # Build libraries, examples, and tests - # - - name: Build libraries and tests run: | - cmake -S . -B build -G "Ninja" \ - -DCMAKE_BUILD_TYPE=RelWithDebInfo \ + sudo apt-get update + sudo apt-get install --no-install-recommends --assume-yes \ + libnetcdff-dev \ + python3-dask \ + python3-h5netcdf \ + python3-numpy \ + python3-scipy \ + python3-xarray + - name: Configure + run: | + cmake -S . -B build \ + -DCMAKE_BUILD_TYPE=RelWithDebugInfo \ -DRTE_ENABLE_SP="$(test '${{ matrix.fpmodel }}' = SP && echo ON || echo OFF)" \ + -DKERNEL_MODE=${{ matrix.rte-kernels }} \ -DBUILD_TESTING=ON - cmake --build build - # - # Run examples, tests and checks - # - - name: Run examples, tests and checks - working-directory: build - run: ctest + - name: Build + run: cmake --build build + - name: Test + run: ctest --test-dir build + - name: Install + run: sudo cmake --install build diff --git a/.github/workflows/doc-deployment.yml b/.github/workflows/doc-deployment.yml index c93af1ade..08a8a1bf6 100644 --- a/.github/workflows/doc-deployment.yml +++ b/.github/workflows/doc-deployment.yml @@ -71,7 +71,7 @@ jobs: # Deploy documentation # - name: Deploy API Documentation - uses: JamesIves/github-pages-deploy-action@v4.7.2 + uses: JamesIves/github-pages-deploy-action@v4.7.3 if: ${{ github.event_name == 'push' && github.ref == 'refs/heads/main' }} with: branch: gh-pages diff --git a/.github/workflows/style.yml b/.github/workflows/style.yml index 009caf06a..d15cfd3f7 100644 --- a/.github/workflows/style.yml +++ b/.github/workflows/style.yml @@ -8,7 +8,7 @@ on: jobs: pre-commit: - runs-on: ubuntu-22.04 + runs-on: ubuntu-latest steps: - name: Check out code uses: actions/checkout@v4 diff --git a/rte-kernels/CMakeLists.txt b/rte-kernels/CMakeLists.txt index a66c38c6f..832415e12 100644 --- a/rte-kernels/CMakeLists.txt +++ b/rte-kernels/CMakeLists.txt @@ -38,14 +38,7 @@ if(BUILD_SHARED_LIBS) endif() target_compile_definitions( - rtekernels - PRIVATE $<$:RTE_USE_SP> - rtekernels - $<$:RTE_BOOL> - rtekernels - $<$:RTE_PRECISION> - rtekernels - $<$:RTE_EPSILON> + rtekernels PRIVATE $<$:RTE_USE_SP> ) target_include_directories(rtekernels PRIVATE ${CMAKE_Fortran_MODULE_DIRECTORY})