From b47c8ccfb100488eff2a2353b4533b19d3b587f5 Mon Sep 17 00:00:00 2001 From: Sarah Hoffmann Date: Wed, 9 Apr 2025 20:12:15 +0200 Subject: [PATCH] actions: cache compiled osm2pgsql binary --- .github/workflows/ci-tests.yml | 33 ++++++++++++++++++++++----------- 1 file changed, 22 insertions(+), 11 deletions(-) diff --git a/.github/workflows/ci-tests.yml b/.github/workflows/ci-tests.yml index 4b7a7483..4d555416 100644 --- a/.github/workflows/ci-tests.yml +++ b/.github/workflows/ci-tests.yml @@ -68,19 +68,30 @@ jobs: with: dependencies: ${{ matrix.dependencies }} + - uses: actions/cache@v4 + with: + path: | + /usr/local/bin/osm2pgsql + key: osm2pgsql-bin-22-1 + if: matrix.ubuntu == '22' + - name: Compile osm2pgsql run: | - sudo apt-get install -y -qq libboost-system-dev libboost-filesystem-dev libexpat1-dev zlib1g-dev libbz2-dev libpq-dev libproj-dev libicu-dev liblua${LUA_VERSION}-dev lua-dkjson nlohmann-json3-dev - mkdir osm2pgsql-build - cd osm2pgsql-build - git clone https://github.com/osm2pgsql-dev/osm2pgsql - mkdir build - cd build - cmake ../osm2pgsql - make - sudo make install - cd ../.. - rm -rf osm2pgsql-build + if [ ! -f /usr/local/bin/osm2pgsql ]; then + sudo apt-get install -y -qq libboost-system-dev libboost-filesystem-dev libexpat1-dev zlib1g-dev libbz2-dev libpq-dev libproj-dev libicu-dev liblua${LUA_VERSION}-dev lua-dkjson nlohmann-json3-dev + mkdir osm2pgsql-build + cd osm2pgsql-build + git clone https://github.com/osm2pgsql-dev/osm2pgsql + mkdir build + cd build + cmake ../osm2pgsql + make + sudo make install + cd ../.. + rm -rf osm2pgsql-build + else + sudo apt-get install -y -qq libexpat1 liblua${LUA_VERSION} + fi if: matrix.ubuntu == '22' env: LUA_VERSION: ${{ matrix.lua }} -- 2.39.5