-
Notifications
You must be signed in to change notification settings - Fork 6
79 lines (63 loc) · 1.96 KB
/
ci.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
66
67
68
69
70
71
72
73
74
75
76
77
78
79
name: CI
on:
push:
branches: [main]
pull_request:
branches: [main]
workflow_dispatch:
env:
BUILD_DIR: _build
INSTALL_DIR: _install
EXPORT_BUILD_DIR: _build_export
jobs:
#
# Builds and tests with CMake
#
ubuntu-ifx:
runs-on: ubuntu-latest
steps:
- name: Check-out code
uses: actions/checkout@v3
- name: Setup Intel oneAPI
uses: rscohn2/setup-oneapi@v0
with:
components: ifx
- name: Set compiler environment
run: |
echo "FC=ifx" >> ${GITHUB_ENV}
echo "FPM_FC=ifx" >> ${GITHUB_ENV}
- name: Setup CMake
uses: jwlawson/[email protected]
- name: Setup Ninja
uses: ashutoshvarma/[email protected]
- name: Build Fortuno
run: |
source /opt/intel/oneapi/setvars.sh
cmake -B ${BUILD_DIR} -G Ninja -DCMAKE_INSTALL_PREFIX=${INSTALL_DIR}
cmake --build ${BUILD_DIR}
cmake --install ${BUILD_DIR}
- name: Test CMake export
run: |
source /opt/intel/oneapi/setvars.sh
CMAKE_PREFIX_PATH=${INSTALL_DIR} cmake -B ${EXPORT_BUILD_DIR} -G Ninja test/export
cmake --build ${EXPORT_BUILD_DIR}
${EXPORT_BUILD_DIR}/testapp
- name: Test PkgConfig export
run: |
source /opt/intel/oneapi/setvars.sh
export LD_LIBRARY_PATH="${INSTALL_DIR}/lib:${LD_LIBRARY_PATH}"
export PKG_CONFIG_PATH="${INSTALL_DIR}/lib/pkgconfig:${PKG_CONFIG_PATH}"
cflags="$(pkg-config --cflags fortuno)"
lflags="$(pkg-config --libs fortuno)"
ifx ${cflags} ${lflags} -o testapp test/export/app/testapp.f90
./testapp
rm ./testapp
- name: Setup fpm
uses: fortran-lang/setup-fpm@v5
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
- name: Test fpm export
run: |
source /opt/intel/oneapi/setvars.sh
cd test/export
fpm run testapp