-
Notifications
You must be signed in to change notification settings - Fork 11
136 lines (121 loc) · 4.79 KB
/
build.yml
File metadata and controls
136 lines (121 loc) · 4.79 KB
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
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
name: Build
on: [push, pull_request]
jobs:
build:
name: ${{ matrix.compiler }}-${{ matrix.version }} (${{ matrix.os }})
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [macos-13, macos-14, ubuntu-22.04, ubuntu-24.04]
compiler: [ gfortran ]
version: [ 12, 13, 14 ]
extra_flags: [ -ffree-line-length-0 ]
include:
# https://hub.docker.com/r/phhargrove/llvm-flang/tags
- os: ubuntu-24.04
compiler: flang
version: 20
extra_flags: -g
container: phhargrove/llvm-flang:20.1.0-1
- os: ubuntu-24.04
compiler: flang
version: 19
extra_flags: -g -mmlir -allow-assumed-rank
container: phhargrove/llvm-flang:19.1.1-1
# - os: ubuntu-24.04
# compiler: flang
# version: new
# container: gmao/llvm-flang:latest
# extra_flags: -g
- os: ubuntu-24.04
compiler: ifx
version: 2025.1.0
error_stop_code: 128
extra_flags: -g
container: intel/fortran-essentials:2025.1.0-0-devel-ubuntu24.04
#container: intel/oneapi-hpckit:2025.1.0-0-devel-ubuntu24.04
- os: ubuntu-22.04
compiler: ifx
version: 2025.0.0
error_stop_code: 128
extra_flags: -g
container: intel/fortran-essentials:2025.0.0-0-devel-ubuntu22.04
exclude:
- os: ubuntu-22.04
version: 13 # no package available
- os: ubuntu-22.04
version: 14 # no package available
container:
image: ${{ matrix.container }}
env:
GCC_VERSION: ${{ matrix.version }}
FC: ${{ matrix.compiler }}
FPM_FLAGS: --profile release --verbose
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Install Dependencies Ubuntu
if: ${{ contains(matrix.os, 'ubuntu') && matrix.compiler == 'gfortran' && 0 }}
run: |
sudo apt-get update
sudo apt list -a 'gfortran-*'
sudo apt install -y gfortran-${GCC_VERSION} build-essential
sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-${GCC_VERSION} 100 \
--slave /usr/bin/gfortran gfortran /usr/bin/gfortran-${GCC_VERSION}
- name: Setup Compilers
run: |
set -x
if test "$FC" = "flang" ; then \
echo "FPM_FC=flang-new" >> "$GITHUB_ENV" ; \
elif test "$FC" = "ifx" ; then \
echo "FPM_FC=ifx" >> "$GITHUB_ENV" ; \
else \
echo "FPM_FC=gfortran-${GCC_VERSION}" >> "$GITHUB_ENV" ; \
fi
if test -n "${{ matrix.error_stop_code }}" ; then \
echo "ERROR_STOP_CODE=${{ matrix.error_stop_code }}" >> "$GITHUB_ENV" ; \
else \
echo "ERROR_STOP_CODE=1" >> "$GITHUB_ENV" ; \
fi
- name: Setup FPM
uses: fortran-lang/setup-fpm@main
if: ${{ matrix.os != 'macos-14' }}
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
- name: Build FPM
if: ${{ matrix.os == 'macos-14' }} # no arm64 fpm distro, build from source
run: |
set -x
curl --retry 5 -LOsS https://github.com/fortran-lang/fpm/releases/download/v0.11.0/fpm-0.11.0.F90
mkdir fpm-temp
gfortran-14 -o fpm-temp/fpm fpm-0.11.0.F90
echo "PATH=`pwd`/fpm-temp:${PATH}" >> "$GITHUB_ENV"
- name: Version info
run: |
set -x
echo == TOOL VERSIONS ==
uname -a
if test -r /etc/os-release ; then cat /etc/os-release ; fi
${FPM_FC} --version
fpm --version
- name: Build and Test (Assertions OFF)
run: |
set -x
fpm test ${FPM_FLAGS} --flag "${{ matrix.EXTRA_FLAGS }}"
fpm run --example false-assertion ${FPM_FLAGS} --flag "${{ matrix.EXTRA_FLAGS }}"
fpm run --example invoke-via-macro ${FPM_FLAGS} --flag "${{ matrix.EXTRA_FLAGS }}"
- name: Build and Test (Assertions ON)
env:
FPM_FLAGS: ${{ env.FPM_FLAGS }} --flag -DASSERTIONS
run: |
set -x
fpm test ${FPM_FLAGS} --flag "${{ matrix.EXTRA_FLAGS }}"
( set +e ; fpm run --example false-assertion ${FPM_FLAGS} --flag "${{ matrix.EXTRA_FLAGS }}" ; test $? = $ERROR_STOP_CODE )
( set +e ; fpm run --example invoke-via-macro ${FPM_FLAGS} --flag "${{ matrix.EXTRA_FLAGS }}" ; test $? = $ERROR_STOP_CODE )
- name: Test Assertions w/ Parallel Callbacks
env:
FPM_FLAGS: ${{ env.FPM_FLAGS }} --flag -DASSERTIONS --flag -DASSERT_MULTI_IMAGE --flag -DASSERT_PARALLEL_CALLBACKS
run: |
set -x
( set +e ; fpm run --example false-assertion ${FPM_FLAGS} --flag "${{ matrix.EXTRA_FLAGS }}" ; test $? = $ERROR_STOP_CODE )