77 strategy :
88 fail-fast : false
99 matrix :
10+ build : [fpm, meson]
1011 os : [ubuntu-latest, macos-latest, windows-latest]
1112 gcc : [10] # Version of GFortran we want to use.
12-
13+ defaults :
14+ run :
15+ shell : ${{ contains(matrix.os, 'windows') && 'powershell' || 'bash -l {0}' }}
16+ env :
17+ FC : gfortran
18+ CC : gcc
19+ FPM_FC : gfortran
20+ FPM_CC : gcc
1321 steps :
1422 - name : Checkout code
1523 uses : actions/checkout@v2
2129 run : |
2230 brew install gcc@${{ matrix.gcc }}
2331 ln -s /usr/local/bin/gfortran-${{ matrix.gcc }} /usr/local/bin/gfortran
32+ ln -s /usr/local/bin/gcc-${{ matrix.gcc }} /usr/local/bin/gcc
2433
2534 - name : Install GFortran (Linux)
2635 if : ${{ contains(matrix.os, 'ubuntu') }}
@@ -36,35 +45,50 @@ jobs:
3645 Invoke-WebRequest -Uri ${{ env.DOWNLOAD }} -OutFile mingw-w64.zip
3746 Expand-Archive mingw-w64.zip
3847 echo "$pwd\mingw-w64\mingw64\bin" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append
48+ shell : pwsh
3949 env :
4050 DOWNLOAD : " https://github.com/brechtsanders/winlibs_mingw/releases/download/10.3.0-12.0.0-9.0.0-r2/winlibs-x86_64-posix-seh-gcc-10.3.0-mingw-w64-9.0.0-r2.zip"
4151
42- - name : Setup Fortran Package Manager
43- uses : fortran-lang/setup-fpm@v3
52+ - name : Install dependencies
53+ uses : mamba-org/provision-with-micromamba@main
4454 with :
45- fpm-version : ' v0.3.0 '
55+ environment-file : config/ci/${{ matrix.build }}-env.yaml
4656
47- - name : Compile
57+ - name : Compile (fpm)
58+ if : ${{ matrix.build == 'fpm' }}
4859 run : fpm build --profile release
4960
50- - name : Run test
61+ - name : Run test (fpm)
62+ if : ${{ matrix.build == 'fpm' }}
5163 run : fpm test
5264
53- - name : Run examples
65+ - name : Run examples (fpm)
66+ if : ${{ matrix.build == 'fpm' }}
5467 run : fpm run --example --all
5568
56- Docs :
57- runs-on : ${{ matrix.os }}
58- strategy :
59- fail-fast : false
60- matrix :
61- os : [ubuntu-latest]
62- gcc_v : [9] # Version of GFortran we want to use.
63- python-version : [3.7]
64- env :
65- FC : gfortran-${{ matrix.gcc_v }}
66- GCC_V : ${{ matrix.gcc_v }}
69+ - name : Setup build (meson)
70+ if : ${{ matrix.build == 'meson' }}
71+ run : >-
72+ meson setup _build
73+ --prefix=${{ contains(matrix.os, 'windows') && '$pwd\_dist' || '$PWD/_dist' }}
74+
75+ - name : Compile project (meson)
76+ if : ${{ matrix.build == 'meson' }}
77+ run : meson compile -C _build
6778
79+ - name : Run testsuite (meson)
80+ if : ${{ matrix.build == 'meson' }}
81+ run : meson test -C _build --no-rebuild --print-errorlogs
82+
83+ - name : Install project (meson)
84+ if : ${{ matrix.build == 'meson' }}
85+ run : meson install -C _build --no-rebuild
86+
87+ Docs :
88+ runs-on : ubuntu-latest
89+ defaults :
90+ run :
91+ shell : bash -l {0}
6892 steps :
6993 - id : deploy-on-push
7094 run :
@@ -77,30 +101,10 @@ jobs:
77101 with :
78102 submodules : recursive
79103
80- - name : Set up Python 3.x
81- uses : actions/setup-python@v1 # Use pip to install latest CMake, & FORD/Jin2For, etc.
104+ - name : Install dependencies
105+ uses : mamba-org/provision-with-micromamba@main
82106 with :
83- python-version : ${{ matrix.python-version }}
84-
85- - name : Setup Graphviz
86- uses : ts-graphviz/setup-graphviz@v1
87-
88- - name : Install Python dependencies
89- if : ${{ contains( matrix.os, 'ubuntu') }}
90- run : |
91- python -m pip install --upgrade pip
92- pip install numpy matplotlib ford
93- if [ -f requirements.txt ]; then pip install -r requirements.txt; fi
94-
95- - name : Install GFortran Linux
96- if : ${{ contains( matrix.os, 'ubuntu') }}
97- run : |
98- sudo add-apt-repository ppa:ubuntu-toolchain-r/test
99- sudo apt-get update
100- sudo apt-get install -y gcc-${GCC_V} gfortran-${GCC_V}
101- sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-${GCC_V} 100 \
102- --slave /usr/bin/gfortran gfortran /usr/bin/gfortran-${GCC_V} \
103- --slave /usr/bingcov gcov /usr/bin/gcov-${GCC_V}
107+ environment-file : config/ci/docs-env.yaml
104108
105109 - name : Build documentation
106110 run : ford ./minpack.md
0 commit comments