-
Notifications
You must be signed in to change notification settings - Fork 2
129 lines (112 loc) · 4.65 KB
/
main.yaml
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
# Workflow settings
# See https://docs.github.com/en/actions/learn-github-actions/workflow-syntax-for-github-actions
name: Build/Test SHAW # GUI display name
on: # Triggers, see https://docs.github.com/en/actions/learn-github-actions/events-that-trigger-workflows
push:
branches: [master, develop]
pull_request:
branches: [master, develop]
#concurrency: # Concurrency group: which jobs run together and which cancel each other
# group: CI-${{ github.head_ref }}
# cancel-in-progress: true
jobs:
CI:
runs-on: ubuntu-latest
strategy:
fail-fast: false # true -> cancel all jobs if any fails
max-parallel: 8
# Build matrix for your jobs: you can define different variations to run each job in
# matrix configurations - reachable with ${{ matrix.config.<key> }}.
# Extra options:
# - cxx: path to C++ compiler
# - mode: build mode inside Pressio (Debug / Release)
matrix:
config:
- { cxx: clang++ }
- { cxx: g++ }
env: # environment variables available to all steps
CXX: ${{ matrix.config.cxx }}
APT_PACKAGES: python3 pip python-is-python3 g++ clang gpg wget libyaml-cpp-dev
PIP_PACKAGES: pytest numpy scipy matplotlib
SHAWDIR: /home/runner/work/SHAW/SHAW
WORKDIR: /home/runner/work/build
SHAWBUILDDEB_DIR: /home/runner/work/build/shaw-build-debug
SHAWBUILDREL_DIR: /home/runner/work/build/shaw-build-release
steps:
- uses: actions/checkout@v2 # check out the repository
- name: Install packages
run: |
sudo apt-get update
sudo apt-get install -y --install-suggests $APT_PACKAGES
# - name: Install CMake
# run: |
# export CMAKE_KEYRING=/usr/share/keyrings/kitware-archive-keyring.gpg
# wget -O - https://apt.kitware.com/keys/kitware-archive-latest.asc 2>/dev/null \
# | gpg --dearmor - \
# | sudo tee $CMAKE_KEYRING >/dev/null
# echo "deb [signed-by=$CMAKE_KEYRING] https://apt.kitware.com/ubuntu/ focal main" \
# | sudo tee /etc/apt/sources.list.d/kitware.list >/dev/null
# sudo apt-get update
# rm $CMAKE_KEYRING
# sudo apt-get install -y kitware-archive-keyring cmake
- name: Check environment
run: |
echo ======================================================
echo CPU Threads: $(grep -c processor /proc/cpuinfo)
echo ======================================================
echo $(which $CXX) --version
$CXX --version
echo ======================================================
echo $(which python) --version
python --version
echo ======================================================
cmake --version
echo ======================================================
echo Source directory: $SHAWDIR
echo work directory: $WORKDIR
echo ======================================================
git --version
cd $SHAWDIR
git status
git branch
- name: Install required Python modules
run: |
sudo pip install $PIP_PACKAGES
echo ======================================================
pip list
echo ======================================================
- name: Build/Install TPLs
run: |
mkdir $WORKDIR
cd $SHAWDIR/bash_scripts
bash build_tpls.sh $WORKDIR
- name: Configure SHAW (debug)
run: |
cd $WORKDIR
cmake \
-DCMAKE_VERBOSE_MAKEFILE:STRING=On \
-DCMAKE_BUILD_TYPE:STRING=Debug \
-DKOKKOSKERNELS_DIR=$WORKDIR/tpls/kokkos-kernels-install \
-DYAMLCPP_DIR=$WORKDIR/tpls/yamlcpp-install \
-B $SHAWBUILDDEB_DIR -S $SHAWDIR
- name: Build/run C++ tests (debug)
run: |
export NUM_CPU=$(grep -c processor /proc/cpuinfo)
cmake --build $SHAWBUILDDEB_DIR -j $NUM_CPU
cd $SHAWBUILDDEB_DIR
ctest -j $NUM_CPU --output-on-failure
- name: Configure SHAW (release)
run: |
cd $WORKDIR
cmake \
-DCMAKE_VERBOSE_MAKEFILE:STRING=On \
-DCMAKE_BUILD_TYPE:STRING=Release \
-DKOKKOSKERNELS_DIR=$WORKDIR/tpls/kokkos-kernels-install \
-DYAMLCPP_DIR=$WORKDIR/tpls/yamlcpp-install \
-B $SHAWBUILDREL_DIR -S $SHAWDIR
- name: Build/run C++ tests (release)
run: |
export NUM_CPU=$(grep -c processor /proc/cpuinfo)
cmake --build $SHAWBUILDREL_DIR -j $NUM_CPU
cd $SHAWBUILDREL_DIR
ctest -j $NUM_CPU --output-on-failure