diff --git a/.github/workflows/build_and_test.yaml b/.github/workflows/build_and_test.yaml new file mode 100644 index 00000000..47b7fbb7 --- /dev/null +++ b/.github/workflows/build_and_test.yaml @@ -0,0 +1,108 @@ +name: Build and Test Metkit + +on: + pull_request: + workflow_dispatch: + push: + branches: + - "master" + - "develop" + tags-ignore: + - "**" + +jobs: + build: + strategy: + matrix: + runner: + - [self-hosted, platform-builder-debian-11] + - [self-hosted, platform-builder-ubuntu-22.04] + - [self-hosted, platform-builder-rocky-8.6] + - [self-hosted, platform-builder-fedora-37] + runs-on: ${{ matrix.runner }} + steps: + - name: Get specified recent CMake + run: | + CMAKE_VERSION=4.2.0 + CMAKE_ROOT="cmake-${CMAKE_VERSION}" + mkdir -p "${CMAKE_ROOT}" + curl -L "https://github.com/Kitware/CMake/releases/download/v${CMAKE_VERSION}/cmake-${CMAKE_VERSION}-linux-x86_64.tar.gz" -o cmake.tar.gz + tar -xzf cmake.tar.gz --strip-components=1 -C "${CMAKE_ROOT}" + echo "${CMAKE_ROOT}/bin" >> "$GITHUB_PATH" + - name: Get ecbuild + uses: actions/checkout@v5 + with: + repository: ecmwf/ecbuild + ref: develop + path: ecbuild + - name: Get cxx-dependencies + uses: actions/checkout@v5 + with: + repository: ecmwf/cxx-dependencies + ref: master + path: cxx-dependencies-src + token: ${{ secrets.GH_REPO_READ_TOKEN }} + submodules: recursive + - name: Install dependencies + run: | + mkdir cxx-dependencies-build + BUILD_PATH=cxx-dependencies-build INSTALL_PREFIX=dependencies cxx-dependencies-src/build.sh + - name: Get eccodes + uses: actions/checkout@v5 + with: + repository: ecmwf/eccodes + ref: develop + path: eccodes-src + - name: Install eccodes + run: | + mkdir eccodes-build + cmake \ + -B eccodes-build \ + -S eccodes-src \ + -DCMAKE_INSTALL_PREFIX=dependencies \ + -DCMAKE_PREFIX_PATH=dependencies \ + -DCMAKE_BUILD_TYPE=RelWithDebInfo \ + -DENABLE_MEMFS=ON \ + -DENABLE_AEC=ON + cmake --build eccodes-build -j -t install + - name: Get eckit + uses: actions/checkout@v5 + with: + repository: ecmwf/eckit + ref: develop + path: eckit-src + - name: Install eckit + run: | + mkdir eckit-build + cmake \ + -B eckit-build \ + -S eckit-src \ + -DCMAKE_INSTALL_PREFIX=dependencies \ + -DCMAKE_PREFIX_PATH=dependencies \ + -DCMAKE_BUILD_TYPE=RelWithDebInfo + cmake --build eckit-build -j -t install + - name: Get metkit + uses: actions/checkout@v5 + with: + path: metkit-src + - name: Build metkit + run: | + export PATH=$(pwd)/dependencies/bin:$PATH + mkdir metkit-build + cmake \ + -B metkit-build \ + -S metkit-src \ + -DCMAKE_INSTALL_PREFIX=dependencies \ + -DCMAKE_PREFIX_PATH=dependencies \ + -DCMAKE_BUILD_TYPE=RelWithDebInfo \ + -DENABLE_TOOLS=ON + cmake --build metkit-build -j -t install + cd metkit-build + ctest -j $(nproc) --output-on-failure + build-mars-client-bundle: + uses: ozaq/test-bundle/.github/workflows/build.yml@demo/ci + secrets: + GH_REPO_READ_TOKEN: ${{ secrets.GH_REPO_READ_TOKEN }} + with: + ref: ${{ github.ref }} +