-
Notifications
You must be signed in to change notification settings - Fork 11
154 lines (129 loc) · 4.68 KB
/
action.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
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
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
name: CI Tests
on: [push, pull_request]
env:
# for cache install
LINUX_ONEAPI_COMPONENTS: intel-oneapi-compiler-fortran:intel-oneapi-compiler-dpcpp-cpp-and-cpp-classic:intel-oneapi-mpi:intel-oneapi-mpi-devel:intel-oneapi-mkl
jobs:
GNU:
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-20.04]
compiler: [gfortran-9]
env:
FC: ${{ matrix.compiler }}
name: ${{ matrix.os }} / ${{ matrix.compiler }}
steps:
- name: Checkout
uses: actions/checkout@v2
with:
fetch-depth: 1
- uses: actions/setup-python@v1
with:
python-version: '3.7'
- name: Install Cmake
run: pip3 install cmake
- name: Install python dependencies
run: pip3 install numpy pytest
- name: Install blas, lapack and other dependencies
run: sudo apt-get install libblas-dev liblapack-dev doxygen
- name: Install Zofu Test Framework
run: |
mkdir -p external && cd external
git clone https://github.com/acroucher/zofu.git
mkdir zofu/build && cd zofu/build
cmake \
-DCMAKE_BUILD_TYPE=release \
-DCMAKE_INSTALL_PREFIX=/home/runner/work/greenX/greenX/external/zofu/install \
-DZOFU_FORTRAN_MODULE_INSTALL_DIR:PATH=include \
..
make -j 4
make install
- name: Build
run: |
mkdir -p build
cd build
cmake -DENABLE_UNITTESTS=ON -DZOFU_PATH=/home/runner/work/greenX/greenX/external/zofu/install ../
make -j$(nproc) VERBOSE=1
- name: Run Tests
run: |
cd python && pip install -e . && cd ../
cd build
ctest -j1 --output-on-failure
# The build system exports GX_BUILD_DIR, but I do not know how to
# propagate env vars between steps in Github Actions
env:
GX_BUILD_DIR: "/home/runner/work/greenX/greenX/build"
intel-oneapi:
runs-on: ubuntu-latest
env:
CC: icx
CXX: icpx
FC: ifort
steps:
- name: Intel Apt repository
timeout-minutes: 1
run: |
wget https://apt.repos.intel.com/intel-gpg-keys/GPG-PUB-KEY-INTEL-SW-PRODUCTS-2023.PUB
sudo apt-key add GPG-PUB-KEY-INTEL-SW-PRODUCTS-2023.PUB
rm GPG-PUB-KEY-INTEL-SW-PRODUCTS-2023.PUB
echo "deb https://apt.repos.intel.com/oneapi all main" | sudo tee /etc/apt/sources.list.d/oneAPI.list
sudo apt-get update
# dump dependencies of oneAPI components
echo "$LINUX_ONEAPI_COMPONENTS" | sed "s/:/ /g" | xargs -n 1 apt-cache depends | tee depends.txt
- name: Cache install
timeout-minutes: 2
id: cache-install
uses: actions/cache@v3
with:
path: /opt/intel/oneapi/
key: install-${{ env.LINUX_ONEAPI_COMPONENTS }}-${{ hashFiles('**/depends.txt') }}
- name: Install Intel oneAPI
timeout-minutes: 5
if: steps.cache-install.outputs.cache-hit != 'true'
run: |
sudo apt-get install $(echo "$LINUX_ONEAPI_COMPONENTS" | sed 's/:/ /g')
- name: Install ninja-build
run: |
sudo apt-get install ninja-build
- name: checkout project code
uses: actions/checkout@v2
- name: Setup Intel oneAPI environment
run: |
source /opt/intel/oneapi/setvars.sh
printenv >> $GITHUB_ENV
- uses: actions/setup-python@v1
with:
python-version: '3.7'
- name: Install Cmake
run: pip3 install cmake
- name: Install python dependencies
run: pip3 install numpy pytest
- name: Install Zofu Test Framework
run: |
mkdir -p external && cd external
git clone https://github.com/acroucher/zofu.git
mkdir zofu/build && cd zofu/build
cmake \
-DCMAKE_BUILD_TYPE=release \
-DCMAKE_INSTALL_PREFIX=/home/runner/work/greenX/greenX/external/zofu/install \
-DZOFU_FORTRAN_MODULE_INSTALL_DIR:PATH=include \
..
make -j 4
make install
- name: Build
run: |
mkdir -p build
cd build
cmake -DENABLE_UNITTESTS=ON -DZOFU_PATH=/home/runner/work/greenX/greenX/external/zofu/install ../
make -j$(nproc) VERBOSE=1
# - name: Run Tests
# run: |
# cd python && pip install -e . && cd ../
# cd build
# ctest -j1 --output-on-failure
# # The build system exports GX_BUILD_DIR, but I do not know how to
# # propagate env vars between steps in Github Actions
# env:
# GX_BUILD_DIR: "/home/runner/work/greenX/greenX/build"