Skip to content

Commit fb86c6f

Browse files
authored
Merge pull request #244 from pgRouting/develop
FOSS4G 2024 Belem workshop
2 parents 7ee77de + 4944bc0 commit fb86c6f

File tree

173 files changed

+11629
-14303
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

173 files changed

+11629
-14303
lines changed

.github/dependabot.yml

+6
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
version: 2
2+
updates:
3+
- package-ecosystem: "github-actions"
4+
directory: "/"
5+
schedule:
6+
interval: "weekly"

tools/transifex/remove_obsolete_entries.sh .github/scripts/remove_obsolete_entries.sh

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
# ------------------------------------------------------------------------------
88

99
# For all the chapter files
10-
for file in $(find locale/en -type f -name "*.po"); do
10+
for file in $(find locale -type f -name "*.po"); do
1111
if grep -q '#~' $file; then
1212
perl -pi -0777 -e 's/#~.*//s' $file
1313
git add $file

.github/scripts/update_locale.sh

+48
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
#!/bin/bash
2+
# ------------------------------------------------------------------------------
3+
# /*PGR-GNU*****************************************************************
4+
# File: update_locale.sh
5+
# Copyright (c) 2021 pgRouting developers
6+
7+
# ------
8+
# This program is free software; you can redistribute it and/or modify
9+
# it under the terms of the GNU General Public License as published by
10+
# the Free Software Foundation; either version 2 of the License, or
11+
# (at your option) any later version.
12+
# This program is distributed in the hope that it will be useful,
13+
# but WITHOUT ANY WARRANTY; without even the implied warranty of
14+
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15+
# GNU General Public License for more details.
16+
# You should have received a copy of the GNU General Public License
17+
# along with this program; if not, write to the Free Software
18+
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
19+
# ********************************************************************PGR-GNU*/
20+
# ------------------------------------------------------------------------------
21+
22+
DIR=$(git rev-parse --show-toplevel)
23+
24+
pushd "${DIR}" > /dev/null || exit 1
25+
26+
mkdir -p build
27+
pushd build > /dev/null || exit 1
28+
cmake -DLOCALE=ON ..
29+
30+
make locale
31+
popd > /dev/null || exit 1
32+
33+
# List all the files that needs to be committed in build/docs/locale_changes.txt
34+
awk '/^Update|^Create/{print $2}' build/docs/locale_changes.txt > build/docs/locale_changes_po.txt # .po files
35+
cp build/docs/locale_changes_po.txt build/docs/locale_changes_po_pot.txt
36+
perl -ne '/\/en\// && print' build/docs/locale_changes_po.txt | \
37+
perl -pe 's/(.*)en\/LC_MESSAGES(.*)/$1pot$2t/' >> build/docs/locale_changes_po_pot.txt # .pot files
38+
39+
# Do not create empty translation files
40+
git status locale/es --porcelain | awk 'match($1, "?"){print $2}' | xargs -r rm -rf
41+
git status locale/ja --porcelain | awk 'match($1, "?"){print $2}' | xargs -r rm -rf
42+
43+
# Remove obsolete entries #~ from .po files
44+
bash .github/scripts/remove_obsolete_entries.sh
45+
46+
cat build/docs/locale_changes_po_pot.txt | xargs -I {} sh -c "(ls {} >> /dev/null 2>&1 && git add {} )"
47+
48+
popd > /dev/null || exit 1

.github/workflows/locale.yml

