Skip to content

Commit

Permalink
Merge pull request #183 from leonardehrenfried/caching
Browse files Browse the repository at this point in the history
Add caching to OTP build process
  • Loading branch information
dulvui authored Mar 25, 2024
2 parents b2b7fce + 7cbb6f2 commit 2e079c7
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 2 deletions.
10 changes: 9 additions & 1 deletion .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ jobs:

steps:
- name: Checkout source code
uses: actions/checkout@v2
uses: actions/checkout@v4

- name: Create .env file
uses: noi-techpark/github-actions/env-file@v2
Expand Down Expand Up @@ -104,6 +104,14 @@ jobs:
- name: use mobility.api.opendatahub.testingmachine.eu for testing
run: sed -i 's/mobility.api.opendatahub.com/mobility.api.opendatahub.testingmachine.eu/' */config.yml

- name: Cache OSM and elevation data
uses: actions/cache@v4
with:
path: |
data/italy-nord-est.osm.pbf
data/srtm*
key: input-data

- name: Build graph
run: sh build-graph.sh

Expand Down
5 changes: 4 additions & 1 deletion build-graph.sh
Original file line number Diff line number Diff line change
Expand Up @@ -19,13 +19,16 @@ OTP_IMAGE=docker.io/opentripplanner/opentripplanner:2.5.0_2024-01-19T14-50

# when on github actions then install the required tools
if [ -n "${CI+isset}" ]; then
sudo apt-get -qq install osmium-tool wget
sudo apt-get -qq install osmium-tool pyosmium wget
fi

mkdir -p data

if [ ! -f "${NORTH_EAST_PBF}" ]; then
${WGET} ${NORTH_EAST_URL} -O ${NORTH_EAST_PBF}
else
echo "Checking for updates for existing OSM file"
pyosmium-up-to-date ${NORTH_EAST_PBF}
fi

# cut out South Tyrol from the large North East Italy extract
Expand Down

0 comments on commit 2e079c7

Please sign in to comment.