-
Notifications
You must be signed in to change notification settings - Fork 0
58 lines (48 loc) · 1.45 KB
/
build-and-test.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
name: Build and Test
on: [push, pull_request]
jobs:
build-and-test:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-22.04, macOS-latest, windows-latest]
env:
GCC_V: 12
steps:
- name: Checkout code
uses: actions/checkout@v3
- uses: fortran-lang/setup-fpm@v5
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
- name: Install Dependencies Ubuntu
if: contains(matrix.os, 'ubuntu')
run: |
sudo apt-get update
sudo apt install -y gfortran-${GCC_V}
sudo update-alternatives --install /usr/bin/gfortran gfortran /usr/bin/gfortran-${GCC_V} 100
- name: Install Dependencies MacOS
if: contains(matrix.os, 'macos')
run: |
brew install gcc@${GCC_V}
sudo ln -s $(which gfortran-${GCC_V}) $(dirname $(which gfortran-${GCC_V}))/gfortran
- name: Install Dependencies Windows
if: contains(matrix.os, 'windows')
uses: msys2/setup-msys2@v2
with:
update: true
path-type: inherit
install: >-
mingw-w64-x86_64-gcc-fortran
- name: Build and Test Linux and MacOS
if: contains(matrix.os, 'ubuntu') || contains(matrix.os, 'macos')
run: |
which gfortran
gfortran --version
fpm test
- name: Build and Test Windows
if: contains(matrix.os, 'windows')
shell: msys2 {0}
run: |
which gfortran
gfortran --version
fpm test