Skip to content

Commit 78ca3d5

Browse files
authored
Test downstream (#351)
1 parent 7690b8b commit 78ca3d5

6 files changed

Lines changed: 1249 additions & 0 deletions

File tree

.github/workflows/build_test.yml

Lines changed: 64 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -129,3 +129,67 @@ jobs:
129129
run: python3 -u test/scripts/tidy_output.py build/test/output/odr-private/output
130130
- name: compare private test outputs
131131
run: python3 -u test/scripts/compare_output.py --driver firefox --max-workers 1 test/data/reference-output/odr-private/output build/test/output/odr-private/output
132+
133+
build-test-downstream:
134+
runs-on: ${{ matrix.config.os }}
135+
strategy:
136+
fail-fast: false
137+
matrix:
138+
config:
139+
- { os: ubuntu-22.04, compiler: clang, cc: clang-15, cxx: clang++-15 }
140+
- { os: ubuntu-22.04, compiler: gcc, cc: gcc-13, cxx: g++-13 }
141+
- { os: macos-12, compiler: clang, cc: clang, cxx: clang++ }
142+
- { os: windows-2022, compiler: msvc }
143+
144+
steps:
145+
- name: ubuntu install ccache
146+
if: runner.os == 'Linux'
147+
run: |
148+
sudo apt install ccache
149+
ccache -V
150+
- name: macos install ccache
151+
if: runner.os == 'macOS'
152+
run: |
153+
brew install ccache
154+
ccache -V
155+
156+
- name: set up python 3.8
157+
uses: actions/setup-python@v2
158+
with:
159+
python-version: 3.8
160+
- name: install python dependencies
161+
run: pip install --upgrade pip conan==1.*
162+
163+
- name: cache
164+
uses: actions/cache@v2
165+
with:
166+
path: |
167+
~/.ccache
168+
/Users/runner/Library/Caches/ccache
169+
~/.conan/data
170+
C:/.conan
171+
C:/Users/runneradmin/.conan/data
172+
key: ${{ matrix.config.os }}-${{ matrix.config.compiler }}-${{ env.CCACHE_KEY_SUFFIX }}
173+
restore-keys: |
174+
${{ matrix.config.os }}-${{ matrix.config.compiler }}-
175+
176+
- name: checkout
177+
uses: actions/checkout@v2
178+
179+
- name: conan
180+
run: conan export . odrcore/0.0.0@
181+
182+
- name: cmake
183+
env:
184+
CC: ${{ matrix.config.cc }}
185+
CXX: ${{ matrix.config.cxx }}
186+
run: cmake -B test/downstream/build -S test/downstream -DCMAKE_BUILD_TYPE=Release -DCMAKE_CXX_COMPILER_LAUNCHER=ccache
187+
- name: build
188+
run: cmake --build test/downstream/build --config Release # `config Release` somehow necessary for windows
189+
190+
- name: run
191+
if: runner.os != 'Windows'
192+
run: test/downstream/build/odr-test-downstream
193+
- name: run
194+
if: runner.os == 'Windows'
195+
run: test/downstream/build/Release/odr-test-downstream.exe

test/downstream/CMakeLists.txt

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
cmake_minimum_required(VERSION 3.12.4)
2+
3+
project(odr-test-downstream LANGUAGES C CXX)
4+
set(CMAKE_CXX_STANDARD 17)
5+
set(CMAKE_CXX_STANDARD_REQUIRED ON)
6+
set(CMAKE_CXX_EXTENSIONS OFF)
7+
8+
if (NOT DEFINED CONAN_EXPORTED)
9+
include("cmake/conan.cmake")
10+
conan_cmake_configure(GENERATORS cmake)
11+
conan_cmake_autodetect(settings)
12+
conan_cmake_install(PATH_OR_REFERENCE ".."
13+
BUILD missing
14+
SETTINGS ${settings}
15+
ENV CC=${CMAKE_C_COMPILER}
16+
ENV CXX=${CMAKE_CXX_COMPILER})
17+
include("${CMAKE_BINARY_DIR}/conan_paths.cmake")
18+
endif ()
19+
20+
find_package(odr REQUIRED)
21+
22+
add_executable(odr-test-downstream main.cpp)
23+
target_link_libraries(odr-test-downstream PRIVATE odr::odr)

0 commit comments

Comments
 (0)