File: code-checks.yaml

package info (click to toggle)
reflect-cpp 0.18.0%2Bds-3
  • links: PTS, VCS
  • area: main
  • in suites: trixie
  • size: 12,524 kB
  • sloc: cpp: 44,484; python: 131; makefile: 30; sh: 3
file content (27 lines) | stat: -rw-r--r-- 856 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
name: code-checks

on: [ push, pull_request ]

jobs:
  check-includes-are-relative:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4
      - shell : bash
        run: |
          cd include
          errors=0
          for file in $(find . -name '*.hpp'); do
            while read -r line; do
              if [[ "$line" = "" ]]; then continue; fi 
              what=$(printf "$line" | sed -n 's/^.*"\(.*\)"\s*$/\1/p')
              pushd $(dirname $(readlink -f "$file" )) > /dev/null
              if ! [[ -e "$what" ]]; then
                  where=$(printf "$line" | grep -oP '^.*:[0-9]+')
                  echo Non-relative include of $what @ $where 
                  ((errors++))
              fi
              popd > /dev/null
            done <<< $(grep -HnoP '#include ".*"' $file)
          done
          exit $errors