Skip to content

checks: Update pre-commit config and tools versions #4047

checks: Update pre-commit config and tools versions

checks: Update pre-commit config and tools versions #4047

Workflow file for this run

---
name: CMake
on:
push:
paths-ignore:
- "doc/**"
branches:
- main
- releasebranch_*
pull_request:
paths-ignore:
- "doc/**"
concurrency:
group: ${{ github.workflow }}-${{ github.event_name == 'pull_request' && github.head_ref || github.sha }}
cancel-in-progress: true
env:
CMAKE_UNITY_BUILD: OFF
permissions:
contents: read
jobs:
build-cmake:
runs-on: ubuntu-24.04
env:
CMAKE_VERSION: "3.22.0"
steps:
- name: Checkout GRASS
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
with:
persist-credentials: false
- name: Install CMake
run: |
cd "${GITHUB_WORKSPACE}" || exit
arch="$(echo "$(uname -s)"-"$(uname -m)" | awk '{print tolower($0)}')"
v="v${CMAKE_VERSION}/cmake-${CMAKE_VERSION}-${arch}.tar.gz"
wget "https://github.com/Kitware/CMake/releases/download/$v"
tar xzf "cmake-${CMAKE_VERSION}-${arch}.tar.gz"
echo "CMAKE_DIR=${GITHUB_WORKSPACE}/cmake-${CMAKE_VERSION}-${arch}/bin" >> "${GITHUB_ENV}"
echo "${GITHUB_WORKSPACE}/cmake-${CMAKE_VERSION}-${arch}/bin" >> "${GITHUB_PATH}"
- run: |
cmake --version
- name: Install dependencies
run: |
sudo apt-get update -y
sudo apt-get install -y wget git gawk findutils ninja-build libpq-dev \
gettext unixodbc-dev libnetcdf-dev
LC_ALL=C.UTF-8 sudo add-apt-repository -y ppa:ubuntugis/ubuntugis-unstable
sudo apt-get update -y
xargs -a <(awk '! /^ *(#|$)/' ".github/workflows/apt.txt") -r -- \
sudo apt-get install -y --no-install-recommends --no-install-suggests
- name: Print build environment variables
shell: bash -el {0}
run: |
printenv | sort
gcc --version
ldd --version
- name: Create installation directory
run: |
mkdir "${HOME}/install"
- name: Configure
run: |
cmake -S "${GITHUB_WORKSPACE}" -B "${GITHUB_WORKSPACE}/build" -G Ninja \
-DCMAKE_INSTALL_PREFIX="${HOME}/install" -DWITH_NLS=ON -DWITH_GUI=OFF -DWITH_DOCS=OFF \
-DWITH_READLINE=ON -DWITH_ODBC=ON -DWITH_NETCDF=ON -DWITH_BZLIB=ON
- name: Print CMakeCache.txt
shell: bash -el {0}
run: |
cat "${GITHUB_WORKSPACE}/build/CMakeCache.txt"
- name: Build
run: |
cmake --build build --verbose -j"$(nproc)"
- name: Install
run: |
cmake --install "${GITHUB_WORKSPACE}/build" --verbose
- name: Add the bin directory to PATH
run: |
echo "${HOME}/install/bin" >> "${GITHUB_PATH}"
- name: Print installed versions
if: always()
run: .github/workflows/print_versions.sh
- name: Test executing of the grass command
run: .github/workflows/test_simple.sh
- name: Run tests
run: .github/workflows/test_thorough.sh --config .gunittest.cfg --min-success 98
- name: Make HTML test report available
if: ${{ !cancelled() }}
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
with:
name: testreport-CMake
path: testreport
retention-days: 3