Commit 19e2c288 authored by Anastasios Pandis's avatar Anastasios Pandis
Browse files

Added CI/CD pipeline, changed pyproject.toml project name for testing the pipeline

parent 51835308
Loading
Loading
Loading
Loading

.gitlab-ci.yml

0 → 100644
+65 −0
Original line number Diff line number Diff line
stages:
  - validate
  - build
  - publish

variables:
  PACKAGE_NAME: sunrise6g-opensdk

validate-mr:
  stage: validate
  image: python:3.12-slim
  before_script:
    - echo "Running validation for merge request..."
    - pip install -r requirements.txt
    - pip install -e .  
    - pip install isort black flake8 pytest 
  script:
    - echo "Running linters..."
    - isort src tests --check --profile black --filter-files
    - black src tests --check --line-length=100
    - flake8 src tests
    - echo "Running tests..."
    - pytest -v tests/common/test_invoke_edgecloud_clients.py
    - pytest -v tests/common/test_invoke_network_clients.py
  only:
    - merge_requests

build-package:
  stage: build
  image: python:3.12-slim
  before_script:
    - pip install build twine
    - pip install -r requirements.txt
    - pip install -e .
  script:
    - echo "Building Python package..."
    - python -m build
    - echo "Package built successfully"
    - ls -la dist/
  artifacts:
    paths:
      - dist/
    expire_in: 1 day
  only:
    - main
    - develop
    - tags

publish-gitlab:
  stage: publish
  image: python:3.12-slim
  dependencies:
    - build-package
  before_script:
    - pip install twine
  script:
    - echo "Validating package format..."
    - twine check dist/*
    - echo "Publishing to Package Registry..."
    - TWINE_PASSWORD="$CI_JOB_TOKEN" TWINE_USERNAME="gitlab-ci-token" python -m twine upload --repository-url ${CI_API_V4_URL}/projects/${CI_PROJECT_ID}/packages/pypi dist/*
    - echo "Package published successfully"
  only:
    - main
    - develop
    - tags
+1 −1
Original line number Diff line number Diff line
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"

[project]
name = "sunrise6g-opensdk"
version = "1.0.5"
version = "1.0.5-test1"
description = "Open source SDK to abstract CAMARA/GSMA Transformation Functions (TFs) for Edge Cloud platforms, 5G network cores and Open RAN solutions."
keywords = [
  "Federation",