|
| 1 | +name: CI |
| 2 | + |
| 3 | +on: [push] |
| 4 | + |
| 5 | +jobs: |
| 6 | + Build: |
| 7 | + runs-on: ${{ matrix.os }} |
| 8 | + strategy: |
| 9 | + fail-fast: false |
| 10 | + matrix: |
| 11 | + os: [ubuntu-latest] |
| 12 | + gcc_v: [9, 10] # Version of GFortran we want to use. |
| 13 | + env: |
| 14 | + FC: gfortran-${{ matrix.gcc_v }} |
| 15 | + GCC_V: ${{ matrix.gcc_v }} |
| 16 | + |
| 17 | + steps: |
| 18 | + - name: Checkout code |
| 19 | + uses: actions/checkout@v1 |
| 20 | + |
| 21 | + - name: Set up Python 3.x |
| 22 | + uses: actions/setup-python@v1 # Use pip to install latest CMake, & FORD/Jin2For, etc. |
| 23 | + with: |
| 24 | + python-version: 3.x |
| 25 | + |
| 26 | + - name: Install other tools |
| 27 | + if: contains( matrix.os, 'ubuntu') |
| 28 | + run: | |
| 29 | + sudo apt-get install graphviz |
| 30 | + sudo -H pip install FoBiS.py && FoBiS.py --version |
| 31 | + sudo -H pip install ford==5.0.6 && ford --version |
| 32 | + sudo -H pip install --upgrade markdown==2.6.9 |
| 33 | + sudo -H pip install matplotlib |
| 34 | +
|
| 35 | + - name: Install GFortran Linux |
| 36 | + if: contains( matrix.os, 'ubuntu') |
| 37 | + run: | |
| 38 | + sudo add-apt-repository ppa:ubuntu-toolchain-r/test |
| 39 | + sudo apt-get update |
| 40 | + sudo apt-get install -y gcc-${GCC_V} gfortran-${GCC_V} |
| 41 | + sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-${GCC_V} 100 \ |
| 42 | + --slave /usr/bin/gfortran gfortran /usr/bin/gfortran-${GCC_V} \ |
| 43 | + --slave /usr/bingcov gcov /usr/bin/gcov-${GCC_V} |
| 44 | +
|
| 45 | + - name: Build and compile |
| 46 | + run: | |
| 47 | + FoBiS.py build -compiler gnu -cflags "-c -O2 -std=f2008" -dbld ./lib/ -s ./src/ -dmod ./ -dobj ./ -t pyplot_module.f90 -o libpyplot.a -mklib static -colors |
| 48 | + FoBiS.py build -compiler gnu -cflags "-c -O2 -std=f2008" -dbld ./bin/ -s ./src/tests/ -dmod ./ -dobj ./ -colors -libs ./lib/libpyplot.a --include ./lib/ |
| 49 | +
|
| 50 | + - name: catch build fail |
| 51 | + run: cmake --build build --verbose --parallel 1 |
| 52 | + if: failure() |
| 53 | + |
| 54 | + - name: test |
| 55 | + run: ./bin/test |
| 56 | + |
| 57 | + - name: Install project |
| 58 | + run: | |
| 59 | + git config --global user.name "TRAVIS-CI-for-$(git --no-pager show -s --format='%cn' $TRAVIS_COMMIT)" |
| 60 | + git config --global user.email "$(git --no-pager show -s --format='%ce' $TRAVIS_COMMIT)" |
| 61 | + git clone -q --branch=gh-pages "https://${GH_TOKEN}@github.com/$TRAVIS_REPO_SLUG" gh-pages >/dev/null 2>&1 |
| 62 | + rm -rf gh-pages/* |
| 63 | + ford ./pyplot-fortran.md |
| 64 | + cp -rf ./doc/* gh-pages/ |
| 65 | + cd gh-pages/ |
| 66 | + git add -f --all * || true |
| 67 | + git commit -m "Travis CI autocommit from Travis job $TRAVIS_JOB_NUMBER for tag $TRAVIS_TAG $TRAVIS_COMMIT" || true |
| 68 | + git push -fq origin gh-pages > /dev/null 2>&1 || true |
0 commit comments