+98
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,98 @@
1+
name: Update Locale
2+
3+
# This action runs:
4+
# - When this file changes
5+
# - When changes on documentation (doc)
6+
# - When is triggered manually
7+
8+
on:
9+
workflow_dispatch:
10+
push:
11+
12+
permissions:
13+
contents: write
14+
15+
jobs:
16+
update-locale:
17+
name: Update Locale
18+
runs-on: ubuntu-latest
19+
20+
strategy:
21+
fail-fast: false
22+
23+
steps:
24+
- name: Checkout repository
25+
uses: actions/checkout@v4
26+
with:
27+
fetch-depth: 0
28+
29+
- name: Get postgres version
30+
run: |
31+
sudo service postgresql start
32+
pgver=$(psql --version | grep -Po '(?<=psql \(PostgreSQL\) )[^;]+(?=\.\d+ \()')
33+
echo "PGVER=${pgver}" >> $GITHUB_ENV
34+
echo "PGIS=3" >> $GITHUB_ENV
35+
36+
- name: Extract branch name and commit hash
37+
run: |
38+
branch=${GITHUB_REF#refs/heads/}
39+
git_hash=$(git rev-parse --short "$GITHUB_SHA")
40+
echo "GIT_HASH=$git_hash" >> $GITHUB_ENV
41+
42+
- name: Add PostgreSQL APT repository
43+
run: |
44+
sudo apt-get install curl ca-certificates gnupg
45+
curl https://www.postgresql.org/media/keys/ACCC4CF8.asc | sudo apt-key add -
46+
sudo sh -c 'echo "deb http://apt.postgresql.org/pub/repos/apt/ \
47+
$(lsb_release -cs)-pgdg main" > /etc/apt/sources.list.d/pgdg.list'
48+
49+
- name: Install python
50+
uses: actions/setup-python@v5
51+
with:
52+
python-version: '3.x'
53+
54+
- name: Install dependencies
55+
run: |
56+
sudo apt-get update
57+
sudo apt-get install -y osm2pgrouting \
58+
postgresql-${PGVER}-postgis-${PGIS} \
59+
postgresql-${PGVER}-postgis-${PGIS}-scripts \
60+
postgresql-${PGVER}-pgrouting
61+
62+
python -m pip install --upgrade pip
63+
pip install -r REQUIREMENTS.txt
64+
pip list
65+
66+
- name: Configure
67+
run: |
68+
service postgresql status
69+
sudo service postgresql start
70+
service postgresql status
71+
sudo -u postgres createdb -p ${POSTGRES_PORT} setup
72+
sudo -u postgres psql -c 'CREATE ROLE "runner" SUPERUSER CREATEDB CREATEROLE INHERIT LOGIN PASSWORD $$runner$$;' -d setup
73+
echo :5432:*:runner:runner >> .pgpass
74+
sudo -u postgres psql -c 'CREATE ROLE "user" SUPERUSER CREATEDB CREATEROLE INHERIT LOGIN PASSWORD $$user$$;' -d setup
75+
echo :5432:*:user:user >> .pgpass
76+
mkdir build
77+
cd build
78+
cmake -DLOCALE=ON ..
79+
env:
80+
POSTGRES_HOST: localhost
81+
POSTGRES_PORT: 5432
82+
POSTGRES_USER: postgres
83+
POSTGRES_PASSWORD: postgres
84+
POSTGRES_DB: setup
85+
86+
- name: Initialize mandatory git config
87+
run: |
88+
git config user.name "github-actions[bot]"
89+
git config user.email "41898282+github-actions[bot]@users.noreply.github.com"
90+
91+
- name: Update locale
92+
run: |
93+
bash .github/scripts/update_locale.sh
94+
95+
# Add the files, commit and push
96+
git diff --staged --quiet || git commit -m "Update locale: commit ${{ env.GIT_HASH }}"
97+
git restore . # Remove the unstaged changes before rebasing
98+
git push

.github/workflows/ubuntu.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ jobs:
1111
fail-fast: false
1212

1313
steps:
14-
- uses: actions/checkout@v3
14+
- uses: actions/checkout@v4
1515

1616
- name: Get postgres version
1717
run: |
@@ -28,7 +28,7 @@ jobs:
2828
$(lsb_release -cs)-pgdg main" > /etc/apt/sources.list.d/pgdg.list'
2929
3030
- name: Install python
31-
uses: actions/setup-python@v4
31+
uses: actions/setup-python@v5
3232
with:
3333
python-version: '3.x'
3434

.github/workflows/locale-and-website.yml .github/workflows/website.yml

+5-24
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,15 @@
1-
name: Update Locale and Website
1+
name: Update Website
22

33
on:
44
workflow_dispatch:
55
push:
66
branches:
77
- develop
8-
- un-challenge
8+
- main
99

1010
jobs:
1111
update-documentation:
12-
name: Update Locale and Website
12+
name: Update Website
1313
runs-on: ubuntu-latest
1414

1515
strategy:
@@ -44,7 +44,7 @@ jobs:
4444
$(lsb_release -cs)-pgdg main" > /etc/apt/sources.list.d/pgdg.list'
4545
4646
- name: Install python
47-
uses: actions/setup-python@v4
47+
uses: actions/setup-python@v5
4848
with:
4949
python-version: '3.x'
5050

@@ -72,7 +72,7 @@ jobs:
7272
echo :5432:*:user:user >> .pgpass
7373
mkdir build
7474
cd build
75-
cmake -DLOCALE=ON -DPGR_WORKSHOP=ON -DES=ON ..
75+
cmake -DES=ON ..
7676
env:
7777
POSTGRES_HOST: localhost
7878
POSTGRES_PORT: 5432
@@ -90,25 +90,6 @@ jobs:
9090
git config user.name "github-actions[bot]"
9191
git config user.email "41898282+github-actions[bot]@users.noreply.github.com"
9292
93-
- name: Update locale
94-
if: github.ref == 'refs/heads/develop'
95-
run: |
96-
# List all the files that needs to be committed in build/docs/locale_changes.txt
97-
awk '/^Update|^Create/{print $2}' build/docs/locale_changes.txt > tmp && mv tmp build/docs/locale_changes.txt # .po files
98-
cat build/docs/locale_changes.txt | perl -pe 's/(.*)en\/LC_MESSAGES(.*)/$1pot$2t/' >> build/docs/locale_changes.txt # .pot files
99-
cat build/docs/locale_changes.txt
100-
101-
# Remove obsolete entries #~ from .po files
102-
tools/transifex/remove_obsolete_entries.sh
103-
104-
# Add the files, commit and push
105-
for line in `cat build/docs/locale_changes.txt`; do git add "$line"; done
106-
git diff --staged --quiet || git commit -m "Update locale: commit ${{ env.GIT_HASH }}"
107-
git fetch origin develop
108-
git restore . # Remove the unstaged changes before rebasing
109-
git rebase origin/develop
110-
git push origin develop
111-
11293
- name: Update Website
11394
run: |
11495
if [[ "${{ env.BRANCH }}" == "develop" ]]; then

0 commit comments

Comments
 (0)