-
Notifications
You must be signed in to change notification settings - Fork 3
65 lines (54 loc) · 2.17 KB
/
build.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
name: CI
on: [push, pull_request]
jobs:
Build:
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
gcc: [11] # Version of GFortran we want to use.
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: Install GFortran (MacOS)
if: ${{ contains(matrix.os, 'macos') }}
run: |
brew install gcc@${{ matrix.gcc }}
ln -s /usr/local/bin/gfortran-${{ matrix.gcc }} /usr/local/bin/gfortran
- name: Install GFortran (Linux)
if: ${{ contains(matrix.os, 'ubuntu') }}
run: |
sudo add-apt-repository ppa:ubuntu-toolchain-r/test
sudo apt-get update
sudo apt-get install -y gcc-${{ matrix.gcc }} gfortran-${{ matrix.gcc }}
sudo update-alternatives \
--install /usr/bin/gcc gcc /usr/bin/gcc-${{ matrix.gcc }} 100 \
--slave /usr/bin/gfortran gfortran /usr/bin/gfortran-${{ matrix.gcc }} \
--slave /usr/bin/gcov gcov /usr/bin/gcov-${{ matrix.gcc }}
- name: Install GFortran (Windows)
if: ${{ contains(matrix.os, 'windows') }}
run: |
Invoke-WebRequest -Uri ${{ env.DOWNLOAD }} -OutFile mingw-w64.zip
Expand-Archive mingw-w64.zip
echo "$pwd\mingw-w64\mingw64\bin" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append
env:
DOWNLOAD: "https://github.com/brechtsanders/winlibs_mingw/releases/download/11.2.0-9.0.0-ucrt-r4/winlibs-x86_64-posix-seh-gcc-11.2.0-mingw-w64ucrt-9.0.0-r4.zip"
- name: Set up Python 3.x
uses: actions/setup-python@v1 # Use pip to install latest CMake, & FORD/Jin2For, etc.
with:
python-version: ${{ matrix.python-version }}
- name: Install meson
run: pip3 install ${{ env.PACKAGES }}
env:
PACKAGES: >-
meson==0.59
ninja
- name: Configure build
run: meson setup _build --prefix=$PWD/fazang --default-library=static
- name: Build project
run: meson compile -C _build
- name: Run tests
run: meson test -C _build --print-errorlogs --no-rebuild
- name: Install project
run: meson install -C _build --no-rebuild