-
Notifications
You must be signed in to change notification settings - Fork 22
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
This makes sure that clients can use a version of Au that is installed by CMake. First, we add the new workflow, to make sure that it [breaks] in exactly the way that reveals #359. Then, in a new commit in this same PR, we will fix the bug. [breaks]: https://github.com/aurora-opensource/au/actions/runs/12341997471/job/34441316121?pr=360 Fixes #359.
- Loading branch information
Showing
5 changed files
with
114 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
# Copyright 2024 Aurora Operations, Inc. | ||
# | ||
# Licensed under the Apache License, Version 2.0 (the "License"); | ||
# you may not use this file except in compliance with the License. | ||
# You may obtain a copy of the License at | ||
# | ||
# http://www.apache.org/licenses/LICENSE-2.0 | ||
# | ||
# Unless required by applicable law or agreed to in writing, software | ||
# distributed under the License is distributed on an "AS IS" BASIS, | ||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
# See the License for the specific language governing permissions and | ||
# limitations under the License. | ||
|
||
name: cmake-client-build-and-test | ||
|
||
on: | ||
push: | ||
branches: | ||
- main | ||
pull_request: | ||
|
||
jobs: | ||
cmake-build-and-test: | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- uses: actions/checkout@44c2b7a8a4ea60a981eaca3cf939b5f4305c123b #v4.1.5 | ||
- name: Setup CMake | ||
uses: jwlawson/actions-setup-cmake@802fa1a2c4e212495c05bf94dba2704a92a472be #v2.0.2 | ||
with: | ||
cmake-version: '3.29.x' | ||
- name: Generate build files for Au | ||
run: cmake -S . -B cmake/build -DAU_EXCLUDE_GTEST_DEPENDENCY=TRUE -DCMAKE_VERIFY_INTERFACE_HEADER_SETS=TRUE | ||
- name: Build Au | ||
run: cmake --build cmake/build --target all all_verify_interface_header_sets | ||
- name: Install Au | ||
run: cmake --install cmake/build --prefix "$PWD/cmake/install" | ||
- name: Generate build files for client | ||
run: cmake -S . -B build -DCMAKE_PREFIX_PATH="$PWD/../cmake/install" | ||
working-directory: test_package | ||
- name: Build client | ||
run: cmake --build build --target all | ||
working-directory: test_package | ||
- name: Run executable | ||
run: ./build/test_au_client | ||
working-directory: test_package |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,5 @@ | ||
/bazel-* | ||
cmake/build* | ||
cmake/install* | ||
test_package/build* | ||
Testing |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
# Copyright 2024 Aurora Operations, Inc. | ||
# | ||
# Licensed under the Apache License, Version 2.0 (the "License"); | ||
# you may not use this file except in compliance with the License. | ||
# You may obtain a copy of the License at | ||
# | ||
# http://www.apache.org/licenses/LICENSE-2.0 | ||
# | ||
# Unless required by applicable law or agreed to in writing, software | ||
# distributed under the License is distributed on an "AS IS" BASIS, | ||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
# See the License for the specific language governing permissions and | ||
# limitations under the License. | ||
|
||
cmake_minimum_required(VERSION 3.29) | ||
|
||
project(test_au_client LANGUAGES CXX) | ||
|
||
find_package(Au REQUIRED CONFIG) | ||
|
||
add_executable(${PROJECT_NAME} test_au_client.cc) | ||
target_link_libraries(${PROJECT_NAME} PRIVATE Au::au) | ||
target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_14) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
// Copyright 2024 Aurora Operations, Inc. | ||
// | ||
// Licensed under the Apache License, Version 2.0 (the "License"); | ||
// you may not use this file except in compliance with the License. | ||
// You may obtain a copy of the License at | ||
// | ||
// http://www.apache.org/licenses/LICENSE-2.0 | ||
// | ||
// Unless required by applicable law or agreed to in writing, software | ||
// distributed under the License is distributed on an "AS IS" BASIS, | ||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
// See the License for the specific language governing permissions and | ||
// limitations under the License. | ||
|
||
#include <iostream> | ||
|
||
#include "au/io.hh" | ||
#include "au/prefix.hh" | ||
#include "au/units/hours.hh" | ||
#include "au/units/meters.hh" | ||
#include "au/units/seconds.hh" | ||
|
||
using ::au::symbols::h; | ||
using ::au::symbols::m; | ||
using ::au::symbols::s; | ||
constexpr auto km = ::au::kilo(m); | ||
|
||
int main(int argc, char **argv) { | ||
constexpr auto v1 = 1 * m / s; | ||
constexpr auto v2 = 1 * km / h; | ||
std::cout << "(" << v1 << ") + (" << v2 << ") = " << (v1 + v2) << std::endl; | ||
return 0; | ||
} |