Skip to content

Commit

Permalink
Merge pull request #80 from HuidaeCho/cmake_build_work
Browse files Browse the repository at this point in the history
Cmake build work
  • Loading branch information
echoix authored Apr 22, 2024
2 parents 9c86360 + ce96fca commit 6ce539d
Show file tree
Hide file tree
Showing 150 changed files with 7,601 additions and 82 deletions.
89 changes: 89 additions & 0 deletions .github/workflows/cmake.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,89 @@
# inspired by "build GDAL library and to run test with CMake"
# from https://github.com/OSGeo/gdal/blob/master/.github/workflows/cmake_builds.yml

---
name: CMake

on:
push:
paths-ignore:
- 'doc/**'
branches-ignore:
- 'backport**'
pull_request:
paths-ignore:
- 'doc/**'

concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.ref }}
cancel-in-progress: true

env:
CMAKE_UNITY_BUILD: OFF

permissions:
contents: read # to fetch code (actions/checkout)

jobs:

build-cmake:
runs-on: ubuntu-20.04
env:
CMAKE_OPTIONS: -DPython_LOOKUP_VERSION=3.8 -DUSE_CCACHE=ON
cache-name: cmake-ubuntu-20.04
steps:
- name: Checkout GRASS
uses: actions/checkout@v4.1.1
- name: Setup cache
uses: actions/cache@v4.0.2
id: cache
with:
path: ${{ github.workspace }}/.ccache
key: "${{ env.cache-name }}-${{ runner.os }}-${{ github.base_ref }}\
${{ github.ref_name }}-${{ github.run_id }}"
restore-keys: |
${{ env.cache-name }}-${{ runner.os }}-${{ github.base_ref }}
${{ env.cache-name }}-${{ runner.os }}
- name: Install CMake 3.16.0
run: |
cd ${GITHUB_WORKSPACE}
wget https://github.com/Kitware/CMake/releases/download/v3.16.0/cmake-3.16.0-Linux-x86_64.tar.gz
tar xzf cmake-3.16.0-Linux-x86_64.tar.gz
echo "CMAKE_DIR=$GITHUB_WORKSPACE/cmake-3.16.0-Linux-x86_64/bin" >> $GITHUB_ENV
echo "$GITHUB_WORKSPACE/cmake-3.16.0-Linux-x86_64/bin" >> $GITHUB_PATH
- run: |
cmake --version
- name: Install dependencies
run: |
sudo add-apt-repository -y ppa:ubuntugis/ubuntugis-unstable
sudo apt-get update
sudo apt-get install -y -q build-essential \
flex make bison gcc libgcc1 g++ ccache \
python3 python3-dev \
python3-opengl python3-wxgtk4.0 \
python3-dateutil libgsl-dev python3-numpy \
wx3.0-headers wx-common libwxgtk3.0-gtk3-dev \
libwxbase3.0-dev libbz2-dev zlib1g-dev gettext \
libtiff5-dev libpnglite-dev libcairo2 libcairo2-dev \
sqlite3 libsqlite3-dev \
libpq-dev libreadline6-dev libfreetype6-dev \
libfftw3-3 libfftw3-dev \
libboost-thread-dev libboost-program-options-dev libpdal-dev\
subversion libzstd-dev checkinstall \
libglu1-mesa-dev libxmu-dev \
ghostscript wget -y make ccache g++
- name: Configure ccache
run: |
echo CCACHE_BASEDIR=$PWD >> ${GITHUB_ENV}
echo CCACHE_DIR=$PWD/.ccache >> ${GITHUB_ENV}
echo CCACHE_MAXSIZE=250M >> ${GITHUB_ENV}
ccache -z
working-directory: ${{ github.workspace }}
- name: Configure
run: |
cmake ${CMAKE_OPTIONS} -S $GITHUB_WORKSPACE -B $GITHUB_WORKSPACE/build
- name: Build
run: |
cmake --build $GITHUB_WORKSPACE/build --verbose -j$(nproc)
- name: ccache statistics
run: ccache -s
2 changes: 1 addition & 1 deletion .github/workflows/python-code-quality.yml
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@ jobs:
export PYTHONPATH=`grass --config python_path`:$PYTHONPATH
export LD_LIBRARY_PATH=$HOME/install/grass84/lib:$LD_LIBRARY_PATH
cd gui/wxpython
pylint --persistent=no --py-version=${{ matrix.min-python-version }} --jobs=$(nproc) *
pylint --persistent=no --py-version=${{ matrix.min-python-version }} --jobs=$(nproc) --ignore=CMakeLists.txt *
- name: Run Pylint on other files using pytest
run: |
Expand Down
6 changes: 6 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ OBJ.*
locale/scriptstrings/*
bin.*/*
dist.*/*
.vs/*
CMakeSettings.json
config.log
config.status*
error.log
Expand Down Expand Up @@ -50,6 +52,7 @@ test_keyvalue_result.txt

# ignore paths generated by helper tools
node_modules

include/VERSION_GIT

# ignore autogenerated documentation
Expand All @@ -58,3 +61,6 @@ html/
latex/
lib/*/html/
lib/*/latex/

# ignore cmake build directory
build
Loading

0 comments on commit 6ce539d

Please sign in to comment.