forked from geopm/geopm
-
Notifications
You must be signed in to change notification settings - Fork 0
183 lines (175 loc) · 7.04 KB
/
build.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
183
#
# Copyright (c) 2015 - 2024, Intel Corporation
# SPDX-License-Identifier: BSD-3-Clause
#
name: C/C++ CI
on:
push:
branches:
- dev
- release-v3.0
pull_request:
branches:
- dev
- release-v3.0
permissions: read-all
concurrency:
group: ci-${{ github.ref }}-${{ github.head_ref }}
cancel-in-progress: true
jobs:
precheck:
name: "Pre-build checks"
# Run linters and other low-cost checks that do not depend on being in a
# particular configuration of the build matrix.
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
- uses: codespell-project/actions-codespell@94259cd8be02ad2903ba34a22d9c13de21a74461 # v2.0
build_and_test:
name: "test: ${{ matrix.config.name }} ${{ matrix.debug-flag }} service:${{ matrix.service-asan-flag }} base:${{ matrix.base-asan-flag }}"
runs-on: ubuntu-22.04
strategy:
matrix:
config:
- {
name: clang-15,
cc: "clang-15", cxx: "clang++-15"
}
- {
name: gcc-12,
cc: "gcc-12", cxx: "g++-12"
}
debug-flag: ["enable-debug", "disable-debug"]
service-asan-flag: ["disable-asan"]
base-asan-flag: ["disable-asan"]
include:
- config: {name: clang-15, cc: "clang-15", cxx: "clang++-15"}
debug-flag: "enable-debug"
service-asan-flag: "enable-asan"
base-asan-flag: "disable-asan"
- config: {name: clang-15, cc: "clang-15", cxx: "clang++-15"}
debug-flag: "enable-debug"
service-asan-flag: "disable-asan"
base-asan-flag: "enable-asan"
env:
CC: ${{ matrix.config.cc }}
CXX: ${{ matrix.config.cxx }}
FC: gfortran-9
F77: gfortran-9
steps:
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
- name: install system dependencies
run: sudo apt-get update && sudo apt-get install libelf-dev mpich libmpich-dev libomp-15-dev libsystemd-dev liburing-dev python3-gi python3-yaml libcap-dev zlib1g-dev
- name: install base and service dir python dependencies
run: |
python3 -m pip install --upgrade pip setuptools wheel pep517
python3 -m pip install -r service/requirements.txt
python3 -m pip install -r scripts/requirements.txt
- name: check include guards
shell: bash
run: .github/include_guards.sh
- name: configure service dir
working-directory: service
run: ./autogen.sh && ./configure --${{ matrix.debug-flag }} --${{ matrix.service-asan-flag }} || (cat config.log && false)
- name: make service dir
working-directory: service
run: make -j2
- name: configure base dir
if: matrix.service-asan-flag != 'enable-asan'
run: ./autogen.sh && ./configure --enable-beta --disable-openmp --with-geopmd-lib=./service/.libs --with-geopmd-include=./service/src --${{ matrix.debug-flag }} --${{ matrix.base-asan-flag }} || (cat config.log && false)
- name: make base dir
if: matrix.service-asan-flag != 'enable-asan'
run: make -j2
- name: make checkprogs service
working-directory: service
run: make checkprogs -j2
- name: make checkprogs base dir
if: matrix.service-asan-flag != 'enable-asan'
run: make checkprogs -j2
- name: make check service
working-directory: service
env:
LD_LIBRARY_PATH: .libs:${LD_LIBRARY_PATH}
run: make check
- name: make check basedir
if: matrix.service-asan-flag != 'enable-asan'
run: make check
env:
LD_LIBRARY_PATH: .libs:./service/.libs:${LD_LIBRARY_PATH}
PYTHONPATH: scripts:${PYTHONPATH}
- name: test-dist
if: matrix.service-asan-flag != 'enable-asan' && matrix.base-asan-flag != 'enable-asan'
run: ./copying_headers/test-dist
- name: show failure logs
if: ${{ failure() }}
run: |
cat scripts/py3k_lint.log || true
cat scripts/test/pytest_links/*.log || true
cat service/geopmdpy_test/pytest_links/*.log || true
cat test/gtest_links/*.log || true
cat service/test/gtest_links/*.log || true
cat service/integration/open_pbs/*.log || true
publish_obs:
if: github.event_name == 'push'
needs: build_and_test
name: "publish_obs"
runs-on: ubuntu-22.04
env:
CC: "gcc-12"
CXX: "g++-12"
steps:
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
with:
fetch-depth: 0
- name: install system dependencies
run: sudo apt-get update && sudo apt-get install libelf-dev mpich libmpich-dev libomp-15-dev libsystemd-dev liburing-dev python3-gi python3-yaml osc python3-m2crypto libcap-dev zlib1g-dev
- name: install base and service dir python dependencies
run: |
python3 -m pip install --upgrade pip setuptools wheel pep517
python3 -m pip install -r service/requirements.txt
- name: configure service dir
working-directory: service
run: ./autogen.sh && ./configure || (cat config.log && false)
- name: make service dist
working-directory: service
run: make -j2 dist
- name: make service libs
working-directory: service
run: make -j2
- name: configure runtime dir
run: ./autogen.sh && ./configure --disable-openmp --disable-mpi || (cat config.log && false)
- name: make runtime dist
run: make -j2 dist
- name: set OSC credentials
run: |
echo -e "[general]\n\n[https://api.opensuse.org]\ncredentials_mgr_class=osc.credentials.ObfuscatedConfigFileCredentialsManager" > ~/.oscrc
echo "user = ${{ github.repository_owner }}" >> ~/.oscrc
echo "pass = ${{ secrets.OSC_CREDENTIALS }}" >> ~/.oscrc
if [[ "${{ github.ref_name }}" == "release-v3.0" ]]; then
echo "SERVICE_PACKAGE=home:${{ github.repository_owner }}:release/geopm-service" >> ${GITHUB_ENV}
echo "RUNTIME_PACKAGE=home:${{ github.repository_owner }}:release/geopm-runtime" >> ${GITHUB_ENV}
else
echo "SERVICE_PACKAGE=home:${{ github.repository_owner }}/geopm-service" >> ${GITHUB_ENV}
echo "RUNTIME_PACKAGE=home:${{ github.repository_owner }}/geopm-runtime" >> ${GITHUB_ENV}
fi
- name: publish service
working-directory: service
run: |
osc co ${SERVICE_PACKAGE}
rm ${SERVICE_PACKAGE}/geopm-service*.tar.gz
cp geopm-service.spec ${SERVICE_PACKAGE}
cp geopm-service*.tar.gz ${SERVICE_PACKAGE}
cd ${SERVICE_PACKAGE}
osc addremove
cd -
osc ci -m "geopm service ${{ github.sha }}" ${SERVICE_PACKAGE}
- name: publish runtime
run: |
osc co ${RUNTIME_PACKAGE}
rm ${RUNTIME_PACKAGE}/geopm-runtime*.tar.gz
cp geopm-runtime.spec ${RUNTIME_PACKAGE}
cp geopm-runtime*.tar.gz ${RUNTIME_PACKAGE}
cd ${RUNTIME_PACKAGE}
osc addremove
cd -
osc ci -m "geopm runtime ${{ github.sha }}" ${RUNTIME_PACKAGE}