Skip to content

Commit cdd8729

Browse files
authored
Merge pull request #25 from elbeno/update-from-cicd
⬆️ 👷 Update workflow from upstream
2 parents 8692f8f + 09a1c39 commit cdd8729

File tree

4 files changed

+48
-32
lines changed

4 files changed

+48
-32
lines changed

.github/workflows/asciidoctor-ghpages.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,14 +11,14 @@ env:
1111
jobs:
1212
configure:
1313
name: Configure Github Pages Publishing
14-
runs-on: intel-ubuntu-22.04
14+
runs-on: ${{ github.repository_owner == 'intel' && 'intel-' || '' }}ubuntu-22.04
1515
outputs:
1616
enable_publish: ${{ steps.check.outputs.isfork == 'NO' }}
1717
steps:
1818
- id: check
1919
name: Check if Fork
2020
run: |
21-
if [ "${{ github.repository }}" = "intel/compile-time-init-build" ]; then
21+
if [ "${{ github.repository_owner }}" = "intel" ]; then
2222
echo "This is the main repository, **enabling publishing**" >> "$GITHUB_STEP_SUMMARY"
2323
echo "isfork=NO" >> "$GITHUB_OUTPUT"
2424
else
@@ -29,7 +29,7 @@ jobs:
2929
build:
3030
needs: configure
3131
name: Build Documentation
32-
runs-on: intel-ubuntu-22.04
32+
runs-on: ${{ github.repository_owner == 'intel' && 'intel-' || '' }}ubuntu-22.04
3333
steps:
3434
- name: Checkout source
3535
uses: actions/checkout@v4
@@ -65,7 +65,7 @@ jobs:
6565
environment:
6666
name: github-pages
6767
url: $${{ steps.deployment.outputs.page_url }}
68-
runs-on: intel-ubuntu-22.04
68+
runs-on: ${{ github.repository_owner == 'intel' && 'intel-' || '' }}ubuntu-22.04
6969
steps:
7070
- name: Deploy to github pages
7171
id: deployment

.github/workflows/unit_tests.yml

Lines changed: 29 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ env:
1212
DEBIAN_FRONTEND: noninteractive
1313
CMAKE_GENERATOR: Ninja
1414
DEFAULT_CXX_STANDARD: 20
15-
DEFAULT_LLVM_VERSION: 16
15+
DEFAULT_LLVM_VERSION: 17
1616
DEFAULT_GCC_VERSION: 12
1717

1818
concurrency:
@@ -21,12 +21,12 @@ concurrency:
2121

2222
jobs:
2323
build_and_test:
24-
runs-on: ubuntu-22.04
24+
runs-on: ${{ github.repository_owner == 'intel' && 'intel-' || '' }}ubuntu-22.04
2525
strategy:
2626
fail-fast: false
2727
matrix:
2828
compiler: [clang, gcc]
29-
version: [12, 13, 14, 15, 16]
29+
version: [12, 13, 14, 15, 16, 17]
3030
cxx_standard: [20]
3131
stdlib: [libstdc++, libc++]
3232
build_type: [Debug]
@@ -35,6 +35,15 @@ jobs:
3535
cc: "clang"
3636
cxx: "clang++"
3737
cxx_flags: "-stdlib=libstdc++"
38+
- version: 17
39+
compiler: clang
40+
install: wget https://apt.llvm.org/llvm.sh && chmod +x llvm.sh && sudo ./llvm.sh 17
41+
toolchain_root: "/usr/lib/llvm-17"
42+
- version: 17
43+
compiler: clang
44+
stdlib: libc++
45+
install: wget https://apt.llvm.org/llvm.sh && chmod +x llvm.sh && sudo ./llvm.sh 17 && sudo apt install -y libc++-17-dev libc++abi-17-dev
46+
cxx_flags: "-stdlib=libc++"
3847
- version: 16
3948
compiler: clang
4049
install: wget https://apt.llvm.org/llvm.sh && chmod +x llvm.sh && sudo ./llvm.sh 16
@@ -77,6 +86,8 @@ jobs:
7786
cxx: "g++-12"
7887
cxx_flags: ""
7988
exclude:
89+
- compiler: gcc
90+
version: 17
8091
- compiler: gcc
8192
version: 16
8293
- compiler: gcc
@@ -112,19 +123,19 @@ jobs:
112123
run: ctest -j $(nproc) -C ${{matrix.build_type}}
113124

114125
quality_checks_pass:
115-
runs-on: ubuntu-22.04
126+
runs-on: ${{ github.repository_owner == 'intel' && 'intel-' || '' }}ubuntu-22.04
116127
steps:
117128
- uses: actions/checkout@v4
118129

