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 Apple CI to macos-13 + xcode latest-stable #415

Merged
merged 17 commits into from
Nov 1, 2023
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.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
17 changes: 14 additions & 3 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@ jobs:

build-cpp-test-macos:
if: (github.event_name == 'push') || (github.event_name == 'workflow_dispatch') || (!startsWith(github.head_ref, 'release'))
runs-on: macos-latest
runs-on: macos-13
strategy:
matrix:
build-option: [ debug, release ]
Expand All @@ -151,6 +151,11 @@ jobs:
steps:
- uses: actions/checkout@v4

- name: Set up XCode
uses: maxim-lobanov/setup-xcode@v1
with:
xcode-version: latest-stable

- name: Install cpp dependencies
run: |
brew install ninja boost eigen nlohmann-json msgpack-cxx doctest
Expand All @@ -170,7 +175,7 @@ jobs:
os: ubuntu-latest
cibw_build: "*_aarch64"
- platform: macos
os: macos-latest
os: macos-13
cibw_build: "*"
- platform: windows
os: windows-latest
Expand All @@ -191,6 +196,12 @@ jobs:
if: matrix.os == 'ubuntu-latest'
uses: docker/setup-qemu-action@v3

- name: Set up XCode
if: matrix.os == 'macos-13'
uses: maxim-lobanov/setup-xcode@v1
with:
xcode-version: latest-stable

- name: Build wheels
uses: pypa/cibuildwheel@v2.16.2
# GitHub Actions specific build parameters
Expand All @@ -212,7 +223,7 @@ jobs:
runs-on: ${{ matrix.os }}-latest
strategy:
matrix:
os: ["ubuntu", "macos", "windows"]
os: ["ubuntu", "windows"] # We do not test conda for MacOS

defaults:
run:
Expand Down
2 changes: 1 addition & 1 deletion docs/advanced_documentation/build-guide.md
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ You can define the environment variable `CXX` to for example `clang++` to specif

**macOS**

* Clang >= 14.0
* Clang >= 14.0.3
* Latest release tested in CI

### Build System for CMake Project
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -105,8 +105,9 @@ class DatasetHandler {
Buffer const& get_buffer(Idx i) const { return buffers_[i]; }

Idx find_component(std::string_view component, bool required = false) const {
auto const found = std::find_if(dataset_info_.component_info.cbegin(), dataset_info_.component_info.cend(),
[component](ComponentInfo const& x) { return x.component->name == component; });
auto const found = std::ranges::find_if(dataset_info_.component_info, [component](ComponentInfo const& x) {
return x.component->name == component;
});
if (found == dataset_info_.component_info.cend()) {
if (required) {
using namespace std::string_literals;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -243,8 +243,7 @@ class Deserializer {

static Idx find_key_from_map(msgpack::object const& map, std::string_view key) {
auto const kv_map = map.as<MapSpan>();
auto const found =
std::find_if(kv_map.begin(), kv_map.end(), [key](auto const& x) { return key_to_string(x) == key; });
auto const found = std::ranges::find_if(kv_map, [key](auto const& x) { return key_to_string(x) == key; });
if (found == kv_map.end()) {
return -1;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@ class Fault final : public Base {

constexpr auto supported = std::array{three_phase, single_phase_to_ground, two_phase, two_phase_to_ground};

if (std::find(cbegin(supported), cend(supported), fault_type_) == cend(supported)) {
if (std::ranges::find(supported, fault_type_) == cend(supported)) {
throw InvalidShortCircuitType(fault_type_);
}

Expand Down Expand Up @@ -184,7 +184,7 @@ class Fault final : public Base {
using enum FaultPhase;

auto const check_supported = [&](auto const& iterable) {
if (std::find(cbegin(iterable), cend(iterable), fault_phase_) == cend(iterable)) {
if (std::ranges::find(iterable, fault_phase_) == cend(iterable)) {
throw InvalidShortCircuitPhases(fault_type_, fault_phase_);
}
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -157,8 +157,7 @@ class SparseGroupedIdxVector {
auto element_size() const { return indptr_.back(); }
auto get_group(Idx element) const -> Idx {
assert(element < element_size());
return std::distance(std::begin(indptr_), std::upper_bound(std::begin(indptr_), std::end(indptr_), element)) -
1;
return std::distance(std::begin(indptr_), std::ranges::upper_bound(indptr_, element)) - 1;
}

SparseGroupedIdxVector() = default;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -66,8 +66,7 @@ class MainModelImpl<ExtraRetrievableTypes<ExtraRetrievableType...>, ComponentLis
static constexpr size_t n_types = sizeof...(C);

static size_t find_index(std::string const& name) {
auto const found = std::find_if(component_index_map.cbegin(), component_index_map.cend(),
[&name](auto x) { return x == name; });
auto const found = std::ranges::find_if(component_index_map, [&name](auto x) { return x == name; });
assert(found != component_index_map.cend());
return found->index;
}
Expand Down