Skip to content

Commit e6f3b50

Browse files
Merge pull request #594 from jacobwilliams/ci-test
Ci Fixes
2 parents 2dc8abe + 9cc6fe7 commit e6f3b50

File tree

3 files changed

+42
-13
lines changed

3 files changed

+42
-13
lines changed

.github/workflows/CI.yml

Lines changed: 38 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -9,22 +9,32 @@ jobs:
99
strategy:
1010
fail-fast: false
1111
matrix:
12-
os: [ubuntu-20.04]
13-
gcc_v: [7,8,9,10,11] # Version of GFortran we want to use.
12+
os: [ubuntu-latest]
13+
gcc_v: [12,10,11,9] # Version of GFortran we want to use.
1414
python-version: [3.11]
1515
env:
1616
FC: gfortran-${{matrix.gcc_v}}
1717
GCC_V: ${{matrix.gcc_v}}
1818

19+
#
20+
# GCC version
21+
#
22+
# 9 - build.sh with documentation, unit tests and coverage analysis. doc deployment
23+
# 10 - build.sh - no documentation, with and without unicode.
24+
# 11 - FPM
25+
# 12 - CMake build with unit tests, no documentation, with coverage analysis. no unicode
26+
#
27+
# NOTE: coverage disabled for now
28+
1929
steps:
2030

2131
- name: Checkout code
22-
uses: actions/checkout@v4.1.6
32+
uses: actions/checkout@v4.2.2
2333
with:
2434
submodules: recursive
2535

2636
- name: Setup cmake
27-
if: contains( matrix.gcc_v, 9 )
37+
if: contains( matrix.gcc_v, 12 )
2838
uses: jwlawson/actions-setup-cmake@v2.0.2
2939
with:
3040
cmake-version: '3.28.x'
@@ -37,11 +47,24 @@ jobs:
3747
- name: Setup Graphviz
3848
uses: ts-graphviz/setup-graphviz@v2.0.2
3949

50+
- name: Set current directory in env variable
51+
run: echo "MYDIR=$(pwd)" >> $GITHUB_ENV
52+
53+
- name: Set PYTHONPATH and PATH for later steps
54+
run: |
55+
echo "PYTHONPATH=$MYDIR/FoBiS/src/main/python:$PYTHONPATH" >> $GITHUB_ENV
56+
echo "PATH=$MYDIR/FoBiS/src/main/python:$PATH" >> $GITHUB_ENV
57+
4058
- name: Install Python dependencies
4159
if: contains( matrix.os, 'ubuntu')
4260
run: |
4361
python -m pip install --upgrade pip
44-
pip install ford FoBiS.py pygooglechart fpm
62+
#pip install ford FoBiS.py pygooglechart fpm
63+
pip install ford pygooglechart fpm
64+
# just get the latest FoBiS from git:
65+
# git clone https://github.com/szaghi/FoBiS.git
66+
# use a fork until there is a new release:
67+
git clone https://github.com/jacobwilliams/FoBiS.git
4568
if [ -f requirements.txt ]; then pip install -r requirements.txt; fi
4669
4770
- name: Install GFortran Linux
@@ -55,7 +78,7 @@ jobs:
5578
--slave /usr/bin/gcov gcov /usr/bin/gcov-${GCC_V}
5679
5780
- name: Compile_with_build
58-
if: matrix.gcc_v != 7 && matrix.gcc_v != 11
81+
if: matrix.gcc_v == 10
5982
run: |
6083
GFORTRAN=gfortran-${{matrix.gcc_v}}
6184
GCOV=gcov-${{matrix.gcc_v}}
@@ -125,7 +148,7 @@ jobs:
125148
# CMake build with unit tests, no documentation, with coverage analysis
126149
# No unicode so that coverage combined with the build script will cover unicode
127150
# and non-unicode code paths
128-
if: matrix.gcc_v == 9
151+
if: matrix.gcc_v == 12
129152
run: |
130153
GFORTRAN=gfortran-${{matrix.gcc_v}}
131154
GCOV=gcov-${{matrix.gcc_v}}
@@ -137,15 +160,18 @@ jobs:
137160
- name: Compile_with_build_mkdocs
138161
# build with build.sh, make documentation, run unit tests
139162
# and perform coverage analysis - used for doc deployment
140-
if: matrix.gcc_v == 7
163+
if: matrix.gcc_v == 9
141164
run: |
142165
GFORTRAN=gfortran-${{matrix.gcc_v}}
143166
GCOV=gcov-${{matrix.gcc_v}}
144167
./build.sh --coverage --skip-documentation
168+
# delete old coverage files:
169+
find . -name '*.gcda' -delete
170+
find . -name '*.gcov' -delete
145171
./build.sh --coverage --enable-unicode
146172
147173
- name: Deploy Documentation for master
148-
if: matrix.gcc_v == 7 && github.ref == 'refs/heads/master'
174+
if: matrix.gcc_v == 9 && github.ref == 'refs/heads/master'
149175
uses: JamesIves/github-pages-deploy-action@v4.7.3
150176
with:
151177
branch: gh-pages # The branch the action should deploy to.
@@ -157,15 +183,15 @@ jobs:
157183
- name: Rebuild documentation for tagged release
158184
env:
159185
TAGNAME: ${{github.ref_name}}
160-
if: matrix.gcc_v == 7 && startsWith(github.ref, 'refs/tags/')
186+
if: matrix.gcc_v == 9 && startsWith(github.ref, 'refs/tags/')
161187
run: |
162188
echo ${TAGNAME}
163189
rm -rf doc
164190
sed "2 s/^/version: ${TAGNAME}\n/" json-fortran.md > json-fortran.tagged.md
165191
ford --debug json-fortran.tagged.md
166192
167193
- name: Deploy documentation for tagged release
168-
if: matrix.gcc_v == 7 && startsWith(github.ref, 'refs/tags/')
194+
if: matrix.gcc_v == 9 && startsWith(github.ref, 'refs/tags/')
169195
uses: JamesIves/github-pages-deploy-action@v4.7.3
170196
with:
171197
branch: gh-pages # The branch the action should deploy to.
@@ -174,7 +200,7 @@ jobs:
174200
single-commit: true
175201

176202
- name: Upload coverage
177-
if: matrix.gcc_v == 7
203+
if: matrix.gcc_v == 9
178204
run: |
179205
rm json_*.F90-*unicode.gcov || true
180206
mv json_*.F90.gcov src/

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@ My Inspector*
3535
x64/
3636
Debug/
3737
Release/
38+
/FoBiS
3839

3940
# mac
4041
.DS_Store

src/json_value_module.F90

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11599,7 +11599,9 @@ subroutine json_print_error_message(json,io_unit)
1159911599
write(io_unit,'(A)',iostat=istat) error_msg
1160011600
if (istat/=0) then
1160111601
! in this case, just try to write to the error_unit
11602-
call integer_to_string(io_unit,int_fmt,tmp)
11602+
! [convert to IK integer, we assume this will be ok since
11603+
! normally these io units are default ints]
11604+
call integer_to_string(int(io_unit,IK),int_fmt,tmp)
1160311605
write(error_unit,'(A)',iostat=istat) 'Error writing to unit '//trim(tmp)
1160411606
write(error_unit,'(A)',iostat=istat) error_msg
1160511607
end if

0 commit comments

Comments
 (0)