CI: Fix the script to install dependencies on Windows #10547
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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.2.0 | |
- 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 |