Skip to content

Commit 816d8e1

Browse files
committed
Add initial CI Action
1 parent ea1e4ea commit 816d8e1

1 file changed

Lines changed: 220 additions & 0 deletions

File tree

.github/workflows/build.yml

Lines changed: 220 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,220 @@
1+
name: Build
2+
3+
on:
4+
push:
5+
paths-ignore: &paths_ignore
6+
- 'docs/**'
7+
- 'share/**'
8+
- 'utils/cmake/**'
9+
- 'utils/config/**'
10+
- 'utils/valgrind/**'
11+
- '**.txt'
12+
- '**.md'
13+
pull_request:
14+
paths-ignore: *paths_ignore
15+
16+
concurrency:
17+
# De-duplicate concurrent workflow runs on the same branch/ref
18+
group: ${{ github.workflow }}-${{ github.head_ref || github.ref_name }}
19+
cancel-in-progress: ${{ github.ref != 'refs/heads/master' && github.ref != 'refs/heads/develop' }}
20+
21+
jobs:
22+
build:
23+
name: ${{ matrix.compiler }}-${{ matrix.version }} (${{ matrix.os }})
24+
runs-on: ${{ matrix.os }}
25+
defaults:
26+
run:
27+
shell: bash
28+
strategy:
29+
fail-fast: false
30+
matrix:
31+
os: [ macos-14, macos-15, macos-15-intel, macos-26, macos-26-intel, ubuntu-24.04 ]
32+
compiler: [ gcc ]
33+
version: [ 12, 13, 14, 15 ]
34+
extra_flags: [ -g ]
35+
36+
include:
37+
- os: ubuntu-22.04
38+
compiler: gcc
39+
version: 12 # no package available for gcc 13+
40+
41+
# --- LLVM clang coverage ---
42+
43+
- os: macos-14
44+
compiler: clang
45+
version: 22
46+
- os: macos-15
47+
compiler: clang
48+
version: 22
49+
- os: macos-15-intel
50+
compiler: clang
51+
version: 22
52+
- os: macos-26
53+
compiler: clang
54+
version: 22
55+
- os: macos-26-intel
56+
compiler: clang
57+
version: 22
58+
59+
# https://hub.docker.com/r/phhargrove/llvm-flang/tags
60+
- os: ubuntu-24.04
61+
compiler: clang
62+
version: 22
63+
container: phhargrove/llvm-flang:22.1.0-latest
64+
- os: ubuntu-24.04
65+
compiler: clang
66+
version: 21
67+
container: phhargrove/llvm-flang:21.1.0-latest
68+
- os: ubuntu-24.04
69+
compiler: clang
70+
version: 20
71+
container: phhargrove/llvm-flang:20.1.0-latest
72+
- os: ubuntu-24.04
73+
compiler: clang
74+
version: 19
75+
extra_flags: -g -mmlir -allow-assumed-rank
76+
container: phhargrove/llvm-flang:19.1.1-latest
77+
78+
# --- Intel coverage ---
79+
80+
# https://hub.docker.com/r/intel/oneapi-hpckit/tags
81+
- os: ubuntu-24.04
82+
compiler: icx
83+
version: latest
84+
container: intel/oneapi-hpckit:latest
85+
86+
- os: ubuntu-24.04
87+
compiler: icx
88+
version: 2025.2.0
89+
container: intel/oneapi-hpckit:2025.2.0-0-devel-ubuntu24.04
90+
91+
- os: ubuntu-24.04
92+
compiler: icx
93+
version: 2025.1.0
94+
container: intel/oneapi-hpckit:2025.1.0-0-devel-ubuntu24.04
95+
96+
- os: ubuntu-22.04
97+
compiler: icx
98+
version: 2025.0.0
99+
container: intel/oneapi-hpckit:2025.0.0-0-devel-ubuntu22.04
100+
101+
container:
102+
image: ${{ matrix.container }}
103+
104+
env:
105+
COMPILER_VERSION: ${{ matrix.version }}
106+
CC: ${{ matrix.compiler }}
107+
CFLAGS: ${{ matrix.extra_flags }}
108+
CONFIGURE_ARGS: --disable-mpi-compat --enable-rpath
109+
GASNET_BACKTRACE: 1
110+
GASNET_SPAWN_VERBOSE: 1
111+
GASNET_SPAWNFN: L
112+
GASNET_MASTERIP: 127.0.0.1
113+
114+
steps:
115+
- name: Checkout code
116+
uses: actions/checkout@v6
117+
118+
- name: Install Ubuntu Native Dependencies
119+
if: ${{ contains(matrix.os, 'ubuntu') && matrix.container == '' && matrix.compiler == 'gcc' }}
120+
run: |
121+
set -x
122+
sudo apt update
123+
#sudo apt list -a 'gcc-*'
124+
sudo apt install -y build-essential
125+
if (( ${COMPILER_VERSION} < 15 )) ; then \
126+
sudo apt install -y gcc-${COMPILER_VERSION} ; \
127+
else \
128+
curl -L https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh -o install-homebrew.sh ; \
129+
chmod +x install-homebrew.sh ; \
130+
env CI=1 ./install-homebrew.sh ; \
131+
HOMEBREW_PREFIX="/home/linuxbrew/.linuxbrew" ; \
132+
${HOMEBREW_PREFIX}/bin/brew install -v gcc@${COMPILER_VERSION} binutils ; \
133+
ls -al ${HOMEBREW_PREFIX}/bin ; \
134+
echo "PATH=${HOMEBREW_PREFIX}/bin:${PATH}" >> "$GITHUB_ENV" ; \
135+
: Homebrew GCC@15 needs binutils 2.44+ ; \
136+
HOMEBREW_BINUTILS=$(ls -d ${HOMEBREW_PREFIX}/Cellar/binutils/2.*/bin ) ; \
137+
ls -al ${HOMEBREW_BINUTILS} ; \
138+
echo "FFLAGS=$FFLAGS -B ${HOMEBREW_BINUTILS}" >> "$GITHUB_ENV" ; \
139+
echo "CFLAGS=$CFLAGS -B ${HOMEBREW_BINUTILS}" >> "$GITHUB_ENV" ; \
140+
echo "CXXFLAGS=$CXXFLAGS -B ${HOMEBREW_BINUTILS}" >> "$GITHUB_ENV" ; \
141+
fi
142+
143+
- name: Install Ubuntu Container Dependencies
144+
if: ${{ contains(matrix.os, 'ubuntu') && matrix.container != '' && !contains(matrix.container, 'phhargrove') }}
145+
run: |
146+
set -x
147+
apt update
148+
apt install -y build-essential # pkg-config make git curl
149+
150+
- name: Install macOS Dependencies
151+
if: contains(matrix.os, 'macos') && matrix.version == '12'
152+
run: |
153+
set -x
154+
brew update
155+
brew install gcc@12
156+
157+
- name: Install LLVM on macOS
158+
if: contains(matrix.os, 'macos') && matrix.compiler == 'clang'
159+
run: |
160+
set -x
161+
brew install llvm@${COMPILER_VERSION}
162+
# Prepend homebrew clang to PATH:
163+
echo "PATH=$(brew --prefix)/opt/llvm/bin:${PATH}" >> "$GITHUB_ENV"
164+
165+
- name: Setup Compilers
166+
run: |
167+
set -x
168+
if test "$CC" = "clang" ; then
169+
echo "CXX=clang++" >> "$GITHUB_ENV"
170+
elif test "$CC" = "icx" ; then
171+
echo "CXX=icpx" >> "$GITHUB_ENV"
172+
else
173+
echo "CC=gcc-${COMPILER_VERSION}" >> "$GITHUB_ENV"
174+
echo "CXX=g++-${COMPILER_VERSION}" >> "$GITHUB_ENV"
175+
# XCode 26 / gcc bug workaround:
176+
# <mach/mach_time.h> and <mach/mach.h> generate xnu_static_assert_struct_size errors from <mach/message.h>
177+
if [[ ${{ matrix.os }} =~ macos-26 ]] ; then
178+
echo "CONFIGURE_ARGS=$CONFIGURE_ARGS --enable-force-posix-realtime --disable-ccs-rpc" >> "$GITHUB_ENV"
179+
fi
180+
fi
181+
182+
- name: Version info
183+
run: |
184+
echo == TOOL VERSIONS ==
185+
echo Platform version info:
186+
uname -a
187+
if test -r /etc/os-release ; then grep -e NAME -e VERSION /etc/os-release ; fi
188+
if test -x /usr/bin/sw_vers ; then /usr/bin/sw_vers ; fi
189+
echo
190+
echo PATH="$PATH"
191+
for tool in ${CC} ${CXX} make ; do
192+
( echo ; set -x ; w=$(which $tool) ; ls -al $w ; ls -alhL $w ; $tool --version )
193+
done
194+
195+
- name: configure
196+
run: |
197+
set -x
198+
./configure --prefix=$PWD/inst ${CONFIGURE_ARGS}
199+
200+
- name: make all
201+
run: |
202+
set -x
203+
make all
204+
205+
- name: make install
206+
run: |
207+
set -x
208+
make install
209+
210+
- name: make test_install
211+
run: |
212+
set -x
213+
make test_install
214+
215+
- name: make check
216+
run: |
217+
set -x
218+
make check
219+
220+

0 commit comments

Comments
 (0)