119130
- name: Install build tools
120131
run: |
121132
wget https://apt.llvm.org/llvm.sh && chmod +x llvm.sh && sudo ./llvm.sh ${{env.DEFAULT_LLVM_VERSION}}
122-
sudo apt install -y ninja-build clang-tidy-${{env.DEFAULT_LLVM_VERSION}} clang-format-${{env.DEFAULT_LLVM_VERSION}}
133+
sudo apt install -y python3-pip ninja-build clang-tidy-${{env.DEFAULT_LLVM_VERSION}} clang-format-${{env.DEFAULT_LLVM_VERSION}}
123134
124135
- name: Install cmake-format
125136
run: |
126-
pip3 install --upgrade pip
127-
pip3 install pyyaml cmake-format
137+
sudo pip3 install --upgrade pip
138+
sudo pip3 install pyyaml cmake-format
128139
129140
- name: Configure CMake
130141
env:
@@ -136,7 +147,7 @@ jobs:
136147
run: cmake --build ${{github.workspace}}/build -t quality
137148

138149
sanitize:
139-
runs-on: ubuntu-22.04
150+
runs-on: ${{ github.repository_owner == 'intel' && 'intel-' || '' }}ubuntu-22.04
140151
strategy:
141152
fail-fast: false
142153
matrix:
@@ -161,7 +172,7 @@ jobs:
161172
run: cmake --build ${{github.workspace}}/build -t unit_tests
162173

163174
valgrind:
164-
runs-on: ubuntu-22.04
175+
runs-on: ${{ github.repository_owner == 'intel' && 'intel-' || '' }}ubuntu-22.04
165176
steps:
166177
- uses: actions/checkout@v4
167178

@@ -211,8 +222,15 @@ jobs:
211222
test $FAILSIZE = "0"
212223
213224
merge_ok:
214-
runs-on: ubuntu-22.04
225+
runs-on: ${{ github.repository_owner == 'intel' && 'intel-' || '' }}ubuntu-22.04
215226
needs: [build_and_test, quality_checks_pass, sanitize, valgrind]
227+
if: ${{ always() }}
216228
steps:
217229
- name: Enable merge
218-
run: echo "OK to merge!"
230+
if: >-
231+
${{
232+
contains(needs.*.result, 'failure')
233+
|| contains(needs.*.result, 'cancelled')
234+
|| contains(needs.*.result, 'skipped')
235+
}}
236+
run: exit 1

include/safe/algorithm/accumulate.hpp

Lines changed: 13 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -36,22 +36,20 @@ template <auto count> inline consteval auto fold(auto e, auto op) {
3636
);
3737

3838
} else if constexpr (count > 10) {
39-
return safe::dsl::detail::simp(op(
40-
op(op(op(op(op(op(op(op(op(fold<count - 10>(e, op), e), e),
41-
e),
42-
e),
43-
e),
44-
e),
45-
e),
46-
e),
47-
e),
48-
e));
39+
return safe::dsl::detail::simp(op(
40+
op(op(op(op(op(op(op(op(op(fold<count - 10>(e, op), e), e), e), e),
41+
e),
42+
e),
43+
e),
44+
e),
45+
e),
46+
e));
4947

5048
} else if constexpr (count > 1) {
51-
return safe::dsl::detail::simp(op(fold<count - 1>(e, op), e));
49+
return safe::dsl::detail::simp(op(fold<count - 1>(e, op), e));
5250

5351
} else {
54-
return e;
52+
return e;
5553
}
5654
}
5755

@@ -69,9 +67,9 @@ template <size_t max_iter>
6967
auto iter_count = size_t{};
7068
auto sum = init;
7169
while ((first != last) && (iter_count < max_iter)) {
72-
sum = op(sum, (*first).unsafe_value());
73-
first++;
74-
iter_count++;
70+
sum = op(sum, (*first).unsafe_value());
71+
first++;
72+
iter_count++;
7573
}
7674

7775
return unsafe_cast<var<ret_num_t, sum_req>>(sum);

include/safe/array.hpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,7 @@ template <typename T, std::size_t Size> struct array {
124124

125125
constexpr void fill(T const &value) { storage.fill(value); }
126126

127-
constexpr void swap(array &other) { storage.swap(other.storage); }
127+
constexpr void swap(array &other) noexcept { storage.swap(other.storage); }
128128

129129
[[nodiscard]] friend constexpr auto operator==(array const &lhs,
130130
array const &rhs) -> bool {
@@ -164,7 +164,7 @@ template <std::size_t I, class T, std::size_t N>
164164
}
165165

166166
template <class T, std::size_t N>
167-
constexpr void swap(safe::array<T, N> &lhs, safe::array<T, N> &rhs) {
167+
constexpr void swap(safe::array<T, N> &lhs, safe::array<T, N> &rhs) noexcept {
168168
lhs.swap(rhs);
169169
}
170170

0 commit comments

Comments
 (0)