| echo Executing Build and Tests | echo Executing Build and Tests | ||||
| reg add HKLM\SYSTEM\CurrentControlSet\Control\FileSystem /v LongPathsEnabled /t REG_DWORD /d 1 /f || exit 1 | reg add HKLM\SYSTEM\CurrentControlSet\Control\FileSystem /v LongPathsEnabled /t REG_DWORD /d 1 /f || exit 1 | ||||
| python -m pip install pytest pytest-xdist || exit 1 | python -m pip install pytest pytest-xdist || exit 1 | ||||
| python -u tools/ci.py -B download -T tools\msvc.dds || exit 1 | |||||
| python -u tools/ci.py -B download -T tools\msvc.dds -T2 tools\msvc.jsonc || exit 1 | |||||
| displayName: Full CI | displayName: Full CI | ||||
| - publish: _build/dds.exe | - publish: _build/dds.exe | ||||
| artifact: DDS Executable - Windows VS2019 | artifact: DDS Executable - Windows VS2019 | ||||
| sudo apt install -y python3-minimal g++-9 ccache | sudo apt install -y python3-minimal g++-9 ccache | ||||
| python3 -m pip install pytest pytest-xdist | python3 -m pip install pytest pytest-xdist | ||||
| displayName: Prepare System | displayName: Prepare System | ||||
| - script: python3 -u tools/ci.py -B download -T tools/gcc-9.dds | |||||
| - script: python3 -u tools/ci.py -B download -T tools/gcc-9.dds -T2 tools/gcc-9.jsonc | |||||
| displayName: Full CI | displayName: Full CI | ||||
| - publish: _build/dds | - publish: _build/dds | ||||
| artifact: DDS Executable - Linux | artifact: DDS Executable - Linux | ||||
| - script: | | - script: | | ||||
| set -eu | set -eu | ||||
| python3 -m pip install pytest pytest-xdist | python3 -m pip install pytest pytest-xdist | ||||
| python3 -u tools/ci.py -B download -T tools/gcc-9.dds | |||||
| python3 -u tools/ci.py -B download -T tools/gcc-9.dds -T2 tools/gcc-9.jsonc | |||||
| displayName: Build and Run Unit Tests | displayName: Build and Run Unit Tests | ||||
| - publish: _build/dds | - publish: _build/dds | ||||
| artifact: DDS Executable - macOS | artifact: DDS Executable - macOS |
| #include <dds/repo/repo.hpp> | #include <dds/repo/repo.hpp> | ||||
| #include <dds/source/dist.hpp> | #include <dds/source/dist.hpp> | ||||
| #include <dds/toolchain/from_dds.hpp> | #include <dds/toolchain/from_dds.hpp> | ||||
| #include <dds/toolchain/from_json.hpp> | |||||
| #include <dds/util/fs.hpp> | #include <dds/util/fs.hpp> | ||||
| #include <dds/util/paths.hpp> | #include <dds/util/paths.hpp> | ||||
| #include <dds/util/signal.hpp> | #include <dds/util/signal.hpp> | ||||
| } | } | ||||
| return std::move(*tc); | return std::move(*tc); | ||||
| } else { | } else { | ||||
| return dds::parse_toolchain_dds(dds::slurp_file(tc_path)); | |||||
| return dds::parse_toolchain_json5(dds::slurp_file(tc_path)); | |||||
| // return dds::parse_toolchain_dds(dds::slurp_file(tc_path)); | |||||
| } | } | ||||
| } | } | ||||
| }; | }; |
| { | |||||
| "compiler_id": 'gnu', | |||||
| "cxx_version": 'c++17', | |||||
| "cxx_compiler": 'g++-9', | |||||
| "flags": '-DSPDLOG_COMPILED_LIB', | |||||
| } |
| { | |||||
| "compiler_id": 'msvc', | |||||
| "flags": '-DSPDLOG_COMPILED_LIB', | |||||
| } |
| def test_get_build_use_spdlog(dds: DDS): | def test_get_build_use_spdlog(dds: DDS): | ||||
| dds.catalog_import(dds.source_root / 'catalog.json') | dds.catalog_import(dds.source_root / 'catalog.json') | ||||
| tc_fname = 'gcc.tc.dds' if 'gcc' in dds.default_builtin_toolchain else 'msvc.tc.dds' | |||||
| tc_fname = 'gcc.tc.jsonc' if 'gcc' in dds.default_builtin_toolchain else 'msvc.tc.jsonc' | |||||
| tc = str(dds.test_dir / tc_fname) | tc = str(dds.test_dir / tc_fname) | ||||
| dds.build(toolchain=tc, apps=True) | dds.build(toolchain=tc, apps=True) | ||||
| proc.check_run((dds.build_dir / 'use-spdlog').with_suffix(dds.exe_suffix)) | proc.check_run((dds.build_dir / 'use-spdlog').with_suffix(dds.exe_suffix)) |
| class CIOptions(NamedTuple): | class CIOptions(NamedTuple): | ||||
| toolchain: str | toolchain: str | ||||
| toolchain_json5: str | |||||
| def _do_bootstrap_build(opts: CIOptions) -> None: | def _do_bootstrap_build(opts: CIOptions) -> None: | ||||
| '-T', | '-T', | ||||
| help='The toolchain to use for the CI process', | help='The toolchain to use for the CI process', | ||||
| required=True) | required=True) | ||||
| parser.add_argument( | |||||
| '--toolchain-json5', | |||||
| '-T2', | |||||
| help='The toolchain JSON to use with the bootstrapped executable', | |||||
| required=True, | |||||
| ) | |||||
| args = parser.parse_args(argv) | args = parser.parse_args(argv) | ||||
| opts = CIOptions(toolchain=args.toolchain) | |||||
| opts = CIOptions( | |||||
| toolchain=args.toolchain, toolchain_json5=args.toolchain_json5) | |||||
| if args.bootstrap_with == 'build': | if args.bootstrap_with == 'build': | ||||
| _do_bootstrap_build(opts) | _do_bootstrap_build(opts) | ||||
| ]) | ]) | ||||
| self_build( | self_build( | ||||
| paths.CUR_BUILT_DDS, | paths.CUR_BUILT_DDS, | ||||
| toolchain=opts.toolchain, | |||||
| toolchain=opts.toolchain_json5, | |||||
| dds_flags=[f'--repo-dir={ci_repo_dir}', f'--catalog={cat_path}']) | dds_flags=[f'--repo-dir={ci_repo_dir}', f'--catalog={cat_path}']) | ||||
| print('Bootstrap test PASSED!') | print('Bootstrap test PASSED!') | ||||
| { | |||||
| "$schema": "../res/toolchain-schema.json", | |||||
| "compiler_id": "gnu", | |||||
| "c_compiler": "gcc-9", | |||||
| "cxx_compiler": "g++-9", | |||||
| "cxx_version": "c++17", | |||||
| "flags": [ | |||||
| "-DSPDLOG_COMPILED_LIB", // Required to use a compiled spdlog | |||||
| "-Werror=return-type" | |||||
| ], | |||||
| "cxx_flags": [ | |||||
| "-fconcepts" | |||||
| ], | |||||
| // "debug": true, | |||||
| "optimize": true, | |||||
| "compiler_launcher": "ccache" | |||||
| } |
| { | |||||
| "$schema": "../res/toolchain-schema.json", | |||||
| "compiler_id": "msvc", | |||||
| "flags": [ | |||||
| "/experimental:preprocessor", // Required for range-v3 | |||||
| "/DSPDLOG_COMPILED_LIB", // Required to use spdlog as a compiled lib | |||||
| "/std:c++latest", | |||||
| ], | |||||
| "link_flags": [ | |||||
| "rpcrt4.lib", | |||||
| ], | |||||
| // "debug": true, | |||||
| "optimize": true | |||||
| } |