Skip to content

Commit d3906c8

Browse files
committed
working on CI doc deploy
1 parent f14c755 commit d3906c8

File tree

2 files changed

+38
-42
lines changed

2 files changed

+38
-42
lines changed

.github/workflows/CI.yml

Lines changed: 17 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -58,18 +58,6 @@ jobs:
5858
--slave /usr/bin/gfortran gfortran /usr/bin/gfortran-${GCC_V} \
5959
--slave /usr/bin/gcov gcov /usr/bin/gcov-${GCC_V}
6060
61-
- name: Compile_with_build_mkdocs
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, make documentation, run unit tests
67-
# and perform coverage analysis
68-
./build.sh --coverage --skip-documentation
69-
./build.sh --coverage --enable-unicode
70-
CODE_COVERAGE="yes"
71-
DEPLOY_DOCUMENTATION="yes"
72-
7361
- name: Compile_with_build
7462
if: matrix.gcc_v != 7
7563
run: |
@@ -78,24 +66,32 @@ jobs:
7866
# build with build.sh, run unit tests
7967
./build.sh --skip-documentation
8068
./build.sh --skip-documentation --enable-unicode
81-
CODE_COVERAGE="no"
82-
DEPLOY_DOCUMENTATION="no"
8369
8470
- 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
8574
if: matrix.gcc_v == 9
8675
run: |
8776
GFORTRAN=gfortran-${{matrix.gcc_v}}
8877
GCOV=gcov-${{matrix.gcc_v}}
89-
# CMake build with unit tests, no documentation, with coverage analysis
90-
# No unicode so that coverage combined with the build script will cover unicode
91-
# and non-unicode code paths
9278
mkdir cmake-build
9379
cd cmake-build
9480
cmake ..
9581
make -j 4 check
9682
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+
9793
- name: Deploy Documentation for master
98-
if: github.ref == 'refs/heads/master' && $DEPLOY_DOCUMENTATION == 'yes'
94+
if: matrix.gcc_v == 7 && github.ref == 'refs/heads/master'
9995
uses: JamesIves/[email protected]
10096
with:
10197
branch: gh-pages # The branch the action should deploy to.
@@ -107,7 +103,7 @@ jobs:
107103
- name: Rebuild documentation for tagged release
108104
env:
109105
TAGNAME: ${{ steps.vars.outputs.tag }}
110-
if: $DEPLOY_DOCUMENTATION == 'yes' && startsWith(github.ref, 'refs/tags/')
106+
if: matrix.gcc_v == 7 && startsWith(github.ref, 'refs/tags/')
111107
run: |
112108
echo ${TAGNAME}
113109
rm -rf doc
@@ -117,15 +113,15 @@ jobs:
117113
- name: Deploy documentation for tagged release
118114
env:
119115
TAGNAME: ${{ steps.vars.outputs.tag }}
120-
if: $DEPLOY_DOCUMENTATION == 'yes' && startsWith(github.ref, 'refs/tags/')
116+
if: matrix.gcc_v == 7 && startsWith(github.ref, 'refs/tags/')
121117
uses: JamesIves/[email protected]
122118
with:
123119
branch: gh-pages # The branch the action should deploy to.
124120
folder: doc # The folder the action should deploy.
125121
target-folder: prev/$TAGNAME # deploy to a version-specific folder
126122

127123
- name: Upload coverage
128-
if: $CODE_COVERAGE == 'yes'
124+
if: matrix.gcc_v == 7
129125
run: |
130126
rm json_*.F90-*unicode.gcov || true
131127
mv json_*.F90.gcov src/

.travis-old/deploy.sh

Lines changed: 21 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -7,31 +7,31 @@ set -o errexit
77
set -o verbose
88
if [ "$TRAVIS" ]; then #running under travis
99
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
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
1414
git clone -q --branch=gh-pages "https://${GH_TOKEN}@github.com/$TRAVIS_REPO_SLUG" gh-pages >/dev/null 2>&1
1515
cd gh-pages || exit 1
16-
rm -rf -- css fonts 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/* .
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/* .
1919
git add -A || true # Add all the new files
2020
git commit -m "Development documentation updated by travis job $TRAVIS_JOB_NUMBER for commits $TRAVIS_COMMIT_RANGE" || true
2121
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
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
3636
fi
3737
fi

0 commit comments

Comments
 (0)