Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bump actions ubuntu 24.04 #770

Merged
merged 20 commits into from
Oct 10, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/conda_pgm_env.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
name: conda-pgm-env
dependencies:
# build env
- python=3.11
- python=3.12
- pip
- wheel
- setuptools
Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/check-code-quality.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ concurrency:
jobs:
check-code-quality:

runs-on: ubuntu-latest
runs-on: ubuntu-24.04
TonyXiang8787 marked this conversation as resolved.
Show resolved Hide resolved

steps:
- name: Checkout
Expand All @@ -38,7 +38,7 @@ jobs:
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.10'
python-version: '3.12'

- name: Upgrade pip
run: pip install --upgrade pip
Expand Down Expand Up @@ -66,8 +66,8 @@ jobs:

- name: Install and run clang-format
run: |
sudo apt-get update && sudo apt-get install -y clang-format-15
find . -regex '.*\.\(h\|c\|cpp\|hpp\|cc\|cxx\)' -exec clang-format-15 -style=file -i {} \;
sudo apt-get update && sudo apt-get install -y clang-format-18
find . -regex '.*\.\(h\|c\|cpp\|hpp\|cc\|cxx\)' -exec clang-format-18 -style=file -i {} \;

- name: If needed raise error
run: |
Expand Down
5 changes: 4 additions & 1 deletion .github/workflows/citations.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,12 @@ concurrency:

jobs:
validate-citations:
runs-on: ubuntu-latest
runs-on: ubuntu-24.04
steps:
- name: checkout
uses: actions/checkout@v4
- name: Install R
run: |
sudo apt-get update && sudo apt-get install -y r-base
- name: Validate CITATION.cff
uses: dieghernan/cff-validator@v3
2 changes: 1 addition & 1 deletion .github/workflows/clang-tidy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ concurrency:

jobs:
clang-tidy:
runs-on: ubuntu-latest
runs-on: ubuntu-22.04
strategy:
matrix:
build-option: [ debug, release ]
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/dco-merge-group.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ on:
jobs:
dco-merge-group:
name: DCO
runs-on: ubuntu-latest
runs-on: ubuntu-24.04
if: ${{ github.actor != 'dependabot[bot]' }}
steps:
- name: "Workaround for DCO on merge groups"
Expand Down
26 changes: 13 additions & 13 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,13 +40,13 @@ jobs:

acquire-python-version-build-sdist:
name: Build sdist and set version
runs-on: ubuntu-latest
runs-on: ubuntu-24.04
steps:
- uses: actions/checkout@v4

- uses: actions/setup-python@v5
with:
python-version: "3.11"
python-version: "3.12"

