Skip to content

Commit c5fc77f

Browse files
Merge pull request #484 from jacobwilliams/develop
Develop
2 parents 8c12e7a + c8b26b2 commit c5fc77f

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

50 files changed

+225
-111
lines changed

.github/CONTRIBUTING.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ git rebase upstream/master
7272
```
7373
- Create a branch in your fork with a descriptive name that also includes the [issue number](https://github.com/jacobwilliams/json-fortran/issues), if applicable. For example, after forking the repo, you can run something like `git checkout -b Unicode-support-issue-35` before starting work on [issue #35 : Unicode support](https://github.com/jacobwilliams/json-fortran/issues/35)
7474
- When you're content with your changes, your commits are clean, self contained, with concise descriptive messages, and your changes compile and pass the tests, submit a pull request. We will review your changes, and may ask for certain modifications to be made.
75-
- Pull requests are tested by our [travis-ci](https://travis-ci.com/jacobwilliams/json-fortran) continuous integration system, and any errors uncovered will need to be fixed before the pull request can be merged into master.
75+
- Pull requests are tested by our [GitHub Actions](https://github.com/jacobwilliams/json-fortran/actions) continuous integration system, and any errors uncovered will need to be fixed before the pull request can be merged into master.
7676
- The JSON-Fortran library and associated documentation is released under a BSD style [license](https://github.com/jacobwilliams/json-fortran/blob/master/LICENSE). By submitting a pull request, you are agreeing to release your code under the same license. Note that code with GPL or other "copyleft" style licenses will not be accepted.
7777

7878
[top](#contributing-to-json-fortran)

.github/workflows/CI.yml

Lines changed: 129 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,129 @@
1+
name: CI
2+
3+
on: [push]
4+
5+
jobs:
6+
7+
Build:
8+
runs-on: ${{ matrix.os }}
9+
strategy:
10+
fail-fast: false
11+
matrix:
12+
os: [ubuntu-latest]
13+
gcc_v: [7,8,9,10] # Version of GFortran we want to use.
14+
python-version: [3.7]
15+
env:
16+
FC: gfortran-${{matrix.gcc_v}}
17+
GCC_V: ${{matrix.gcc_v}}
18+
19+
steps:
20+
21+
- name: Set vars
22+
id: vars
23+
run: echo ::set-output name=tag::${GITHUB_REF#refs/*/}
24+
25+
- name: Checkout code
26+
uses: actions/checkout@v2
27+
with:
28+
submodules: recursive
29+
30+
- name: Setup cmake
31+
if: contains( matrix.gcc_v, 9 )
32+
uses: jwlawson/[email protected]
33+
with:
34+
cmake-version: '3.19.x'
35+
36+
- name: Install Python
37+
uses: actions/setup-python@v1 # Use pip to install latest CMake, & FORD/Jin2For, etc.
38+
with:
39+
python-version: ${{ matrix.python-version }}
40+
41+
- name: Setup Graphviz
42+
uses: ts-graphviz/setup-graphviz@v1
43+
44+
- name: Install Python dependencies
45+
if: contains( matrix.os, 'ubuntu')
46+
run: |
47+
python -m pip install --upgrade pip
48+
pip install ford FoBiS.py pygooglechart
49+
if [ -f requirements.txt ]; then pip install -r requirements.txt; fi
50+
51+
- name: Install GFortran Linux
52+
if: contains( matrix.os, 'ubuntu')
53+
run: |
54+
sudo add-apt-repository ppa:ubuntu-toolchain-r/test
55+
sudo apt-get update
56+
sudo apt-get install -y gcc-${GCC_V} gfortran-${GCC_V}
57+
sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-${GCC_V} 100 \
58+
--slave /usr/bin/gfortran gfortran /usr/bin/gfortran-${GCC_V} \
59+
--slave /usr/bin/gcov gcov /usr/bin/gcov-${GCC_V}
60+
61+
- name: Compile_with_build
62+
if: matrix.gcc_v != 7
63+
run: |
64+
GFORTRAN=gfortran-${{matrix.gcc_v}}
65+
GCOV=gcov-${{matrix.gcc_v}}
66+
# build with build.sh, run unit tests
67+
./build.sh --skip-documentation
68+
./build.sh --skip-documentation --enable-unicode
69+
70+
- name: Compile_with_cmake
71+
# CMake build with unit tests, no documentation, with coverage analysis
72+
# No unicode so that coverage combined with the build script will cover unicode
73+
# and non-unicode code paths
74+
if: matrix.gcc_v == 9
75+
run: |
76+
GFORTRAN=gfortran-${{matrix.gcc_v}}
77+
GCOV=gcov-${{matrix.gcc_v}}
78+
mkdir cmake-build
79+
cd cmake-build
80+
cmake ..
81+
make -j 4 check
82+
83+
- name: Compile_with_build_mkdocs
84+
# build with build.sh, make documentation, run unit tests
85+
# and perform coverage analysis - used for doc deployment
86+
if: matrix.gcc_v == 7
87+
run: |
88+
GFORTRAN=gfortran-${{matrix.gcc_v}}
89+
GCOV=gcov-${{matrix.gcc_v}}
90+
./build.sh --coverage --skip-documentation
91+
./build.sh --coverage --enable-unicode
92+
93+
- name: Deploy Documentation for master
94+
if: matrix.gcc_v == 7 && github.ref == 'refs/heads/master'
95+
uses: JamesIves/[email protected]
96+
with:
97+
branch: gh-pages # The branch the action should deploy to.
98+
folder: doc # The folder the action should deploy.
99+
clean: true
100+
clean-exclude: |
101+
prev
102+
103+
- name: Rebuild documentation for tagged release
104+
env:
105+
TAGNAME: ${{ steps.vars.outputs.tag }}
106+
if: matrix.gcc_v == 7 && startsWith(github.ref, 'refs/tags/')
107+
run: |
108+
echo ${TAGNAME}
109+
rm -rf doc
110+
sed "2 s/^/version: ${TAGNAME}\n/" json-fortran.md > json-fortran.tagged.md
111+
ford --debug json-fortran.tagged.md
112+
113+
- name: Deploy documentation for tagged release
114+
env:
115+
TAGNAME: ${{ steps.vars.outputs.tag }}
116+
if: matrix.gcc_v == 7 && startsWith(github.ref, 'refs/tags/')
117+
uses: JamesIves/[email protected]
118+
with:
119+
branch: gh-pages # The branch the action should deploy to.
120+
folder: doc # The folder the action should deploy.
121+
target-folder: prev/$TAGNAME # deploy to a version-specific folder
122+
123+
- name: Upload coverage
124+
if: matrix.gcc_v == 7
125+
run: |
126+
rm json_*.F90-*unicode.gcov || true
127+
mv json_*.F90.gcov src/
128+
mv jf_test*.[fF]90.gcov src/tests/
129+
bash <(curl -s https://codecov.io/bash) -v -X $GCOV

.gitignore

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,4 +34,7 @@ My Amplifier*
3434
My Inspector*
3535
x64/
3636
Debug/
37-
Release/
37+
Release/
38+
39+
# mac
40+
.DS_Store
File renamed without changes.

.travis-old/deploy.sh

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
#!/bin/bash
2+
# Script to deploy documentation after successful build of master branch or tag
3+
# If running under travis-ci this will automatically deploy updates to the master branch's
4+
# documentation on build events for the master branch, and will add/update documentation for
5+
# any new/updated tags that are pushed.
6+
set -o errexit
7+
set -o verbose
8+
if [ "$TRAVIS" ]; then #running under travis
9+
if $TRAVIS_SECURE_ENV_VARS ; then
10+
# only try to update master's development documentation
11+
if [ "$TRAVIS_BRANCH" = "master" ] && \
12+
[ "$TRAVIS_PULL_REQUEST" = "false" ] && \
13+
[ "$(ls -A "$TRAVIS_BUILD_DIR/doc")" ] ; then #not empty
14+
git clone -q --branch=gh-pages "https://${GH_TOKEN}@github.com/$TRAVIS_REPO_SLUG" gh-pages >/dev/null 2>&1
15+
cd gh-pages || exit 1
16+
rm -rf -- css fonts graphs interface lists module proc search.html src type favicon.png index.html \
17+
js media page program sourcefile tipuesearch || true
18+
cp -r "$TRAVIS_BUILD_DIR"/doc/* .
19+
git add -A || true # Add all the new files
20+
git commit -m "Development documentation updated by travis job $TRAVIS_JOB_NUMBER for commits $TRAVIS_COMMIT_RANGE" || true
21+
git push -fq origin gh-pages > /dev/null 2>&1 || true
22+
fi
23+
# If publishing a new/updated tag, deploy its documentation
24+
if [ "$TRAVIS_TAG" ] && [ "$(ls -A "$TRAVIS_BUILD_DIR/doc")" ] ; then #not empty
25+
cd "$TRAVIS_BUILD_DIR" || exit 1
26+
git clone -q --branch=gh-pages "https://${GH_TOKEN}@github.com/$TRAVIS_REPO_SLUG" gh-pages >/dev/null 2>&1
27+
sed "2 s/^/version: ${TRAVIS_TAG}\n/" json-fortran.md > json-fortran.tagged.md
28+
head json-fortran.tagged.md # Debug output
29+
# rebuild FORD documentation without pages, with version info, wiping out any existing tag folder
30+
ford --debug -o "gh-pages/$TRAVIS_TAG" json-fortran.tagged.md
31+
cd gh-pages || exit 1
32+
git add -A # add all new files in $TRAVIS_TAG/
33+
git commit -m "Tag/release documentation updated by travis job $TRAVIS_JOB_NUMBER for tag $TRAVIS_TAG $TRAVIS_COMMIT"
34+
git push -f -q origin gh-pages >/dev/null 2>&1
35+
fi
36+
fi
37+
fi

CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -267,7 +267,7 @@ if ( NOT SKIP_DOC_GEN )
267267
endif ()
268268
else () # Not found
269269
message ( WARNING
270-
"FORD not found! Please set the CMake cache variable FORD to point to the installed FORD executable, and reconfigure or disable building the documentation. FORD can be installed from PYPI with `sudo pip install FORD` or from <https://github.com/cmacmackin/ford> If you do not wish to install FORD and build the JSON-Fortran documentation, then please set the CMake cache variable SKIP_DOC_GEN to TRUE." )
270+
"FORD not found! Please set the CMake cache variable FORD to point to the installed FORD executable, and reconfigure or disable building the documentation. FORD can be installed from PYPI with `pip install ford` or from <https://github.com/Fortran-FOSS-Programmers/ford> If you do not wish to install FORD and build the JSON-Fortran documentation, then please set the CMake cache variable SKIP_DOC_GEN to TRUE." )
271271
endif ()
272272
endif ()
273273

LICENSE

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
JSON-Fortran: A Fortran 2008 JSON API
22
<https://github.com/jacobwilliams/json-fortran>
33

4-
Copyright (c) 2014-2020, Jacob Williams
4+
Copyright (c) 2014-2021, Jacob Williams
55
All rights reserved.
66

77
Redistribution and use in source and binary forms, with or without modification,

README.md

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ A Fortran 2008 JSON API
2121

2222
Status
2323
------
24-
[![Build Status](https://img.shields.io/travis/jacobwilliams/json-fortran/master.svg?style=plastic)](https://travis-ci.com/github/jacobwilliams/json-fortran)
24+
![Build Status](https://github.com/jacobwilliams/json-fortran/actions/workflows/CI.yml/badge.svg)
2525
[![GitHub issues](https://img.shields.io/github/issues/jacobwilliams/json-fortran.png?style=plastic)](https://github.com/jacobwilliams/json-fortran/issues)
2626
[![Codecov](https://codecov.io/gh/jacobwilliams/json-fortran/branch/master/graph/badge.svg)](https://codecov.io/gh/jacobwilliams/json-fortran)
2727

@@ -168,7 +168,6 @@ Miscellaneous
168168

169169
* JSON-Fortran is a fork and extensive upgrade of the Fortran 95 [FSON](https://github.com/josephalevin/fson) code. The reason for the split was to be able to incorporate object-oriented and other nice features of the Fortran 2003 and 2008 standards. Many thanks to the original authors of FSON.
170170
* For more information about JSON, see: <http://www.json.org/>
171-
* [json-fortran on Travis CI](https://travis-ci.com/jacobwilliams/json-fortran)
172171
* [json-fortran on Codecov.IO](https://codecov.io/gh/jacobwilliams/json-fortran)
173172

174173
[top](#json-fortran)

build.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -390,7 +390,7 @@ if [[ $JF_SKIP_DOCS != [yY]* ]]; then
390390
echo "$FPP" > .PREPROCESSOR # Override via include in project file, until FORD gets CLI for this
391391
ford --debug "${MACRO_FLAG[@]}" -p "$PAGESDIR" "$FORDMD"
392392
else
393-
echo "FORD not found! Install using: sudo pip install ford"
393+
echo "FORD not found! Install using: pip install ford"
394394
fi
395395
else
396396
echo "Skip building documentation since \$JF_SKIP_DOCS has been set to ${JF_SKIP_DOCS}."

deploy.sh

Lines changed: 0 additions & 37 deletions
This file was deleted.

0 commit comments

Comments
 (0)