Skip to content
Snippets Groups Projects
build.gitlab-ci.yml 2.75 KiB
Newer Older
build:ubuntu_cpp:
  stage: build
  tags:
    - docker
  script:
Olivier BICHLER's avatar
Olivier BICHLER committed
    # Download dependencies
    # aidge_core
    - 'curl --location --output build_artifacts.zip "https://gitlab.eclipse.org/api/v4/projects/5139/jobs/artifacts/main/download?job=build:ubuntu_cpp"'
    - unzip -o build_artifacts.zip -d .
    - rm -rf build_cpp

    # Build current module
Olivier BICHLER's avatar
Olivier BICHLER committed
    - export CMAKE_PREFIX_PATH=../install_cpp
Olivier BICHLER's avatar
Olivier BICHLER committed
    - mkdir -p build_cpp
    - cd build_cpp
Olivier BICHLER's avatar
Olivier BICHLER committed
    - cmake -DCMAKE_INSTALL_PREFIX:PATH=../install_cpp -DCMAKE_BUILD_TYPE=Debug -DWERROR=ON ..
    - make -j4 all install

  artifacts:
    paths:
      - build_cpp/
      - install_cpp/

build:ubuntu_python:
  stage: build
  tags:
    - docker
  script:
Olivier BICHLER's avatar
Olivier BICHLER committed
    # Download dependencies
Olivier BICHLER's avatar
Olivier BICHLER committed
    # aidge_core (CPP)
    - 'curl --location --output build_artifacts.zip "https://gitlab.eclipse.org/api/v4/projects/5139/jobs/artifacts/main/download?job=build:ubuntu_cpp"'
    - unzip -o build_artifacts.zip -d .
    - rm -rf build_cpp
    # aidge_core (Python)
Olivier BICHLER's avatar
Olivier BICHLER committed
    - 'curl --location --output build_artifacts.zip "https://gitlab.eclipse.org/api/v4/projects/5139/jobs/artifacts/main/download?job=build:ubuntu_python"'
    - unzip -o build_artifacts.zip -d .
    - python3 -m pip install virtualenv
    - virtualenv venv
    - source venv/bin/activate
Olivier BICHLER's avatar
Olivier BICHLER committed
    - export AIDGE_INSTALL=`pwd`/install
Olivier BICHLER's avatar
Olivier BICHLER committed
    - export CMAKE_PREFIX_PATH=../install_cpp
Olivier BICHLER's avatar
Olivier BICHLER committed
    - python3 -m pip install .
  artifacts:
    paths:
Olivier BICHLER's avatar
Olivier BICHLER committed
      - venv/

build:windows_cpp:
  stage: build
  needs: []
  tags:
    - windows

  image: buildtools
  before_script:
    # Install Chocolatey
    - Set-ExecutionPolicy Bypass -Scope Process -Force; [System.Net.ServicePointManager]::SecurityProtocol = [System.Net.ServicePointManager]::SecurityProtocol -bor 3072; iex ((New-Object System.Net.WebClient).DownloadString('https://community.chocolatey.org/install.ps1'))
    # Install dependencies
    - choco install cmake.install --installargs '"ADD_CMAKE_TO_PATH=System"' -Y
    - choco install git -Y
    - choco install python -Y
    # Update PATH
    - $env:Path = [System.Environment]::GetEnvironmentVariable("Path","Machine") + ";" + [System.Environment]::GetEnvironmentVariable("Path","User")
  script:
    # Download dependencies
    # aidge_core
    - 'curl "https://gitlab.eclipse.org/api/v4/projects/5139/jobs/artifacts/main/download?job=build:windows_cpp" -o build_artifacts.zip'
    - Expand-Archive -Path .\build_artifacts.zip -DestinationPath . -Force
    - Remove-Item .\build_cpp\ -Recurse

    - $env:CMAKE_PREFIX_PATH = '../install_cpp'
    - mkdir -p build_cpp
    - cd build_cpp
    - cmake -DCMAKE_INSTALL_PREFIX:PATH=../install_cpp -DCMAKE_BUILD_TYPE=Debug ..
    - cmake --build . -j2
    - cmake --install . --config Debug

  artifacts:
    paths:
      - build_cpp/
      - install_cpp/