Commit e6d47291 authored by Arun Babu Neelicattu's avatar Arun Babu Neelicattu
Browse files

ci: add initial build pipeline

parent eca8c243
Pipeline #3532 passed with stages
in 2 minutes and 40 seconds
default:
image: registry.fedoraproject.org/fedora-minimal:latest
stages:
- build
- test
- trigger
build:lib:
stage: build
tags:
- docker
script:
- microdnf --nodocs install cmake gcc gcc-c++
- cmake . -Bbuild
- cmake --build build
artifacts:
paths:
- build/
test:lib:
stage: test
tags:
- docker
needs:
- build:lib
script:
- microdnf --nodocs install cmake
- pushd build/tests
- ctest .
trigger:android:
stage: trigger
trigger:
strategy: depend
include: android/.gitlab-ci.yml
trigger:javascript:
stage: trigger
trigger:
strategy: depend
include: javascript/.gitlab-ci.yml
trigger:python:
stage: trigger
trigger:
strategy: depend
include: python/.gitlab-ci.yml
# TODO: consider replacing this with a smaller image
image: docker.io/inovex/gitlab-ci-android
stages:
- build
- test
variables:
GRADLE_OPTS: "-Dorg.gradle.daemon=false"
before_script:
- export GRADLE_USER_HOME=$(pwd)/.gradle
- export ANDROID_HOME=${ANDORID_SDK_HOME}
- echo "sdk.dir=${ANDROID_SDK_HOME}" > ./android/local.properties
- echo "ndk.dir=${ANDROID_NDK_HOME}" >> ./android/local.properties
- cp -R $ANDROID_SDK_ROOT/licenses ./android/.
- chmod +x ./android/gradlew
cache:
key: ${CI_PROJECT_ID}
paths:
- android/.gradle/
build:android:aar:
stage: build
tags:
- docker
script:
- pushd android
- ./gradlew clean assembleRelease
artifacts:
expire_in: 1 weeks
paths:
- android/olm-sdk/build/outputs/aar/*.aar
- android/local.properties
test:android:aar:
stage: test
tags:
- docker
script:
- pushd android
# TODO: fix this?
# - ./gradlew test
needs:
- build:android:aar
default:
image: docker.io/emscripten/emsdk:latest
stages:
- build
- test
build:js:
stage: build
script:
- ln -sf $(which python3) /usr/local/bin/python
- make js
artifacts:
paths:
- build/javascript
- javascript/olm.js
- javascript/olm.wasm
- javascript/exported_functions.json
test:js:
stage: test
needs:
- build:js
script:
- pushd javascript
- npm i
- npm run test
variables:
PIP_CACHE_DIR: "$CI_PROJECT_DIR/.cache/pip"
LD_LIBRARY_PATH: "$CI_PROJECT_DIR/build"
DEFAULT_PYTHON: "3.9"
cache:
paths:
- .cache/pip
stages:
- build
- test
- dist
before_script:
- pushd python
- pip --disable-pip-version-check install --upgrade pip
build:python:
stage: build
image: docker.io/python:$DEFAULT_PYTHON
cache: { }
before_script: [ ]
script:
- apt-get -y update && apt-get -y install cmake
- cmake . -Bbuild
- cmake --build build
artifacts:
paths:
- build
test:python:
stage: test
image: docker.io/python:$PYTHON_VERSIONS
parallel:
matrix:
- PYTHON_VERSIONS: [ "3.6", "3.7", "3.8", "3.9" ]
script:
- pip install tox
- make headers
- tox -e py
dependencies:
- build:python
artifacts:
paths:
- python/.coverage
- python/coverage.xml
dist:python:sdist:
stage: dist
image: docker.io/python:$DEFAULT_PYTHON
script:
- pip install build
- python -m build --sdist
dependencies: [ ]
artifacts:
paths:
- python/build/**
- python/dist/*.tar.gz
dist:python:wheel:
stage: dist
image: docker.io/python:$PYTHON_VERSIONS
parallel:
matrix:
- PYTHON_VERSIONS: [ "3.6", "3.7", "3.8", "3.9" ]
script:
- pip install build
- python -m build --wheel
dependencies:
- build:python
artifacts:
paths:
- python/build/**
- python/dist/*.whl
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment