Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
72 changes: 21 additions & 51 deletions .github/workflows/clang.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ name: Build for Ubuntu with clang
# - On request
#
# using
# - the postgres installed version
# - postgres installed version on actions

on:
workflow_dispatch:
Expand All @@ -35,7 +35,6 @@ permissions:
env:
postgis: 3
os: ubuntu-latest
vroom: 1.12.0

jobs:
build:
Expand All @@ -53,28 +52,33 @@ jobs:
- name: Get postgres version
run: |
sudo service postgresql start
pgver=$(psql --version | grep -Po '(?<=psql \(PostgreSQL\) )[^;]+(?=\.\d+ \()')
echo "PGVER=${pgver}" >> $GITHUB_ENV
PGVER=$(psql --version | grep -Po '(?<=psql \(PostgreSQL\) )[^;]+(?=\.\d+ \()')
echo "PGVER=${PGVER}" >> $GITHUB_ENV
echo "PGPORT=5432" >> $GITHUB_ENV
echo "PGBIN=/usr/lib/postgresql/${pgver}/bin" >> $GITHUB_ENV
echo "PGINC=/usr/include/postgresql/${pgver}/server" >> $GITHUB_ENV
echo "PGBIN=/usr/lib/postgresql/${PGVER}/bin" >> $GITHUB_ENV
echo "PGINC=/usr/include/postgresql/${PGVER}/server" >> $GITHUB_ENV

- name: 'Raise Priority for apt.postgresql.org'
run: |
cat << EOF >> ./pgdg.pref
Package: *
Pin: release o=apt.postgresql.org
Pin-Priority: 600
EOF
sudo mv ./pgdg.pref /etc/apt/preferences.d/
sudo apt update

- name: Add PostgreSQL APT repository
run: |
sudo apt-get install curl ca-certificates gnupg
curl https://www.postgresql.org/media/keys/ACCC4CF8.asc | sudo apt-key add -
sudo sh -c 'echo "deb http://apt.postgresql.org/pub/repos/apt/ \
$(lsb_release -cs)-pgdg main" > /etc/apt/sources.list.d/pgdg.list'
sudo apt-get purge postgresql-*
sudo sh -c 'echo "deb http://apt.postgresql.org/pub/repos/apt $(lsb_release -cs)-pgdg-testing main ${{ matrix.psql }}" > /etc/apt/sources.list.d/pgdg.list'
curl https://www.postgresql.org/media/keys/ACCC4CF8.asc | gpg --dearmor | sudo tee /etc/apt/trusted.gpg.d/apt.postgresql.org.gpg >/dev/null

Comment on lines 71 to 76
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Verification agent

🧩 Analysis chain

Bug: Undefined matrix.psql used; replace with $PGVER

This workflow has no matrix.psql, yet the APT source line references it. actionlint’s hint matches this. Use the PGVER you computed earlier.

-          sudo sh -c 'echo "deb http://apt.postgresql.org/pub/repos/apt $(lsb_release -cs)-pgdg-testing main ${{ matrix.psql }}" > /etc/apt/sources.list.d/pgdg.list'
+          sudo sh -c 'echo "deb http://apt.postgresql.org/pub/repos/apt $(lsb_release -cs)-pgdg-testing main ${PGVER}" > /etc/apt/sources.list.d/pgdg.list'

Also consider whether you want pgdg-testing or stable pgdg for this job.


🏁 Script executed:

#!/bin/bash
set -e

echo "🔍 Searching for matrix.psql usage..."
rg -n "matrix\.psql" -C2 .github/workflows/clang.yml || echo "⚠️ No matrix.psql usage found"

echo
echo "🔍 Searching for matrix definitions..."
rg -n "^ *matrix:" -C3 .github/workflows/clang.yml || echo "⚠️ No matrix definitions found"

echo
echo "🔍 Searching for PGVER references..."
rg -n "\bPGVER\b" -C2 .github/workflows/clang.yml || echo "⚠️ No PGVER references found"

