-
Notifications
You must be signed in to change notification settings - Fork 14
182 lines (155 loc) · 6.02 KB
/
unix_linux.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
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
name: Linux builds
on:
# allows us to run workflows manually
workflow_dispatch:
pull_request:
branches:
- develop
paths-ignore:
- '.github/workflows/windows.yml'
- '.github/workflows/unix_mac.yml'
- '*.md'
- 'LICENSE'
push:
branches:
- develop
paths-ignore:
- '.github/workflows/windows.yml'
- '.github/workflows/unix_mac.yml'
- '*.md'
- 'LICENSE'
release:
types: # This configuration does not affect the page_build event above
- published
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
jobs:
building-plugin:
runs-on: ubuntu-latest
strategy:
matrix:
cubit: [2021.4, 2021.5, 2021.11]
os: [ubuntu]
os_version: [20.04, 21.04]
include:
- os: ubuntu
os_version: 18.04
cubit: 17.1.0
- os: debian
os_version: '10.10' # using a 'string' here as the 0 gets rounded away otherwise
cubit: 2021.5
- os: debian
os_version: '10.10' # using a 'string' here as the 0 gets rounded away otherwise
cubit: 2021.11
name: 'Cubit ${{ matrix.cubit }} Build for ${{ matrix.os }} ${{ matrix.os_version }} of Svalinn Plugin'
container:
image: ${{ matrix.os }}:${{ matrix.os_version }}
steps:
- name: install new git
shell: bash -l {0}
run: |
apt-get update
apt-get install -y software-properties-common curl
if [ "${{ matrix.os }}" == "ubuntu" ]; then
add-apt-repository ppa:git-core/ppa
apt-get update
fi
apt-get install -y git
- uses: actions/checkout@v2
- name: Environment Variables
shell: bash -l {0}
run: |
COREFORM_BASE_URL=https://f002.backblazeb2.com/file/cubit-downloads/Coreform-Cubit/Releases
if [ "${{ matrix.cubit }}" == "17.1.0" ]; then
BASE=Trelis-17.1.0
BASESDK=Trelis-SDK-17.1.0
CUBIT_BASE_NAME=Trelis-17.1
HDF5_PATH=/usr/lib/x86_64-linux-gnu/hdf5/serial
elif [ "${{ matrix.cubit }}" == "2021.4" ]; then
BASE=Coreform-Cubit-2021.4%2B15017_05893177
CUBIT_BASE_NAME=Coreform-Cubit-2021.4
HDF5_PATH=/usr/local/HDF_Group/HDF5/1.12.0
elif [ "${{ matrix.cubit }}" == "2021.5" ]; then
BASE=Coreform-Cubit-2021.5%2B15962_5043ef39
CUBIT_BASE_NAME=Coreform-Cubit-2021.5
HDF5_PATH=/usr/local/HDF_Group/HDF5/1.12.0
elif [ "${{ matrix.cubit }}" == "2021.11" ]; then
BASE=Coreform-Cubit-2021.11%2B21637_35609873
CUBIT_BASE_NAME=Coreform-Cubit-2021.11
HDF5_PATH=/usr/local/HDF_Group/HDF5/1.12.0
fi
SUFFIX=Lin64
EXT=deb
echo "SED=sed" >> $GITHUB_ENV
echo "BUILD_SHARED_LIBS=ON" >> $GITHUB_ENV
echo "BUILD_STATIC_LIBS=OFF" >> $GITHUB_ENV
echo "system=linux" >> $GITHUB_ENV
echo "CUBIT_PATH=/opt/${CUBIT_BASE_NAME}" >> $GITHUB_ENV
echo "COREFORM_BASE_URL=${COREFORM_BASE_URL}/Linux/" >> $GITHUB_ENV
echo "HDF5_PATH=${HDF5_PATH}" >> $GITHUB_ENV
echo "OS=${{ matrix.os }}" >> $GITHUB_ENV
echo "OS_VERSION=${{ matrix.os_version }}" >> $GITHUB_ENV
echo "CMAKE_ADDITIONAL_FLAGS=-DCMAKE_CXX_FLAGS=-D_GLIBCXX_USE_CXX11_ABI=0" >> $GITHUB_ENV
echo "CUBIT_PKG=${BASE}-${SUFFIX}.${EXT}" >> $GITHUB_ENV
echo "CUBIT_SDK_PKG=${BASESDK}-${SUFFIX}.tar.gz" >> $GITHUB_ENV
echo "CUBIT_BASE_NAME=${CUBIT_BASE_NAME}" >> $GITHUB_ENV
echo "CURRENT=$(pwd)" >> $GITHUB_ENV
echo "SCRIPTPATH=$GITHUB_WORKSPACE" >> $GITHUB_ENV
echo "PLUGIN_ABS_PATH=$GITHUB_WORKSPACE/.." >> $GITHUB_ENV
echo "FOLDER_PKG=$GITHUB_WORKSPACE/pkg" >> $GITHUB_ENV
echo "" >> ${HOME}/.bash_profile
echo "source $GITHUB_WORKSPACE/scripts/unix_share_build.sh" >> $HOME/.bash_profile
- name: Initial setup
shell: bash -l {0}
run: |
${system}_install_prerequisites
- name: Downloading packages
shell: bash -l {0}
run: |
mkdir -p $FOLDER_PKG
cd ${FOLDER_PKG}
curl -L ${COREFORM_BASE_URL}${CUBIT_PKG} --output ${CUBIT_PKG}
if [ "${{ matrix.cubit }}" = "17.1.0" ]; then
curl -L ${COREFORM_BASE_URL}${CUBIT_SDK_PKG} --output ${CUBIT_SDK_PKG}
fi
mkdir ${SCRIPTPATH}/release
- name: Cubit setup
shell: bash -l {0}
run: |
${system}_setup_cubit ${{ matrix.cubit }}
- name: Build HDF5
shell: bash -l {0}
run: |
${system}_build_hdf5
- name: Build MOAB
shell: bash -l {0}
run: |
build_moab
- name: Build DAGMC
shell: bash -l {0}
run: |
build_dagmc
- name: Build plugin
shell: bash -l {0}
run: |
build_plugin
- name: Prepare package
shell: bash -l {0}
run: |
${system}_build_plugin_pkg ${{ matrix.cubit }}
- if: github.event_name != 'release'
name: Upload artifact for CI
uses: actions/upload-artifact@v2
with:
name: svalinn-plugin_${{ matrix.os }}-${{ matrix.os_version }}_cubit_${{ matrix.cubit }}.tgz
path: ${{ github.workspace }}/release/svalinn-plugin_${{ matrix.os }}-${{ matrix.os_version }}_cubit_${{ matrix.cubit }}.tgz
if-no-files-found: error # 'warn' or 'ignore' are also available, defaults to `warn`
- if: github.event_name == 'release'
name: Upload binaries into the release
uses: svenstaro/upload-release-action@v2
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
file: ${{ github.workspace }}/release/svalinn-plugin_${{ matrix.os }}-${{ matrix.os_version }}_cubit_${{ matrix.cubit }}.tgz
asset_name: svalinn-plugin_${{ matrix.os }}-${{ matrix.os_version }}_cubit_${{ matrix.cubit }}.tgz
tag: ${{ github.ref }}
overwrite: true