- name: Set PyPI Version
run: |
Expand All @@ -69,7 +69,7 @@ jobs:
path: ./wheelhouse/*.tar.gz

build-cpp-test-linux:
runs-on: ubuntu-latest
runs-on: ubuntu-24.04
strategy:
matrix:
build-option: [ debug, release ]
Expand All @@ -87,11 +87,11 @@ jobs:
- name: Install packages
run: |
sudo apt-get update
sudo apt-get install -y ninja-build gcc-12 g++-12 clang-15
sudo ln -s /usr/bin/clang-15 /usr/local/bin/clang
sudo ln -s /usr/bin/clang++-15 /usr/local/bin/clang++
sudo ln -s /usr/bin/gcc-12 /usr/local/bin/gcc
sudo ln -s /usr/bin/g++-12 /usr/local/bin/g++
sudo apt-get install -y ninja-build gcc-13 g++-13 clang-18
sudo ln -s /usr/bin/clang-18 /usr/local/bin/clang
sudo ln -s /usr/bin/clang++-18 /usr/local/bin/clang++
sudo ln -s /usr/bin/gcc-13 /usr/local/bin/gcc
sudo ln -s /usr/bin/g++-13 /usr/local/bin/g++

- name: Enable brew
run: |
Expand Down Expand Up @@ -185,10 +185,10 @@ jobs:
platform: [ linux-x64, linux-aarch64, macos, windows ]
include:
- platform: linux-x64
os: ubuntu-latest
os: ubuntu-24.04
cibw_build: "*_x86_64"
- platform: linux-aarch64
os: ubuntu-latest
os: ubuntu-24.04
cibw_build: "*_aarch64"
- platform: macos
os: macos-14
Expand All @@ -209,7 +209,7 @@ jobs:
path: .

- name: Set up QEMU
if: matrix.os == 'ubuntu-latest'
if: matrix.os == 'ubuntu-24.04'
uses: docker/setup-qemu-action@v3

- name: Set up XCode
Expand Down Expand Up @@ -268,7 +268,7 @@ jobs:
needs: [build-cpp-test-linux, build-cpp-test-windows, build-cpp-test-macos, build-and-test-python, build-and-test-conda]
# always run publish job but fail at the first step if previous jobs have been failed
if: always()
runs-on: ubuntu-latest
runs-on: ubuntu-24.04
permissions:
contents: write
env:
Expand All @@ -287,7 +287,7 @@ jobs:
- name: Setup python
uses: actions/setup-python@v5
with:
python-version: '3.10'
python-version: '3.12'
architecture: x64

- uses: actions/download-artifact@v4
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/reuse-compliance.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ concurrency:

jobs:
reuse-compliance-check:
runs-on: ubuntu-latest
runs-on: ubuntu-24.04
steps:
- name: checkout
uses: actions/checkout@v4
Expand Down
12 changes: 6 additions & 6 deletions .github/workflows/sonar.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,21 +22,21 @@ jobs:
sonar-cloud:
if: (github.event_name == 'push') || (!startsWith(github.head_ref, 'release'))
name: SonarCloud
runs-on: ubuntu-latest
runs-on: ubuntu-24.04
env:
BUILD_WRAPPER_OUT_DIR: build_wrapper_output_directory # Directory where build-wrapper output will be placed
CMAKE_PREFIX_PATH: /home/linuxbrew/.linuxbrew
LLVM_COV: llvm-cov-15
LLVM_COV: llvm-cov-18
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0 # Shallow clones should be disabled for a better relevancy of analysis
- name: Install packages
run: |
sudo apt-get update
sudo apt-get install -y ninja-build clang-15 lcov gcovr
sudo ln -s /usr/bin/clang-15 /usr/local/bin/clang
sudo ln -s /usr/bin/clang++-15 /usr/local/bin/clang++
sudo apt-get install -y ninja-build clang-18 lcov gcovr
sudo ln -s /usr/bin/clang-18 /usr/local/bin/clang
sudo ln -s /usr/bin/clang++-18 /usr/local/bin/clang++
- name: Enable brew
run: |
echo "/home/linuxbrew/.linuxbrew/bin:/home/linuxbrew/.linuxbrew/sbin" >> $GITHUB_PATH
Expand All @@ -46,7 +46,7 @@ jobs:
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: "3.10"
python-version: "3.12"
- name: Install sonar-scanner and build-wrapper
uses: SonarSource/sonarcloud-github-c-cpp@v3

Expand Down
2 changes: 1 addition & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ repos:
pass_filenames: false
always_run: true
- repo: https://github.com/pre-commit/mirrors-clang-format
rev: v15.0.7
rev: v18.1.3
hooks:
- id: clang-format
types_or: [ c++, c ]
12 changes: 6 additions & 6 deletions docs/advanced_documentation/build-guide.md
Original file line number Diff line number Diff line change
Expand Up @@ -46,8 +46,8 @@ You need a C++ compiler with C++20 support. Below is a list of tested compilers:
* Version 12.x tested using the musllinux build with custom compiler
* Version 13.x tested in CI
* Clang >= 15.0
* Version 15.x tested in CI
* Version 15.x tested in CI with code quality checks
* Version 18.x tested in CI
* Version 18.x tested in CI with code quality checks

You can define the environment variable `CXX` to for example `clang++` to specify the C++ compiler.

Expand Down Expand Up @@ -207,10 +207,10 @@ WSL), or in a physical/virtual machine.
Append the following lines into the file `${HOME}/.bashrc`.

```shell
export CXX=clang++-15 # or g++-13
export CC=clang-15 # gcc-13
export CXX=clang++-18 # or g++-13
export CC=clang-18 # gcc-13
export CMAKE_PREFIX_PATH=/home/linuxbrew/.linuxbrew
export LLVM_COV=llvm-cov-15
export LLVM_COV=llvm-cov-18
export CLANG_TIDY=clang-tidy-15 # only if you want to use one of the clang-tidy presets
```

Expand All @@ -220,7 +220,7 @@ Install the following packages from Ubuntu.

```shell
sudo apt update && sudo apt -y upgrade
sudo apt install -y wget curl zip unzip tar git build-essential gcovr lcov gcc g++ clang-15 make gdb ninja-build pkg-config python3.10 python3.10-dev python3.10-venv python3-pip
sudo apt install -y wget curl zip unzip tar git build-essential gcovr lcov gcc g++ clang-18 make gdb ninja-build pkg-config python3.10 python3.10-dev python3.10-venv python3-pip
```

### C++ packages
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -74,8 +74,8 @@ constexpr void set_nan(Enum& x) {
}
template <typename T>
requires requires(T t) {
{ set_nan(t) };
}
{ set_nan(t) };
}
inline T const nan_value = [] {
T v{};
set_nan(v);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,8 @@ template <row_based_or_columnar_c T> constexpr bool is_columnar_v = std::derived
// The attribute buffers are copies of the associated attribute buffers, when provided, and otherwise empty.
template <typename BufferType>
requires requires(BufferType const& b) {
{ b.attributes } -> std::convertible_to<std::vector<AttributeBuffer<typename BufferType::Data>>>;
}
{ b.attributes } -> std::convertible_to<std::vector<AttributeBuffer<typename BufferType::Data>>>;
}
std::vector<AttributeBuffer<typename BufferType::Data>>
reordered_attribute_buffers(BufferType& buffer, std::span<MetaAttribute const* const> attribute_order) {
using Data = typename BufferType::Data;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,19 +61,17 @@ inline auto sparse_decode(IdxVector const& indptr) {

template <typename T>
concept grouped_index_vector_type = std::default_initializable<T> && requires(T const t, Idx const idx) {
typename T::iterator;
typename T::iterator;

{ t.size() } -> std::same_as<Idx>;
{ t.size() } -> std::same_as<Idx>;

{ t.begin() } -> index_range_iterator;
{ t.end() } -> index_range_iterator;
{
t.get_element_range(idx)
} -> random_access_iterable_like<Idx>;
{ t.begin() } -> index_range_iterator;
{ t.end() } -> index_range_iterator;
{ t.get_element_range(idx) } -> random_access_iterable_like<Idx>;

{ t.element_size() } -> std::same_as<Idx>;
{ t.get_group(idx) } -> std::same_as<Idx>;
};
{ t.element_size() } -> std::same_as<Idx>;
{ t.get_group(idx) } -> std::same_as<Idx>;
};
} // namespace detail

template <typename T>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,41 +11,40 @@ namespace power_grid_model {

template <typename T, typename ElementType>
concept iterator_like = requires(T const t) {
{ *t } -> std::convertible_to<std::remove_cvref_t<ElementType> const&>;
};
{ *t } -> std::convertible_to<std::remove_cvref_t<ElementType> const&>;
};

template <typename T, typename ElementType>
concept forward_iterator_like = std::regular<T> && iterator_like<T, ElementType> && requires(T t) {
{ t++ } -> std::same_as<T>;
{ ++t } -> std::same_as<T&>;
};
{ t++ } -> std::same_as<T>;
{ ++t } -> std::same_as<T&>;
};

template <typename T, typename ElementType>
concept bidirectional_iterator_like = forward_iterator_like<T, ElementType> && requires(T t) {
{ t-- } -> std::same_as<T>;
{ --t } -> std::same_as<T&>;
};
{ t-- } -> std::same_as<T>;
{ --t } -> std::same_as<T&>;
};

template <typename T, typename ElementType>
concept random_access_iterator_like =
bidirectional_iterator_like<T, ElementType> && std::totally_ordered<T> && requires(T t, Idx n) {
{ t + n } -> std::same_as<T>;
{ t - n } -> std::same_as<T>;
{ t += n } -> std::same_as<T&>;
{ t -= n } -> std::same_as<T&>;
};
{ t + n } -> std::same_as<T>;
{ t - n } -> std::same_as<T>;
{ t += n } -> std::same_as<T&>;
{ t -= n } -> std::same_as<T&>;
};

template <typename T, typename ElementType>
concept random_access_iterable_like = requires(T const t) {
{ t.begin() } -> random_access_iterator_like<ElementType>;
{ t.end() } -> random_access_iterator_like<ElementType>;
};
{ t.begin() } -> random_access_iterator_like<ElementType>;
{ t.end() } -> random_access_iterator_like<ElementType>;
};

template <typename T>
concept index_range_iterator =
random_access_iterator_like<T, typename T::iterator> && requires(T const t) {
typename T::iterator;
{ *t } -> random_access_iterable_like<Idx>;
};
concept index_range_iterator = random_access_iterator_like<T, typename T::iterator> && requires(T const t) {
typename T::iterator;
{ *t } -> random_access_iterable_like<Idx>;
};

} // namespace power_grid_model
Original file line number Diff line number Diff line change
Expand Up @@ -125,8 +125,8 @@ static_assert(std::is_trivially_destructible_v<ComplexValue<asymmetric_t>>);
template <class T>
concept column_vector = (T::ColsAtCompileTime == 1);
template <class T>
concept rk2_tensor = (static_cast<Idx>(T::RowsAtCompileTime) ==
static_cast<Idx>(T::ColsAtCompileTime)); // rank 2 tensor
concept rk2_tensor =
(static_cast<Idx>(T::RowsAtCompileTime) == static_cast<Idx>(T::ColsAtCompileTime)); // rank 2 tensor
template <class T>
concept column_vector_or_tensor = column_vector<T> || rk2_tensor<T>;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,16 +24,16 @@ struct UpdateChange {

template <typename T>
concept component_c = requires(T t, T const& ct, typename T::UpdateType u, typename T::UpdateType const& cu) {
typename T::InputType;
typename T::UpdateType;
typename T::InputType;
typename T::UpdateType;

{ T::name } -> std::convertible_to<std::string_view>;
{ ct.math_model_type() } -> std::convertible_to<ComponentType>;
{ T::name } -> std::convertible_to<std::string_view>;
{ ct.math_model_type() } -> std::convertible_to<ComponentType>;

{ ct.id() } -> std::same_as<ID>;
{ ct.id() } -> std::same_as<ID>;

{ t.update(cu) } -> std::same_as<UpdateChange>;
{ ct.inverse(u) } -> std::same_as<typename T::UpdateType>;
};
{ t.update(cu) } -> std::same_as<UpdateChange>;
{ ct.inverse(u) } -> std::same_as<typename T::UpdateType>;
};

} // namespace power_grid_model
Original file line number Diff line number Diff line change
Expand Up @@ -77,8 +77,8 @@ class Shunt : public Appliance {
DoubleComplex y0_{nan};

template <typename T>
requires std::same_as<T, ShuntInput> || std::same_as<T, ShuntUpdate> bool
update_params(T shunt_params) {
requires std::same_as<T, ShuntInput> || std::same_as<T, ShuntUpdate>
bool update_params(T shunt_params) {
bool changed = update_param(shunt_params.g1, g1_);
changed = update_param(shunt_params.b1, b1_) || changed;
changed = update_param(shunt_params.g0, g0_) || changed;
Expand Down
Loading
Loading