diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml new file mode 100644 index 000000000..c1715756a --- /dev/null +++ b/.gitlab-ci.yml @@ -0,0 +1,162 @@ +# SPDX-FileCopyrightText: James Turner +# +# SPDX-License-Identifier: GPL-2.0 + + +variables: + BUILD_DIR: "$CI_PROJECT_DIR/build" + PREFIX_DIR: "$CI_PROJECT_DIR/dist" + + # create a root dir *above* the Simgear checkout, otherwise CMake + # complains about INTERFACE_INCLUDE_DIRECTORIES being the source dir + WIN_FG_DIR: $CI_BUILDS_DIR\flightgear + + # FIXME detect this using vswhere + VS160COMNTOOLS: "C:\\Program Files (x86)\\Microsoft Visual Studio\\2019\\BuildTools\\Common7\\Tools" + VCVARSALL: "${VS160COMNTOOLS}\\..\\..\\VC\\Auxiliary\\Build\\vcvarsall.bat" + VCVARSPLATFORM: "x64" + VCVARSVERSION: "14.29.30133" + + +linux-build: + image: registry.gitlab.com/flightgear/flightgear + stage: build + rules: + - if: $CI_PIPELINE_SOURCE != "schedule" + script: + - cmake -B $BUILD_DIR -S $CI_PROJECT_DIR -G Ninja + -DCMAKE_BUILD_TYPE=RelWithDebInfo + -DCMAKE_INSTALL_PREFIX=$PREFIX_DIR + - cmake --build $BUILD_DIR + - cmake --build $BUILD_DIR --target install + artifacts: + paths: + - dist + needs: + - project: flightgear/simgear + job: linux-build + artifacts: true + ref: next + + +windows-build: + stage: build + tags: + - windows + before_script: + - Invoke-Expression -Command .gitlab\vcvarsall.ps1 + + # relocate our upstream deps outside the source dir, otherwise + # CMake gets sad. + - Move-Item -Path $CI_PROJECT_DIR\boost $WIN_FG_DIR\boost + - Move-Item -Path $CI_PROJECT_DIR\msvc140 $WIN_FG_DIR\msvc140 + - ls + script: + - cmake -B $env:BUILD_DIR -S $env:CI_PROJECT_DIR -G Ninja + -D CMAKE_BUILD_TYPE=RelWithDebInfo + -D CMAKE_INSTALL_PREFIX=$env:PREFIX_DIR + -D MSVC_3RDPARTY_ROOT=$WIN_FG_DIR + -DOSG_FSTREAM_EXPORT_FIXED:BOOL=ON + - cmake --build $BUILD_DIR + - cmake --build $BUILD_DIR --target install + needs: + - project: flightgear/simgear + job: windows-build + ref: next + artifacts: true + - project: flightgear/windows-3rd-party + job: windows_build_msvc140 + ref: master + artifacts: true + artifacts: + paths: + - dist + +macos-build: + stage: build + tags: + - saas-macos-medium-m1 + image: macos-12-xcode-14 + rules: + - if: $CI_PIPELINE_SOURCE != "schedule" + before_script: + - export HOMEBREW_NO_INSTALLED_DEPENDENTS_CHECK=1 + - export HOMEBREW_NO_INSTALL_CLEANUP=1 + - brew install ninja cmake boost + script: + - cmake -B $BUILD_DIR -S $CI_PROJECT_DIR -G Ninja + -DCMAKE_BUILD_TYPE=RelWithDebInfo + -DCMAKE_INSTALL_PREFIX=$PREFIX_DIR + -DCMAKE_OSX_ARCHITECTURES=arm64 + - cmake --build $BUILD_DIR + - cmake --build $BUILD_DIR --target install + needs: + - project: flightgear/simgear + job: macos-build + ref: next + artifacts: true + artifacts: + paths: + - dist + cache: + paths: + - $BUILD_DIR + +macos-x64-build: + stage: build + tags: + - saas-macos-medium-m1 + image: macos-12-xcode-14 + rules: + - if: $CI_PIPELINE_SOURCE != "schedule" + before_script: + - export HOMEBREW_NO_INSTALLED_DEPENDENTS_CHECK=1 + - export HOMEBREW_NO_INSTALL_CLEANUP=1 + - brew install ninja cmake boost + script: + - cmake -B $BUILD_DIR -S $CI_PROJECT_DIR -G Ninja + -DCMAKE_BUILD_TYPE=RelWithDebInfo + -DCMAKE_INSTALL_PREFIX=$PREFIX_DIR + -DCMAKE_OSX_ARCHITECTURES=x86_64 + + - cmake --build $BUILD_DIR + - cmake --build $BUILD_DIR --target install + needs: + - project: flightgear/simgear + job: macos-x64-build + ref: next + artifacts: true + artifacts: + paths: + - dist + cache: + paths: + - $BUILD_DIR + +# test:doc: +# image: registry.gitlab.com/ahayzen/home-dash-alpha-g1 +# stage: test +# rules: +# - if: $CI_PIPELINE_SOURCE != "schedule" +# script: +# - cargo test --all-features --doc +# - cargo test --all-features --all-targets +# cache: +# paths: +# - .cargo +# policy: pull +# dependencies: +# - build + + +# run tests using the binary built before +test: + image: registry.gitlab.com/flightgear/flightgear + stage: test + needs: + - job: linux-build + script: + - cd $BUILD_DIR + - ls + - ./bin/fgfs_test_suite +