action: cache downloaded dependencies

This commit is contained in:
Sarah Hoffmann
2020-10-28 11:54:37 +01:00
parent bd04c49bc1
commit 4147e04319
3 changed files with 52 additions and 20 deletions

View File

@@ -4,22 +4,25 @@ runs:
using: "composite" using: "composite"
steps: steps:
- name: Install prerequisits - name: Install prerequisits
run: sudo apt-get install -y -qq libboost-system-dev libboost-filesystem-dev libexpat1-dev zlib1g-dev libbz2-dev libpq-dev libproj-dev python3-psycopg2 python3-pyosmium run: sudo apt-get install -y -qq libboost-system-dev libboost-filesystem-dev libexpat1-dev zlib1g-dev libbz2-dev libpq-dev libproj-dev python3-psycopg2 python3-pyosmium
shell: bash shell: bash
- name: Configure - name: Configure
run: mkdir build && cd build && cmake .. run: mkdir build && cd build && cmake ..
shell: bash shell: bash
- name: Build - name: Build
run: | run: |
make -j2 all make -j2 all
./utils/setup.php --setup-website ./utils/setup.php --setup-website
shell: bash shell: bash
working-directory: build working-directory: build
- name: Download dependencies - name: Download dependencies
run: wget -O data/country_osm_grid.sql.gz https://www.nominatim.org/data/country_grid.sql.gz run: |
shell: bash if [ ! -f data/country_osm_grid.sql.gz ]; then
wget --no-verbose -O data/country_osm_grid.sql.gz https://www.nominatim.org/data/country_grid.sql.gz
fi
shell: bash

View File

@@ -13,6 +13,7 @@ runs:
echo 'fsync = off' | sudo tee /etc/postgresql/13/main/conf.d/local.conf echo 'fsync = off' | sudo tee /etc/postgresql/13/main/conf.d/local.conf
echo 'synchronous_commit = off' | sudo tee -a /etc/postgresql/13/main/conf.d/local.conf echo 'synchronous_commit = off' | sudo tee -a /etc/postgresql/13/main/conf.d/local.conf
echo 'full_page_writes = off' | sudo tee -a /etc/postgresql/13/main/conf.d/local.conf echo 'full_page_writes = off' | sudo tee -a /etc/postgresql/13/main/conf.d/local.conf
echo 'shared_buffers = 1GB' | sudo tee -a /etc/postgresql/13/main/conf.d/local.conf
shell: bash shell: bash
- name: Setup database - name: Setup database

View File

@@ -11,8 +11,20 @@ jobs:
with: with:
submodules: true submodules: true
- uses: ./.github/actions/setup-postgresql - name: Get Date
id: get-date
run: |
echo "::set-output name=date::$(/bin/date -u "+%Y%W")"
shell: bash
- uses: actions/cache@v2
with:
path: |
data/country_osm_grid.sql.gz
monaco-latest.osm.pbf
key: nominatim-data-${{ steps.get-date.outputs.date }}
- uses: ./.github/actions/setup-postgresql
- uses: ./.github/actions/build-nominatim - uses: ./.github/actions/build-nominatim
- name: Install test prerequsites - name: Install test prerequsites
@@ -39,19 +51,35 @@ jobs:
with: with:
submodules: true submodules: true
- name: Get Date
id: get-date
run: |
echo "::set-output name=date::$(/bin/date -u "+%Y%W")"
shell: bash
- uses: actions/cache@v2
with:
path: |
data/country_osm_grid.sql.gz
monaco-latest.osm.pbf
key: nominatim-data-${{ steps.get-date.outputs.date }}
- uses: ./.github/actions/setup-postgresql - uses: ./.github/actions/setup-postgresql
- uses: ./.github/actions/build-nominatim - uses: ./.github/actions/build-nominatim
- name: Download test extract
run: wget --no-verbose https://download.geofabrik.de/europe/monaco-latest.osm.pbf
- name: Create configuration - name: Create configuration
run: | run: |
echo '<?php' > settings/local.php echo '<?php' > settings/local.php
echo " @define('CONST_Pyosmium_Binary', '/usr/lib/python3-pyosmium/pyosmium-get-changes');" >> settings/local.php echo " @define('CONST_Pyosmium_Binary', '/usr/lib/python3-pyosmium/pyosmium-get-changes');" >> settings/local.php
working-directory: build working-directory: build
- name: Download import data
run: |
if [ ! -f monaco-latest.osm.pbf ]; then
wget --no-verbose https://download.geofabrik.de/europe/monaco-latest.osm.pbf
fi
shell: bash
- name: Import - name: Import
run: php ./utils/setup.php --osm-file ../monaco-latest.osm.pbf --osm2pgsql-cache 500 --all run: php ./utils/setup.php --osm-file ../monaco-latest.osm.pbf --osm2pgsql-cache 500 --all
working-directory: build working-directory: build