Skip to content

Commit 1db717b

Browse files
authored
Merge pull request #3716 from lonvia/github-cache-osm2pgsql-binary
Github actions: cache compiled osm2pgsql binary For the tests on Ubunutu 22-04 we need to compile osm2pgsql because the version they ship is too old. This adds caching of the compiled binary, so that we don't need to recompile for each CI run. Together with the new BDD tests that shaves around 10 min off a CI run.
2 parents 63b0552 + b47c8cc commit 1db717b

File tree

1 file changed

+22
-11
lines changed

1 file changed

+22
-11
lines changed

.github/workflows/ci-tests.yml

Lines changed: 22 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -68,19 +68,30 @@ jobs:
6868
with:
6969
dependencies: ${{ matrix.dependencies }}
7070

71+
- uses: actions/cache@v4
72+
with:
73+
path: |
74+
/usr/local/bin/osm2pgsql
75+
key: osm2pgsql-bin-22-1
76+
if: matrix.ubuntu == '22'
77+
7178
- name: Compile osm2pgsql
7279
run: |
73-
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
74-
mkdir osm2pgsql-build
75-
cd osm2pgsql-build
76-
git clone https://github.com/osm2pgsql-dev/osm2pgsql
77-
mkdir build
78-
cd build
79-
cmake ../osm2pgsql
80-
make
81-
sudo make install
82-
cd ../..
83-
rm -rf osm2pgsql-build
80+
if [ ! -f /usr/local/bin/osm2pgsql ]; then
81+
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
82+
mkdir osm2pgsql-build
83+
cd osm2pgsql-build
84+
git clone https://github.com/osm2pgsql-dev/osm2pgsql
85+
mkdir build
86+
cd build
87+
cmake ../osm2pgsql
88+
make
89+
sudo make install
90+
cd ../..
91+
rm -rf osm2pgsql-build
92+
else
93+
sudo apt-get install -y -qq libexpat1 liblua${LUA_VERSION}
94+
fi
8495
if: matrix.ubuntu == '22'
8596
env:
8697
LUA_VERSION: ${{ matrix.lua }}

0 commit comments

Comments
 (0)