Length of output: 1971


Fix undefined matrix.psql reference
The workflow references an undefined matrix.psql variable. Replace it with the PGVER environment variable computed earlier.

  • File: .github/workflows/clang.yml
  • Location: lines 71–76

Suggested change:

-          sudo sh -c 'echo "deb http://apt.postgresql.org/pub/repos/apt $(lsb_release -cs)-pgdg-testing main ${{ matrix.psql }}" > /etc/apt/sources.list.d/pgdg.list'
+          sudo sh -c 'echo "deb http://apt.postgresql.org/pub/repos/apt $(lsb_release -cs)-pgdg-testing main ${PGVER}" > /etc/apt/sources.list.d/pgdg.list'

Also consider whether you intend to use the pgdg-testing repository or switch to the stable pgdg channel for this job.

📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
- name: Add PostgreSQL APT repository
run: |
sudo apt-get install curl ca-certificates gnupg
curl https://www.postgresql.org/media/keys/ACCC4CF8.asc | sudo apt-key add -
sudo sh -c 'echo "deb http://apt.postgresql.org/pub/repos/apt/ \
$(lsb_release -cs)-pgdg main" > /etc/apt/sources.list.d/pgdg.list'
sudo apt-get purge postgresql-*
sudo sh -c 'echo "deb http://apt.postgresql.org/pub/repos/apt $(lsb_release -cs)-pgdg-testing main ${{ matrix.psql }}" > /etc/apt/sources.list.d/pgdg.list'
curl https://www.postgresql.org/media/keys/ACCC4CF8.asc | gpg --dearmor | sudo tee /etc/apt/trusted.gpg.d/apt.postgresql.org.gpg >/dev/null
- name: Add PostgreSQL APT repository
run: |
sudo apt-get purge postgresql-*
sudo sh -c 'echo "deb http://apt.postgresql.org/pub/repos/apt $(lsb_release -cs)-pgdg-testing main ${PGVER}" > /etc/apt/sources.list.d/pgdg.list'
curl https://www.postgresql.org/media/keys/ACCC4CF8.asc | gpg --dearmor | sudo tee /etc/apt/trusted.gpg.d/apt.postgresql.org.gpg >/dev/null
🧰 Tools
🪛 actionlint (1.7.7)

72-72: property "psql" is not defined in object type {release: string}

(expression)

🤖 Prompt for AI Agents
In .github/workflows/clang.yml around lines 71–76, the workflow uses an
undefined matrix.psql variable when adding the PostgreSQL APT repository;
replace that reference with the PGVER environment variable computed earlier
(e.g., use the previously set PGVER value in the repository line), ensure PGVER
is exported/available in this step, and decide whether to use the testing
repository name (-pgdg-testing) or the stable (-pgdg) channel and update the deb
URL accordingly so the apt source line is valid.

- name: Install python
uses: actions/setup-python@v5
with:
python-version: '3.x'

- name: Install dependencies
run: |
sudo apt-get update
# vrpRouting dependencies

sudo apt-get install -y \
clang \
libtap-parser-sourcehandler-pgtap-perl \
Expand All @@ -83,48 +87,15 @@ jobs:
postgresql-${PGVER}-postgis-${{ env.postgis }} \
postgresql-${PGVER}-postgis-${{ env.postgis }}-scripts \
postgresql-${PGVER}-pgrouting \
postgresql-server-dev-${PGVER} \
postgresql-plpython3-${PGVER}
# vroom dependencies
sudo apt-get install libssl-dev libasio-dev libglpk-dev

- name: Install Google OR-Tools dependencies
run: |
sudo pip install --root=/ ortools

- name: Cache VROOM
id: cache-vroom
uses: actions/cache@v4
env:
cache-name: vroom
with:
path: vroom-${{ env.vroom }}
key: ${{ env.os }}-${{ env.cache-name }}-${{ env.vroom }}

