Skip to content

Remove --GMT_THEME=cookbook from examples included in the docs (#8485) #10419

Remove --GMT_THEME=cookbook from examples included in the docs (#8485)

Remove --GMT_THEME=cookbook from examples included in the docs (#8485) #10419

# Workflow to validify the consistency of the codes
on:
push:
branches:
- master
- '[0-9]+.[0-9]+'
paths:
- 'src/**'
- 'cmake/**'
- '**/*.sh'
- '.github/workflows/code-validator.yml'
pull_request:
paths:
- 'src/**'
- 'cmake/**'
- '**/*.sh'
- '.github/workflows/code-validator.yml'
name: Code Validator
jobs:
code-validator:
name: Code Validator
runs-on: ubuntu-latest
steps:
- name: Check out repository
uses: actions/checkout@v4.1.4
- name: Check PSL_strings.h
run: |
cd src/
bash gmt_make_PSL_strings.sh
if [[ $(git ls-files -m) ]]; then git --no-pager diff HEAD; exit 1; fi
cd ..
- name: Check gmt_enum_dict.h
run: |
cd src/
bash gmt_make_enum_dicts.sh
if [[ $(git ls-files -m) ]]; then git --no-pager diff HEAD; exit 1; fi
cd ..
- name: Check module purposes
run: |
cd src/
bash gmt_make_module_purpose.sh
if [[ $(git ls-files -m) ]]; then git --no-pager diff HEAD; exit 1; fi
cd ..
- name: Check GMT version year
run: |
current_year=$(date +%Y)
gmt_version_year=$(grep GMT_VERSION_YEAR cmake/ConfigDefault.cmake | awk -F'"' '{print $2}')
if [ "$current_year" != "$gmt_version_year" ]; then exit 1; fi
- name: Check execute permission of bash scripts
run: |
error=0
echo "Following bash scripts may not have execute permission:"
# exclude share/tools/gmt_functions.sh
for file in $(find . -name "*.sh" ! -path "./share/tools/gmt_functions.sh"); do
if [[ ! -x "$file" ]]; then
((++error))
echo "$error: $file"
fi
done
exit $error
- name: Check shebang of bash scripts
run: |
error=0
echo "Following bash scripts don't start with the shebang '#!/usr/bin/env bash'"
for file in $(find . -name "*.sh" ! -path "./share/tools/gmt_functions.sh" ! -path "./test/invalidate_modules.sh"); do
if [[ "$(head -n1 $file)" != "#!/usr/bin/env bash" ]]; then
((++error))
echo "$error: $file"
fi
done
exit $error