|
| 1 | +name: CI |
| 2 | + |
| 3 | +on: [push] |
| 4 | + |
| 5 | +env: |
| 6 | + CI: "ON" |
| 7 | + |
| 8 | +jobs: |
| 9 | + |
| 10 | + Build: |
| 11 | + runs-on: ${{ matrix.os }} |
| 12 | + strategy: |
| 13 | + fail-fast: false |
| 14 | + matrix: |
| 15 | + os: [ubuntu-latest] |
| 16 | + gcc_v: [7,8,9] # Version of GFortran we want to use. |
| 17 | + python-version: [3.7] |
| 18 | + env: |
| 19 | + FC: gfortran-${{ matrix.gcc_v }} |
| 20 | + GCC_V: ${{ matrix.gcc_v }} |
| 21 | + |
| 22 | + steps: |
| 23 | + - name: Checkout code |
| 24 | + uses: actions/checkout@v2 |
| 25 | + with: |
| 26 | + submodules: recursive |
| 27 | + |
| 28 | + - name: Setup cmake |
| 29 | + if: contains( matrix.gcc_v, 7 ) |
| 30 | + |
| 31 | + with: |
| 32 | + cmake-version: '3.19.x' |
| 33 | + |
| 34 | + - name: Install Python |
| 35 | + uses: actions/setup-python@v1 # Use pip to install latest CMake, & FORD/Jin2For, etc. |
| 36 | + with: |
| 37 | + python-version: ${{ matrix.python-version }} |
| 38 | + |
| 39 | + - name: Setup Graphviz |
| 40 | + uses: ts-graphviz/setup-graphviz@v1 |
| 41 | + |
| 42 | + - name: Install Python dependencies |
| 43 | + if: contains( matrix.os, 'ubuntu') |
| 44 | + run: | |
| 45 | + python -m pip install --upgrade pip |
| 46 | + pip install ford FoBiS.py pygooglechart |
| 47 | + if [ -f requirements.txt ]; then pip install -r requirements.txt; fi |
| 48 | +
|
| 49 | + - name: Install GFortran Linux |
| 50 | + if: contains( matrix.os, 'ubuntu') |
| 51 | + run: | |
| 52 | + sudo add-apt-repository ppa:ubuntu-toolchain-r/test |
| 53 | + sudo apt-get update |
| 54 | + sudo apt-get install -y gcc-${GCC_V} gfortran-${GCC_V} |
| 55 | + sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-${GCC_V} 100 \ |
| 56 | + --slave /usr/bin/gfortran gfortran /usr/bin/gfortran-${GCC_V} \ |
| 57 | + --slave /usr/bingcov gcov /usr/bin/gcov-${GCC_V} |
| 58 | +
|
| 59 | + - name: Compile_with_cmake |
| 60 | + if: matrix.gcc_v == 7 |
| 61 | + run: | |
| 62 | + - GFORTRAN=gfortran-${{ matrix.gcc_v }} |
| 63 | + - GCOV=gcov-${{ matrix.gcc_v }} |
| 64 | + # CMake build with unit tests, no documentation, with coverage analysis |
| 65 | + # No unicode so that coverage combined with the build script will cover unicode |
| 66 | + # and non-unicode code paths |
| 67 | + - mkdir cmake-build |
| 68 | + - cd cmake-build |
| 69 | + - cmake .. |
| 70 | + - make -j 4 check |
| 71 | +
|
| 72 | + - name: Compile_with_build |
| 73 | + if: matrix.gcc_v == 8 |
| 74 | + run: | |
| 75 | + - GFORTRAN=gfortran-${{ matrix.gcc_v }} |
| 76 | + - GCOV=gcov-${{ matrix.gcc_v }} |
| 77 | + # build with build.sh, run unit tests |
| 78 | + - ./build.sh --skip-documentation |
| 79 | + - ./build.sh --skip-documentation --enable-unicode |
| 80 | + - CODE_COVERAGE="no" |
| 81 | + - DEPLOY_DOCUMENTATION="no" |
| 82 | +
|
| 83 | + - name: Compile_with_build |
| 84 | + if: matrix.gcc_v == 9 |
| 85 | + run: | |
| 86 | + # build with build.sh, make documentation, run unit tests |
| 87 | + # and perform coverage analysis |
| 88 | + - ./build.sh --coverage --skip-documentation |
| 89 | + - ./build.sh --coverage --enable-unicode" |
| 90 | + - CODE_COVERAGE="yes" |
| 91 | + - DEPLOY_DOCUMENTATION="yes" |
| 92 | +
|
| 93 | +
|
| 94 | + # - name: Run tests |
| 95 | + # run: | |
| 96 | + # ./bin/slsqp_test |
| 97 | + # ./bin/slsqp_test_2 |
| 98 | + # ./bin/slsqp_test_3 |
| 99 | + # ./bin/slsqp_test_71 |
| 100 | + # ./bin/slsqp_test_stopping_criterion |
| 101 | + |
| 102 | + # - name: Build documentation |
| 103 | + # run: ford ./json-fortran.md |
| 104 | + |
| 105 | + # - name: Deploy Documentation |
| 106 | + # if: github.ref == 'refs/heads/master' |
| 107 | + # uses: JamesIves/[email protected] |
| 108 | + # with: |
| 109 | + # branch: gh-pages # The branch the action should deploy to. |
| 110 | + # folder: doc # The folder the action should deploy. |
0 commit comments