Skip to content

Ci Fixes #594

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 11 commits into from
Jul 31, 2025
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
50 changes: 38 additions & 12 deletions .github/workflows/CI.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,22 +9,32 @@ jobs:
strategy:
fail-fast: false
matrix:
os: [ubuntu-20.04]
gcc_v: [7,8,9,10,11] # Version of GFortran we want to use.
os: [ubuntu-latest]
gcc_v: [12,10,11,9] # Version of GFortran we want to use.
python-version: [3.11]
env:
FC: gfortran-${{matrix.gcc_v}}
GCC_V: ${{matrix.gcc_v}}

#
# GCC version
#
# 9 - build.sh with documentation, unit tests and coverage analysis. doc deployment
# 10 - build.sh - no documentation, with and without unicode.
# 11 - FPM
# 12 - CMake build with unit tests, no documentation, with coverage analysis. no unicode
#
# NOTE: coverage disabled for now

steps:

- name: Checkout code
uses: actions/checkout@v4.1.6
uses: actions/checkout@v4.2.2
with:
submodules: recursive

- name: Setup cmake
if: contains( matrix.gcc_v, 9 )
if: contains( matrix.gcc_v, 12 )
uses: jwlawson/[email protected]
with:
cmake-version: '3.28.x'
Expand All @@ -37,11 +47,24 @@ jobs:
- name: Setup Graphviz
uses: ts-graphviz/[email protected]

- name: Set current directory in env variable
run: echo "MYDIR=$(pwd)" >> $GITHUB_ENV

- name: Set PYTHONPATH and PATH for later steps
run: |
echo "PYTHONPATH=$MYDIR/FoBiS/src/main/python:$PYTHONPATH" >> $GITHUB_ENV
echo "PATH=$MYDIR/FoBiS/src/main/python:$PATH" >> $GITHUB_ENV

- name: Install Python dependencies
if: contains( matrix.os, 'ubuntu')
run: |
python -m pip install --upgrade pip
pip install ford FoBiS.py pygooglechart fpm
#pip install ford FoBiS.py pygooglechart fpm
pip install ford pygooglechart fpm
# just get the latest FoBiS from git:
# git clone https://github.com/szaghi/FoBiS.git
# use a fork until there is a new release:
git clone https://github.com/jacobwilliams/FoBiS.git
if [ -f requirements.txt ]; then pip install -r requirements.txt; fi

- name: Install GFortran Linux
Expand All @@ -55,7 +78,7 @@ jobs:
--slave /usr/bin/gcov gcov /usr/bin/gcov-${GCC_V}

- name: Compile_with_build
if: matrix.gcc_v != 7 && matrix.gcc_v != 11
if: matrix.gcc_v == 10
run: |
GFORTRAN=gfortran-${{matrix.gcc_v}}
GCOV=gcov-${{matrix.gcc_v}}
Expand Down Expand Up @@ -125,7 +148,7 @@ jobs:
# CMake build with unit tests, no documentation, with coverage analysis
# No unicode so that coverage combined with the build script will cover unicode
# and non-unicode code paths
if: matrix.gcc_v == 9
if: matrix.gcc_v == 12
run: |
GFORTRAN=gfortran-${{matrix.gcc_v}}
GCOV=gcov-${{matrix.gcc_v}}
Expand All @@ -137,15 +160,18 @@ jobs:
- name: Compile_with_build_mkdocs
# build with build.sh, make documentation, run unit tests
# and perform coverage analysis - used for doc deployment
if: matrix.gcc_v == 7
if: matrix.gcc_v == 9
run: |
GFORTRAN=gfortran-${{matrix.gcc_v}}
GCOV=gcov-${{matrix.gcc_v}}
./build.sh --coverage --skip-documentation
# delete old coverage files:
find . -name '*.gcda' -delete
find . -name '*.gcov' -delete
./build.sh --coverage --enable-unicode

- name: Deploy Documentation for master
if: matrix.gcc_v == 7 && github.ref == 'refs/heads/master'
if: matrix.gcc_v == 9 && github.ref == 'refs/heads/master'
uses: JamesIves/[email protected]
with:
branch: gh-pages # The branch the action should deploy to.
Expand All @@ -157,15 +183,15 @@ jobs:
- name: Rebuild documentation for tagged release
env:
TAGNAME: ${{github.ref_name}}
if: matrix.gcc_v == 7 && startsWith(github.ref, 'refs/tags/')
if: matrix.gcc_v == 9 && startsWith(github.ref, 'refs/tags/')
run: |
echo ${TAGNAME}
rm -rf doc
sed "2 s/^/version: ${TAGNAME}\n/" json-fortran.md > json-fortran.tagged.md
ford --debug json-fortran.tagged.md

- name: Deploy documentation for tagged release
if: matrix.gcc_v == 7 && startsWith(github.ref, 'refs/tags/')
if: matrix.gcc_v == 9 && startsWith(github.ref, 'refs/tags/')
uses: JamesIves/[email protected]
with:
branch: gh-pages # The branch the action should deploy to.
Expand All @@ -174,7 +200,7 @@ jobs:
single-commit: true

- name: Upload coverage
if: matrix.gcc_v == 7
if: matrix.gcc_v == 9
run: |
rm json_*.F90-*unicode.gcov || true
mv json_*.F90.gcov src/
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ My Inspector*
x64/
Debug/
Release/
/FoBiS

# mac
.DS_Store
4 changes: 3 additions & 1 deletion src/json_value_module.F90
Original file line number Diff line number Diff line change
Expand Up @@ -11599,7 +11599,9 @@ subroutine json_print_error_message(json,io_unit)
write(io_unit,'(A)',iostat=istat) error_msg
if (istat/=0) then
! in this case, just try to write to the error_unit
call integer_to_string(io_unit,int_fmt,tmp)
! [convert to IK integer, we assume this will be ok since
! normally these io units are default ints]
call integer_to_string(int(io_unit,IK),int_fmt,tmp)
write(error_unit,'(A)',iostat=istat) 'Error writing to unit '//trim(tmp)
write(error_unit,'(A)',iostat=istat) error_msg
end if
Expand Down