diff --git a/.github/workflows/CI.yml b/.github/workflows/CI.yml index 0a5d1cf12..6879b26f7 100644 --- a/.github/workflows/CI.yml +++ b/.github/workflows/CI.yml @@ -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/actions-setup-cmake@v2.0.2 with: cmake-version: '3.28.x' @@ -37,11 +47,24 @@ 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: 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 @@ -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}} @@ -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}} @@ -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/github-pages-deploy-action@v4.7.3 with: branch: gh-pages # The branch the action should deploy to. @@ -157,7 +183,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 == 9 && startsWith(github.ref, 'refs/tags/') run: | echo ${TAGNAME} rm -rf doc @@ -165,7 +191,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 == 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. @@ -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/ 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 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