7
7
strategy :
8
8
fail-fast : false
9
9
matrix :
10
+ build : [fpm, meson]
10
11
os : [ubuntu-latest, macos-latest, windows-latest]
11
12
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
13
21
steps :
14
22
- name : Checkout code
15
23
uses : actions/checkout@v2
21
29
run : |
22
30
brew install gcc@${{ matrix.gcc }}
23
31
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
24
33
25
34
- name : Install GFortran (Linux)
26
35
if : ${{ contains(matrix.os, 'ubuntu') }}
@@ -36,35 +45,50 @@ jobs:
36
45
Invoke-WebRequest -Uri ${{ env.DOWNLOAD }} -OutFile mingw-w64.zip
37
46
Expand-Archive mingw-w64.zip
38
47
echo "$pwd\mingw-w64\mingw64\bin" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append
48
+ shell : pwsh
39
49
env :
40
50
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"
41
51
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
44
54
with :
45
- fpm-version : ' v0.3.0 '
55
+ environment-file : config/ci/${{ matrix.build }}-env.yaml
46
56
47
- - name : Compile
57
+ - name : Compile (fpm)
58
+ if : ${{ matrix.build == 'fpm' }}
48
59
run : fpm build --profile release
49
60
50
- - name : Run test
61
+ - name : Run test (fpm)
62
+ if : ${{ matrix.build == 'fpm' }}
51
63
run : fpm test
52
64
53
- - name : Run examples
65
+ - name : Run examples (fpm)
66
+ if : ${{ matrix.build == 'fpm' }}
54
67
run : fpm run --example --all
55
68
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
67
78
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}
68
92
steps :
69
93
- id : deploy-on-push
70
94
run :
@@ -77,30 +101,10 @@ jobs:
77
101
with :
78
102
submodules : recursive
79
103
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
82
106
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
104
108
105
109
- name : Build documentation
106
110
run : ford ./minpack.md
0 commit comments