|
| 1 | +name: CI |
| 2 | +on: [push] |
| 3 | +jobs: |
| 4 | + |
| 5 | + Build: |
| 6 | + runs-on: ${{ matrix.os }} |
| 7 | + strategy: |
| 8 | + fail-fast: false |
| 9 | + matrix: |
| 10 | + os: [ubuntu-latest] |
| 11 | + gcc_v: [9] # Version of GFortran we want to use. |
| 12 | + env: |
| 13 | + FC: gfortran-${{ matrix.gcc_v }} |
| 14 | + GCC_V: ${{ matrix.gcc_v }} |
| 15 | + |
| 16 | + steps: |
| 17 | + - name: Checkout code |
| 18 | + uses: actions/checkout@v1 |
| 19 | + |
| 20 | + - name: Set up Python 3.x |
| 21 | + uses: actions/setup-python@v1 # Use pip to install latest CMake, & FORD/Jin2For, etc. |
| 22 | + with: |
| 23 | + python-version: 3.x |
| 24 | + |
| 25 | + - name: Install other tools |
| 26 | + if: contains( matrix.os, 'ubuntu') |
| 27 | + run: | |
| 28 | + sudo apt-get install graphviz |
| 29 | + sudo -H pip install numpy |
| 30 | + sudo -H pip install ford && ford --version |
| 31 | + sudo -H pip install matplotlib |
| 32 | +
|
| 33 | + - name: Install GFortran Linux |
| 34 | + if: contains( matrix.os, 'ubuntu') |
| 35 | + run: | |
| 36 | + sudo add-apt-repository ppa:ubuntu-toolchain-r/test |
| 37 | + sudo apt-get update |
| 38 | + sudo apt-get install -y gcc-${GCC_V} gfortran-${GCC_V} |
| 39 | + sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-${GCC_V} 100 \ |
| 40 | + --slave /usr/bin/gfortran gfortran /usr/bin/gfortran-${GCC_V} \ |
| 41 | + --slave /usr/bingcov gcov /usr/bin/gcov-${GCC_V} |
| 42 | +
|
| 43 | + - name: Compile |
| 44 | + run: | |
| 45 | + mkdir bin |
| 46 | + gfortran -O2 ./src/pyplot_module.f90 ./src/tests/test.f90 -o ./bin/test |
| 47 | +
|
| 48 | + - name: Run test |
| 49 | + run: ./bin/test |
| 50 | + |
| 51 | + - name: Build documentation |
| 52 | + run: ford ./pyplot-fortran.md |
| 53 | + |
| 54 | + - name: Deploy Documentation |
| 55 | + if: github.ref == 'refs/heads/master' |
| 56 | + |
| 57 | + with: |
| 58 | + branch: gh-pages # The branch the action should deploy to. |
| 59 | + folder: doc # The folder the action should deploy. |
0 commit comments