Fix osmium tool build #28
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Build for Ubuntu | |
| # manually triggered workflow | |
| on: | |
| workflow_dispatch: | |
| push: | |
| pull_request: | |
| concurrency: | |
| group: ${{ github.workflow }}-${{ github.ref }} | |
| cancel-in-progress: true | |
| permissions: | |
| contents: read | |
| jobs: | |
| build: | |
| name: Ubuntu psql | |
| runs-on: ${{ matrix.os }} | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| psql: [13, 14, 15, 16, 17, 18] | |
| postgis: [3] | |
| release: [Debug, Release] | |
| os: [ubuntu-latest, ubuntu-22.04] | |
| compiler: [ gcc-latest, g++-11, clang ] | |
| include: | |
| - os: ubuntu-latest | |
| pqxx: '7.8' # 7.8t64 | |
| - os: ubuntu-22.04 | |
| pqxx: '6.4' | |
| steps: | |
| - uses: actions/checkout@v5 | |
| - name: 'Raise Priority for apt.postgresql.org' | |
| run: | | |
| cat << EOF >> ./pgdg.pref | |
| Package: * | |
| Pin: release o=apt.postgresql.org | |
| Pin-Priority: 600 | |
| EOF | |
| sudo mv ./pgdg.pref /etc/apt/preferences.d/ | |
| sudo apt update | |
| - name: Add PostgreSQL APT repository | |
| run: | | |
| sudo apt-get -y purge postgresql-* | |
| sudo sh -c 'echo "deb http://apt.postgresql.org/pub/repos/apt $(lsb_release -cs)-pgdg-testing main ${{ matrix.psql }}" > /etc/apt/sources.list.d/pgdg.list' | |
| curl https://www.postgresql.org/media/keys/ACCC4CF8.asc | gpg --dearmor | sudo tee /etc/apt/trusted.gpg.d/apt.postgresql.org.gpg >/dev/null | |
| - name: Install compiler | |
| id: install_cc | |
| uses: rlalik/setup-cpp-compiler@master | |
| with: | |
| compiler: ${{ matrix.compiler }} | |
| - name: Install dependencies | |
| run: | | |
| sudo apt-get update | |
| sudo apt-get install -y \ | |
| libboost-program-options-dev \ | |
| libtap-parser-sourcehandler-pgtap-perl \ | |
| postgresql-${{ matrix.psql }} \ | |
| postgresql-${{ matrix.psql }}-pgtap \ | |
| postgresql-${{ matrix.psql }}-postgis-${{ matrix.postgis }} \ | |
| postgresql-${{ matrix.psql }}-postgis-${{ matrix.postgis }}-scripts \ | |
| postgresql-${{ matrix.psql }}-pgrouting \ | |
| libpqxx-dev \ | |
| libpqxx-${{ matrix.pqxx }} \ | |
| libexpat1 \ | |
| libexpat-dev \ | |
| libosmium2-dev \ | |
| zlib1g-dev \ | |
| postgresql-server-dev-${{ matrix.psql }} | |
| # should be 7 on latest and 6 on 22.04 | |
| apt-cache policy libpqxx-dev | |
| - name: Configure compiler | |
| run: | | |
| export CC=/usr/bin/${{ steps.install_cc.outputs.cc }} | |
| export CXX=/usr/bin/${{ steps.install_cc.outputs.cxx }} | |
| export PATH=/usr/lib/postgresql/${{ matrix.psql }}/bin:$PATH | |
| mkdir build | |
| cd build | |
| cmake -DCMAKE_BUILD_TYPE=${{ matrix.release }} .. | |
| # Build osmium tool | |
| cd ../tools/osmium | |
| mkdir build | |
| cd build | |
| cmake -DCMAKE_BUILD_TYPE=${{ matrix.release }} .. | |
| - name: Build | |
| run: | | |
| cd build | |
| make -j 4 | |
| sudo make install | |
| # Build osmium tool | |
| cd ../tools/osmium/build | |
| make -j 4 | |
| sudo make install |