From 454759295a1c133d30b24630546eea0ab94de54c Mon Sep 17 00:00:00 2001 From: Jacob Williams Date: Sat, 26 Jul 2025 10:08:40 -0500 Subject: [PATCH 01/11] fixed error when using non-default ints Fixes #591 --- src/json_value_module.F90 | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/json_value_module.F90 b/src/json_value_module.F90 index f2316645d..0e7d28de8 100644 --- a/src/json_value_module.F90 +++ b/src/json_value_module.F90 @@ -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 From aefa8ad1bd87e2c51cab9b3292e47564b3cc2ef9 Mon Sep 17 00:00:00 2001 From: Jacob Williams Date: Sun, 27 Jul 2025 13:20:54 -0500 Subject: [PATCH 02/11] CI updates --- .github/workflows/CI.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/CI.yml b/.github/workflows/CI.yml index 0a5d1cf12..b78edf46d 100644 --- a/.github/workflows/CI.yml +++ b/.github/workflows/CI.yml @@ -9,7 +9,7 @@ jobs: strategy: fail-fast: false matrix: - os: [ubuntu-20.04] + os: [ubuntu-latest] gcc_v: [7,8,9,10,11] # Version of GFortran we want to use. python-version: [3.11] env: @@ -19,7 +19,7 @@ jobs: steps: - name: Checkout code - uses: actions/checkout@v4.1.6 + uses: actions/checkout@v4.2.2 with: submodules: recursive From c6edc87b34360389c96849a08f617d3a561675b8 Mon Sep 17 00:00:00 2001 From: Jacob Williams Date: Sun, 27 Jul 2025 13:23:51 -0500 Subject: [PATCH 03/11] rmv gcc 7 test from CI --- .github/workflows/CI.yml | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/.github/workflows/CI.yml b/.github/workflows/CI.yml index b78edf46d..8f2120f3d 100644 --- a/.github/workflows/CI.yml +++ b/.github/workflows/CI.yml @@ -10,7 +10,7 @@ jobs: fail-fast: false matrix: os: [ubuntu-latest] - gcc_v: [7,8,9,10,11] # Version of GFortran we want to use. + gcc_v: [8,9,10,11] # Version of GFortran we want to use. python-version: [3.11] env: FC: gfortran-${{matrix.gcc_v}} @@ -55,7 +55,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 != 8 && matrix.gcc_v != 11 run: | GFORTRAN=gfortran-${{matrix.gcc_v}} GCOV=gcov-${{matrix.gcc_v}} @@ -137,7 +137,7 @@ 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 == 8 run: | GFORTRAN=gfortran-${{matrix.gcc_v}} GCOV=gcov-${{matrix.gcc_v}} @@ -145,7 +145,7 @@ jobs: ./build.sh --coverage --enable-unicode - name: Deploy Documentation for master - if: matrix.gcc_v == 7 && github.ref == 'refs/heads/master' + if: matrix.gcc_v == 8 && github.ref == 'refs/heads/master' uses: JamesIves/github-pages-deploy-action@v4.7.3 with: branch: gh-pages # The branch the action should deploy to. @@ -157,7 +157,7 @@ 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 == 8 && startsWith(github.ref, 'refs/tags/') run: | echo ${TAGNAME} rm -rf doc @@ -165,7 +165,7 @@ jobs: 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 == 8 && startsWith(github.ref, 'refs/tags/') uses: JamesIves/github-pages-deploy-action@v4.7.3 with: branch: gh-pages # The branch the action should deploy to. @@ -174,7 +174,7 @@ jobs: single-commit: true - name: Upload coverage - if: matrix.gcc_v == 7 + if: matrix.gcc_v == 8 run: | rm json_*.F90-*unicode.gcov || true mv json_*.F90.gcov src/ From c873f263e36bfc6ace7e56138952808b33de7d50 Mon Sep 17 00:00:00 2001 From: Jacob Williams Date: Sun, 27 Jul 2025 13:29:41 -0500 Subject: [PATCH 04/11] remove gcc8, add gcc12 to CI --- .github/workflows/CI.yml | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/.github/workflows/CI.yml b/.github/workflows/CI.yml index 8f2120f3d..f32fd022f 100644 --- a/.github/workflows/CI.yml +++ b/.github/workflows/CI.yml @@ -10,7 +10,7 @@ jobs: fail-fast: false matrix: os: [ubuntu-latest] - gcc_v: [8,9,10,11] # Version of GFortran we want to use. + gcc_v: [9,10,11,12] # Version of GFortran we want to use. python-version: [3.11] env: FC: gfortran-${{matrix.gcc_v}} @@ -55,7 +55,7 @@ jobs: --slave /usr/bin/gcov gcov /usr/bin/gcov-${GCC_V} - name: Compile_with_build - if: matrix.gcc_v != 8 && matrix.gcc_v != 11 + if: matrix.gcc_v != 12 && matrix.gcc_v != 11 run: | GFORTRAN=gfortran-${{matrix.gcc_v}} GCOV=gcov-${{matrix.gcc_v}} @@ -137,7 +137,7 @@ 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 == 8 + if: matrix.gcc_v == 12 run: | GFORTRAN=gfortran-${{matrix.gcc_v}} GCOV=gcov-${{matrix.gcc_v}} @@ -145,7 +145,7 @@ jobs: ./build.sh --coverage --enable-unicode - name: Deploy Documentation for master - if: matrix.gcc_v == 8 && github.ref == 'refs/heads/master' + if: matrix.gcc_v == 12 && github.ref == 'refs/heads/master' uses: JamesIves/github-pages-deploy-action@v4.7.3 with: branch: gh-pages # The branch the action should deploy to. @@ -157,7 +157,7 @@ jobs: - name: Rebuild documentation for tagged release env: TAGNAME: ${{github.ref_name}} - if: matrix.gcc_v == 8 && startsWith(github.ref, 'refs/tags/') + if: matrix.gcc_v == 12 && startsWith(github.ref, 'refs/tags/') run: | echo ${TAGNAME} rm -rf doc @@ -165,7 +165,7 @@ jobs: ford --debug json-fortran.tagged.md - name: Deploy documentation for tagged release - if: matrix.gcc_v == 8 && startsWith(github.ref, 'refs/tags/') + if: matrix.gcc_v == 12 && startsWith(github.ref, 'refs/tags/') uses: JamesIves/github-pages-deploy-action@v4.7.3 with: branch: gh-pages # The branch the action should deploy to. @@ -174,7 +174,7 @@ jobs: single-commit: true - name: Upload coverage - if: matrix.gcc_v == 8 + if: matrix.gcc_v == 12 run: | rm json_*.F90-*unicode.gcov || true mv json_*.F90.gcov src/ From 1c79451981843279091e4ef221b7626c7e7e7cbc Mon Sep 17 00:00:00 2001 From: Jacob Williams Date: Sun, 27 Jul 2025 13:51:30 -0500 Subject: [PATCH 05/11] disable coverage for now in CI See #593 --- .github/workflows/CI.yml | 32 ++++++++++++++++++++++---------- 1 file changed, 22 insertions(+), 10 deletions(-) diff --git a/.github/workflows/CI.yml b/.github/workflows/CI.yml index f32fd022f..84a1d5749 100644 --- a/.github/workflows/CI.yml +++ b/.github/workflows/CI.yml @@ -16,6 +16,16 @@ jobs: FC: gfortran-${{matrix.gcc_v}} GCC_V: ${{matrix.gcc_v}} + # + # GCC version + # + # 9 - CMake build with unit tests, no documentation, with coverage analysis. no unicode + # 10 - build.sh - no documentation, with and without unicode. + # 11 - FPM + # 12 - build.sh with documentation, unit tests and coverage analysis. doc deployment + # + # NOTE: coverage disabled for now + steps: - name: Checkout code @@ -55,7 +65,7 @@ jobs: --slave /usr/bin/gcov gcov /usr/bin/gcov-${GCC_V} - name: Compile_with_build - if: matrix.gcc_v != 12 && matrix.gcc_v != 11 + if: matrix.gcc_v == 10 run: | GFORTRAN=gfortran-${{matrix.gcc_v}} GCOV=gcov-${{matrix.gcc_v}} @@ -141,8 +151,10 @@ jobs: run: | GFORTRAN=gfortran-${{matrix.gcc_v}} GCOV=gcov-${{matrix.gcc_v}} - ./build.sh --coverage --skip-documentation - ./build.sh --coverage --enable-unicode + # ./build.sh --coverage --skip-documentation # DISABLED FOR NOW + # ./build.sh --coverage --enable-unicode + ./build.sh --skip-documentation + ./build.sh --enable-unicode - name: Deploy Documentation for master if: matrix.gcc_v == 12 && github.ref == 'refs/heads/master' @@ -173,10 +185,10 @@ jobs: target-folder: prev/${{github.ref_name}} # deploy to a version-specific folder single-commit: true - - name: Upload coverage - if: matrix.gcc_v == 12 - run: | - rm json_*.F90-*unicode.gcov || true - mv json_*.F90.gcov src/ - mv jf_test*.[fF]90.gcov src/tests/ - bash <(curl -s https://codecov.io/bash) -v -X $GCOV + # - name: Upload coverage + # if: matrix.gcc_v == 12 + # run: | + # rm json_*.F90-*unicode.gcov || true + # mv json_*.F90.gcov src/ + # mv jf_test*.[fF]90.gcov src/tests/ + # bash <(curl -s https://codecov.io/bash) -v -X $GCOV From 112372ac20efd9e0b1eabef7c8e3c46666d12681 Mon Sep 17 00:00:00 2001 From: Jacob Williams Date: Sun, 27 Jul 2025 15:39:12 -0500 Subject: [PATCH 06/11] try gcc9 coverage --- .github/workflows/CI.yml | 38 ++++++++++++++++++-------------------- 1 file changed, 18 insertions(+), 20 deletions(-) diff --git a/.github/workflows/CI.yml b/.github/workflows/CI.yml index 84a1d5749..e69a03de9 100644 --- a/.github/workflows/CI.yml +++ b/.github/workflows/CI.yml @@ -10,7 +10,7 @@ jobs: fail-fast: false matrix: os: [ubuntu-latest] - gcc_v: [9,10,11,12] # Version of GFortran we want to use. + gcc_v: [12,10,11,9] # Version of GFortran we want to use. python-version: [3.11] env: FC: gfortran-${{matrix.gcc_v}} @@ -19,10 +19,10 @@ jobs: # # GCC version # - # 9 - CMake build with unit tests, no documentation, with coverage analysis. no unicode + # 9 - build.sh with documentation, unit tests and coverage analysis. doc deployment # 10 - build.sh - no documentation, with and without unicode. # 11 - FPM - # 12 - build.sh with documentation, unit tests and coverage analysis. doc deployment + # 12 - CMake build with unit tests, no documentation, with coverage analysis. no unicode # # NOTE: coverage disabled for now @@ -34,7 +34,7 @@ jobs: submodules: recursive - name: Setup cmake - if: contains( matrix.gcc_v, 9 ) + if: contains( matrix.gcc_v, 12 ) uses: jwlawson/actions-setup-cmake@v2.0.2 with: cmake-version: '3.28.x' @@ -135,7 +135,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}} @@ -147,17 +147,15 @@ 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 == 12 + if: matrix.gcc_v == 9 run: | GFORTRAN=gfortran-${{matrix.gcc_v}} GCOV=gcov-${{matrix.gcc_v}} - # ./build.sh --coverage --skip-documentation # DISABLED FOR NOW - # ./build.sh --coverage --enable-unicode - ./build.sh --skip-documentation - ./build.sh --enable-unicode + ./build.sh --coverage --skip-documentation # DISABLED FOR NOW + ./build.sh --coverage --enable-unicode - name: Deploy Documentation for master - if: matrix.gcc_v == 12 && github.ref == 'refs/heads/master' + if: matrix.gcc_v == 9 && github.ref == 'refs/heads/master' uses: JamesIves/github-pages-deploy-action@v4.7.3 with: branch: gh-pages # The branch the action should deploy to. @@ -169,7 +167,7 @@ jobs: - name: Rebuild documentation for tagged release env: TAGNAME: ${{github.ref_name}} - if: matrix.gcc_v == 12 && startsWith(github.ref, 'refs/tags/') + if: matrix.gcc_v == 9 && startsWith(github.ref, 'refs/tags/') run: | echo ${TAGNAME} rm -rf doc @@ -177,7 +175,7 @@ jobs: ford --debug json-fortran.tagged.md - name: Deploy documentation for tagged release - if: matrix.gcc_v == 12 && startsWith(github.ref, 'refs/tags/') + if: matrix.gcc_v == 9 && startsWith(github.ref, 'refs/tags/') uses: JamesIves/github-pages-deploy-action@v4.7.3 with: branch: gh-pages # The branch the action should deploy to. @@ -185,10 +183,10 @@ jobs: target-folder: prev/${{github.ref_name}} # deploy to a version-specific folder single-commit: true - # - name: Upload coverage - # if: matrix.gcc_v == 12 - # run: | - # rm json_*.F90-*unicode.gcov || true - # mv json_*.F90.gcov src/ - # mv jf_test*.[fF]90.gcov src/tests/ - # bash <(curl -s https://codecov.io/bash) -v -X $GCOV + - name: Upload coverage + if: matrix.gcc_v == 9 + run: | + rm json_*.F90-*unicode.gcov || true + mv json_*.F90.gcov src/ + mv jf_test*.[fF]90.gcov src/tests/ + bash <(curl -s https://codecov.io/bash) -v -X $GCOV From 9e2ab30b6519d9dd408e1f1449d020f1cddb90fc Mon Sep 17 00:00:00 2001 From: Jacob Williams Date: Wed, 30 Jul 2025 22:46:22 -0500 Subject: [PATCH 07/11] experiment to clone FoBiS in CI for code coverage --- .github/workflows/CI.yml | 10 +++++++++- .gitignore | 1 + 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/.github/workflows/CI.yml b/.github/workflows/CI.yml index e69a03de9..cb17b936b 100644 --- a/.github/workflows/CI.yml +++ b/.github/workflows/CI.yml @@ -47,11 +47,19 @@ jobs: - name: Setup Graphviz uses: ts-graphviz/setup-graphviz@v2.0.2 + - name: Set current directory in env variable + run: echo "MYDIR=$(pwd)" >> $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 + export PYTHONPATH="$MYDIR/FoBiS/src/main/python:$PYTHONPATH" + export PATH="$MYDIR/FoBiS/src/main/python:$PATH" if [ -f requirements.txt ]; then pip install -r requirements.txt; fi - name: Install GFortran Linux diff --git a/.gitignore b/.gitignore index 88a038629..296ffeb4b 100644 --- a/.gitignore +++ b/.gitignore @@ -35,6 +35,7 @@ My Inspector* x64/ Debug/ Release/ +/FoBiS # mac .DS_Store \ No newline at end of file From a19dc5678ba06d45b175fc7ffdae06d1b29c0c3a Mon Sep 17 00:00:00 2001 From: Jacob Williams Date: Wed, 30 Jul 2025 22:50:56 -0500 Subject: [PATCH 08/11] CI --- .github/workflows/CI.yml | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/.github/workflows/CI.yml b/.github/workflows/CI.yml index cb17b936b..5fa6ea720 100644 --- a/.github/workflows/CI.yml +++ b/.github/workflows/CI.yml @@ -50,6 +50,11 @@ jobs: - 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: | @@ -58,8 +63,6 @@ jobs: pip install ford pygooglechart fpm # just get the latest FoBiS from git: git clone https://github.com/szaghi/FoBiS.git - export PYTHONPATH="$MYDIR/FoBiS/src/main/python:$PYTHONPATH" - export PATH="$MYDIR/FoBiS/src/main/python:$PATH" if [ -f requirements.txt ]; then pip install -r requirements.txt; fi - name: Install GFortran Linux From 64aeba431ef2e8fb27c4518345c1e2ce0b5f03e4 Mon Sep 17 00:00:00 2001 From: Jacob Williams Date: Wed, 30 Jul 2025 23:01:26 -0500 Subject: [PATCH 09/11] try test fork --- .github/workflows/CI.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/CI.yml b/.github/workflows/CI.yml index 5fa6ea720..23febf91c 100644 --- a/.github/workflows/CI.yml +++ b/.github/workflows/CI.yml @@ -62,7 +62,8 @@ jobs: #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 + # git clone https://github.com/szaghi/FoBiS.git + git clone https://github.com/jacobwilliams/FoBiS.git if [ -f requirements.txt ]; then pip install -r requirements.txt; fi - name: Install GFortran Linux From 54cf47f16ab21ab82fb025c7014bf37feec94433 Mon Sep 17 00:00:00 2001 From: Jacob Williams Date: Wed, 30 Jul 2025 23:09:18 -0500 Subject: [PATCH 10/11] try deleting cov files between runs --- .github/workflows/CI.yml | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/.github/workflows/CI.yml b/.github/workflows/CI.yml index 23febf91c..2623ebcb4 100644 --- a/.github/workflows/CI.yml +++ b/.github/workflows/CI.yml @@ -163,7 +163,10 @@ jobs: run: | GFORTRAN=gfortran-${{matrix.gcc_v}} GCOV=gcov-${{matrix.gcc_v}} - ./build.sh --coverage --skip-documentation # DISABLED FOR NOW + ./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 From 9cc6fe78768970826ef508daabe58d1f4f3354de Mon Sep 17 00:00:00 2001 From: Jacob Williams Date: Wed, 30 Jul 2025 23:21:03 -0500 Subject: [PATCH 11/11] comment using a FoBiS fork for now until there is a new release --- .github/workflows/CI.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/CI.yml b/.github/workflows/CI.yml index 2623ebcb4..6879b26f7 100644 --- a/.github/workflows/CI.yml +++ b/.github/workflows/CI.yml @@ -63,6 +63,7 @@ jobs: 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