-
Notifications
You must be signed in to change notification settings - Fork 4
129 lines (115 loc) · 4.62 KB
/
Copy pathCI.yml
File metadata and controls
129 lines (115 loc) · 4.62 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
name: CI
on: [push, pull_request]
jobs:
Build:
name: ${{ matrix.compiler }}-${{ matrix.version }} (${{ matrix.os }})
runs-on: ${{ matrix.os }}
defaults:
run:
shell: bash
strategy:
fail-fast: false
matrix:
os: [ macos-14, macos-15, macos-15-intel, macos-26, ubuntu-24.04 ]
compiler: [ gfortran ]
version: [ 14 ]
extra_flags: [ -g ]
oc_version: [ 2.10.3 ]
include:
- os: ubuntu-24.04
compiler: gfortran
version: 13
extra_flags: -g -ffree-line-length-0
oc_version: 2.10.3
env:
COMPILER_VERSION: ${{ matrix.version }}
OC_VERSION: ${{ matrix.oc_version }}
FC: ${{ matrix.compiler }}
FFLAGS: ${{ matrix.extra_flags }}
FPM_FLAGS: --profile release --verbose
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Install fpm
uses: fortran-lang/setup-fpm@main
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
fpm-version: latest
- name: Get Time
id: time
uses: nanzm/get-time-action@master
with:
format: 'YYYY-MM'
- name: Install macOS Dependencies
if: ${{ contains(matrix.os, 'macos') && matrix.compiler == 'gfortran' && matrix.version == 14 }}
run: |
set -x
brew update
# fpm binary distribution for macOS requires gfortran shared libraries from gcc@12
brew install -v gcc@12
brew install -v opencoarrays gcc@14 open-mpi
#brew --prefix
#ls -alR $(brew --prefix)/bin
echo "FC=gfortran-${COMPILER_VERSION}" >> "$GITHUB_ENV"
- name: Install Ubuntu Native Dependencies
if: ${{ contains(matrix.os, 'ubuntu') && matrix.container == '' && matrix.compiler == 'gfortran' }}
run: |
set -x
sudo apt update
sudo apt install -y build-essential pkg-config make
sudo apt install -y gfortran-${COMPILER_VERSION} g++-${COMPILER_VERSION}
- name: OpenCoarrays/MPICH Cache
if: ${{ contains(matrix.os, 'ubuntu') && matrix.container == '' }}
id: cache-opencoarrays
uses: actions/cache@v4
with:
path: OpenCoarrays-${{ matrix.oc_version }}
key: OpenCoarrays-${{ matrix.oc_version }}-${{ matrix.compiler }}-${{ matrix.version }}-${{ matrix.os }}-${{ steps.time.outputs.time }}
- name: OpenCoarrays/MPICH Build
if: ${{ steps.cache-opencoarrays.outputs.cache-hit != 'true' && contains(matrix.os, 'ubuntu') && matrix.container == '' }}
run: |
set -x
rm -Rf OpenCoarrays-${OC_VERSION}
#OC_URL=https://github.com/sourceryinstitute/OpenCoarrays/releases/download/${OC_VERSION}/OpenCoarrays-${OC_VERSION}.tar.gz
OC_URL=https://github.com/sourceryinstitute/OpenCoarrays/archive/refs/tags/${OC_VERSION}.tar.gz
wget -P . ${OC_URL}
tar -xf ${OC_VERSION}.tar.gz
cd OpenCoarrays-${OC_VERSION}
TERM=xterm ./install.sh --yes-to-all \
--with-fortran gfortran-${COMPILER_VERSION} \
--with-cxx g++-${COMPILER_VERSION} \
--with-c gcc-${COMPILER_VERSION}
- name: Setup Ubuntu Compilers
if: ${{ contains(matrix.os, 'ubuntu') && matrix.container == '' && matrix.compiler == 'gfortran' }}
run: |
set -x
PREFIX="$PWD/OpenCoarrays-${OC_VERSION}/prerequisites/installations"
OC_PATH="$PREFIX/opencoarrays/${OC_VERSION}"
MPI_PATH=$(ls -d $PREFIX/mpich/*)
#ls -alR ${PREFIX}
cat ${OC_PATH}/setup.sh
echo "PATH=${OC_PATH}/bin:${MPI_PATH}/bin:$PATH" >> "$GITHUB_ENV"
echo "FC=gfortran-${COMPILER_VERSION}" >> "$GITHUB_ENV"
echo "FPM_FFLAGS=${FFLAGS}" >> "$GITHUB_ENV"
echo "FPM_CFLAGS=${CFLAGS}" >> "$GITHUB_ENV"
echo "FPM_CXXFLAGS=${CXXFLAGS}" >> "$GITHUB_ENV"
echo "FPM_LDFLAGS=${LDFLAGS}" >> "$GITHUB_ENV"
- name: Version info
run: |
echo == TOOL VERSIONS ==
echo Platform version info:
uname -a
if test -r /etc/os-release ; then grep -e NAME -e VERSION /etc/os-release ; fi
if test -x /usr/bin/sw_vers ; then /usr/bin/sw_vers ; fi
echo
echo PATH="$PATH"
for tool in ${FC} caf mpicc mpif90 fpm ; do
( echo ; set -x ; w=$(which $tool) ; \
if test -n "$w" ; then \
ls -al $w ; ls -alhL $w ; $tool --version || echo ERROR=$? ; \
fi )
done
- name: Build, run, and test
run: |
#source OpenCoarrays-${OC_VERSION}/prerequisites/installations/opencoarrays/${OC_VERSION}/setup.sh
fpm test --compiler caf --runner "cafrun -n 2" ${FPM_FLAGS}