Skip to content

Commit 42c1728

Browse files
author
github-actions
committed
ci: Add libpostal caching to speed up CI builds
Cache the libpostal installation in ~/.local directory to avoid rebuilding from source on every workflow run. Only rebuilds when cache is invalidated (e.g., version change or cache miss).
1 parent e893225 commit 42c1728

1 file changed

Lines changed: 11 additions & 0 deletions

File tree

.github/workflows/tests.yml

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,15 @@ jobs:
3030
- name: Set up Python
3131
run: uv python install ${{ matrix.python-version }}
3232

33+
- name: Cache libpostal
34+
id: cache-libpostal
35+
uses: actions/cache@v4
36+
with:
37+
path: ~/.local
38+
key: libpostal-${{ runner.os }}-v1.0.0
39+
3340
- name: Install libpostal from source
41+
if: steps.cache-libpostal.outputs.cache-hit != 'true'
3442
run: |
3543
set -eux
3644
sudo apt-get update
@@ -41,6 +49,9 @@ jobs:
4149
./configure --prefix="$HOME/.local" --datadir="$HOME/.local/share/libpostal"
4250
make
4351
make install
52+
53+
- name: Setup libpostal environment
54+
run: |
4455
# Export paths so subsequent steps can find libpostal
4556
echo "LIBPOSTAL_DATA_DIR=$HOME/.local/share/libpostal" >> "$GITHUB_ENV"
4657
echo "LD_LIBRARY_PATH=$HOME/.local/lib:${LD_LIBRARY_PATH:-}" >> "$GITHUB_ENV"

0 commit comments

Comments
 (0)