|
| 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: [10] # Version of GFortran we want to use. |
| 12 | + python-version: [3.7] |
| 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@v2 |
| 20 | + with: |
| 21 | + submodules: recursive |
| 22 | + |
| 23 | + - name: Set up Python 3.x |
| 24 | + uses: actions/setup-python@v1 # Use pip to install latest CMake, & FORD/Jin2For, etc. |
| 25 | + with: |
| 26 | + python-version: ${{ matrix.python-version }} |
| 27 | + |
| 28 | + - name: Setup Graphviz |
| 29 | + uses: ts-graphviz/setup-graphviz@v1 |
| 30 | + |
| 31 | + - name: Setup Fortran Package Manager |
| 32 | + uses: fortran-lang/setup-fpm@v3 |
| 33 | + with: |
| 34 | + github-token: ${{ secrets.GITHUB_TOKEN }} |
| 35 | + |
| 36 | + - name: Install Python dependencies |
| 37 | + if: contains( matrix.os, 'ubuntu') |
| 38 | + run: | |
| 39 | + python -m pip install --upgrade pip |
| 40 | + pip install matplotlib ford |
| 41 | + if [ -f requirements.txt ]; then pip install -r requirements.txt; fi |
| 42 | +
|
| 43 | + - name: Install GFortran Linux |
| 44 | + if: contains( matrix.os, 'ubuntu') |
| 45 | + run: | |
| 46 | + sudo add-apt-repository ppa:ubuntu-toolchain-r/test |
| 47 | + sudo apt-get update |
| 48 | + sudo apt-get install -y gcc-${GCC_V} gfortran-${GCC_V} |
| 49 | + sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-${GCC_V} 100 \ |
| 50 | + --slave /usr/bin/gfortran gfortran /usr/bin/gfortran-${GCC_V} \ |
| 51 | + --slave /usr/bingcov gcov /usr/bin/gcov-${GCC_V} |
| 52 | + # sudo apt-get install -y libblas-dev liblapack-dev |
| 53 | +
|
| 54 | + - name: Compile |
| 55 | + run: fpm build --profile release |
| 56 | + |
| 57 | + - name: Run test |
| 58 | + run: fpm test |
| 59 | + |
| 60 | + - name: Build documentation |
| 61 | + run: ford ./fortran-csv-module.md |
| 62 | + |
| 63 | + - name: Deploy Documentation |
| 64 | + if: github.ref == 'refs/heads/master' |
| 65 | + |
| 66 | + with: |
| 67 | + branch: gh-pages # The branch the action should deploy to. |
| 68 | + folder: doc # The folder the action should deploy. |
0 commit comments