- name: Checkout VROOM
if: steps.cache-vroom.outputs.cache-hit != 'true'
uses: actions/checkout@v4
with:
path: vroom-${{ env.vroom }}
repository: VROOM-Project/vroom
ref: "v${{ env.vroom }}"
submodules: true

- name: Build VROOM
if: steps.cache-vroom.outputs.cache-hit != 'true'
run: |
cd vroom-${{ env.vroom }}/src
USE_ROUTING=false make shared
postgresql-server-dev-${PGVER}

- name: Configure
run: |
export PATH=/usr/lib/postgresql/${PGVER}/bin:$PATH
VROOM=$(pwd)/vroom-${{ env.vroom }}
mkdir build
cd build
CXX=clang++ CC=clang cmake -DCMAKE_BUILD_TYPE=${{ matrix.release }} \
-DPostgreSQL_INCLUDE_DIR=${PGINC} -DPOSTGRESQL_BIN=${PGBIN} \
-DVROOM_INSTALL_PATH=${VROOM} ..
-DPostgreSQL_INCLUDE_DIR=${PGINC} -DPOSTGRESQL_BIN=${PGBIN} ..

- name: Build
run: |
Expand Down Expand Up @@ -152,4 +123,3 @@ jobs:
sudo service postgresql start
psql -c "CREATE DATABASE ___vrp___test___;"
bash ./tools/testers/pg_prove_tests.sh -U ${PG_RUNNER_USER} -p ${PGPORT} -d ___vrp___test___

73 changes: 12 additions & 61 deletions .github/workflows/documentation.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,23 +20,15 @@ on:
- 'locale/**'
- 'CMakeLists.txt'

branches-ignore:
- 'gh-pages'

tags: []



pull_request:
paths:
- '.github/workflows/documentation.yml'
- 'doc/**'
- 'locale/**'
- 'CMakeLists.txt'

branches-ignore:
- 'gh-pages'

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
Expand All @@ -48,7 +40,6 @@ env:
postgis: 3
release: Release
os: ubuntu-latest
vroom: 1.12.0

jobs:
check-documentation:
Expand All @@ -74,7 +65,7 @@ jobs:
if [[ "${{ matrix.language }}" == "zh_Hans" && "${{ github.repository_owner }}" != "pgRouting" ]]; then echo "PROCESS=false" >> $GITHUB_ENV; exit 0; fi

# when this file changes all languages are tested
if git diff --name-only HEAD^ HEAD | grep -q '.github/workflows/doc-check.yml' ; then echo "PROCESS=true" >> $GITHUB_ENV; exit 0; fi
if git diff --name-only HEAD^ HEAD | grep -q '.github/workflows/documentation.yml' ; then echo "PROCESS=true" >> $GITHUB_ENV; exit 0; fi

# when there is a change on the way the build is done all languages are tested
if git diff --name-only HEAD^ HEAD | grep -q '^CMakeLists.txt' ; then echo "PROCESS=true" >> $GITHUB_ENV; exit 0; fi
Expand All @@ -88,24 +79,10 @@ jobs:
if: env.PROCESS == 'true'
run: |
sudo service postgresql start
pgver=$(psql --version | grep -Po '(?<=psql \(PostgreSQL\) )[^;]+(?=\.\d+ \()')
echo "PGVER=${pgver}" >> $GITHUB_ENV
PGVER=$(psql --version | grep -Po '(?<=psql \(PostgreSQL\) )[^;]+(?=\.\d+ \()')
echo "PGVER=${PGVER}" >> $GITHUB_ENV
echo "PGPORT=5432" >> $GITHUB_ENV

- name: Add PostgreSQL APT repository
if: env.PROCESS == 'true'
run: |
sudo apt-get install curl ca-certificates gnupg
curl https://www.postgresql.org/media/keys/ACCC4CF8.asc | sudo apt-key add -
sudo sh -c 'echo "deb http://apt.postgresql.org/pub/repos/apt/ \
$(lsb_release -cs)-pgdg main" > /etc/apt/sources.list.d/pgdg.list'

- name: Install python
if: env.PROCESS == 'true'
uses: actions/setup-python@v5
with:
python-version: '3.x'

- name: Install dependencies
if: env.PROCESS == 'true'
run: |
Expand All @@ -114,49 +91,23 @@ jobs:
sudo apt-get install -y \
postgresql-${PGVER} \
postgresql-server-dev-${PGVER}
# vroom dependencies
sudo apt-get install libssl-dev libasio-dev libglpk-dev
# documentation dependencies
sudo apt-get install -y graphviz doxygen
pip install -r requirements.txt
python -m pip install --upgrade pip
pip install -r requirements.txt
pip list

- name: Cache VROOM
id: cache-vroom
if: env.PROCESS == 'true'
uses: actions/cache@v4
env:
cache-name: vroom
with:
path: vroom-${{ env.vroom }}
key: ${{ env.os }}-${{ env.cache-name }}-${{ env.vroom }}

- name: Checkout VROOM
if: env.PROCESS == 'true' && steps.cache-vroom.outputs.cache-hit != 'true'
uses: actions/checkout@v4
with:
path: vroom-${{ env.vroom }}
repository: VROOM-Project/vroom
ref: "v${{ env.vroom }}"
submodules: true

- name: Build VROOM
if: env.PROCESS == 'true' && steps.cache-vroom.outputs.cache-hit != 'true'
run: |
cd vroom-${{ env.vroom }}/src
USE_ROUTING=false make shared
# documentation dependencies
sudo apt-get install -y \
doxygen \
graphviz \
python3-sphinx \
python3-sphinx-bootstrap-theme \
sphinx-intl

- name: Configure
if: env.PROCESS == 'true'
run: |
mkdir build
cd build
cmake -DCMAKE_BUILD_TYPE=${{ env.release }} -DWITH_DOC=ON -DLINKCHECK=ON -DBUILD_DOXY=ON \
-DVROOM_INSTALL_PATH=${GIT_WORKSPACE}/vroom-${{ env.vroom }} ..
cmake -DCMAKE_BUILD_TYPE=${{ env.release }} -DSPHINX_LINKCHECK=ON -DBUILD_DOXY=ON ..

- name: Check Documentation
- name: Build Documentation
if: env.PROCESS == 'true'
run: |
cd build
Expand Down
29 changes: 18 additions & 11 deletions .github/workflows/check-files.yml → .github/workflows/files.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ name: Check files
# Verifies:
# - the signatures are up-to-date
# - the release_notes and NEWS are consitent
# - the C/C++ files have a license
# - the files have a license
# - the shell scripts are ok
# - the code style is ok
# Does not makes a compilation
Expand All @@ -15,22 +15,31 @@ on: [push, pull_request]
permissions:
contents: read

defaults:
run:
shell: bash
working-directory: tools/scripts

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

jobs:
Signature_check:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Signatures are not removed
run: |
tools/scripts/test_signatures.sh
run: ./test_signatures.sh

News_check:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: News file up to date
working-directory: ./
run: |
tools/scripts/notes2news.pl
if git status | grep 'NEWS.md'; then echo "NEWS.md is not up to date"; exit 1; fi
Expand All @@ -42,21 +51,19 @@ jobs:
- name: Checkout
uses: actions/checkout@v4
- name: Install Requirements
run: |
sudo apt install -y licensecheck
run: sudo apt install -y licensecheck
- name: Run License Check
run: ./tools/scripts/test_license.sh
run: ./test_license.sh

Shell_check:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Install Requirements
run: |
sudo apt install -y shellcheck
run: sudo apt-get install -y shellcheck
- name: Run Shell Check
run: ./tools/scripts/test_shell.sh
run: ./test_shell.sh

style-check:
runs-on: ubuntu-latest
Expand All @@ -70,5 +77,5 @@ jobs:
ref: "develop"
path: "code_linter/cpplint"
- name: Run linter
run: |
bash ./tools/scripts/code_checker.sh
working-directory: ./
run: ./tools/scripts/code_checker.sh
Loading