186 lines
5.5 KiB
YAML
186 lines
5.5 KiB
YAML
---
|
|
# ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
|
# 🧪 Pipeline 1: Feature Branch Validation
|
|
# Trigger: Push to feature/* or fix/* branches
|
|
# Purpose: Fast feedback for developers - build and test only
|
|
# ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
|
kind: pipeline
|
|
type: kubernetes
|
|
name: feature-validation
|
|
|
|
metadata:
|
|
namespace: musk-drone
|
|
|
|
trigger:
|
|
ref:
|
|
- refs/heads/feature/*
|
|
- refs/heads/issues/*
|
|
- refs/heads/fix/*
|
|
event:
|
|
- push
|
|
|
|
clone:
|
|
disable: true
|
|
|
|
# Service container for Testcontainers
|
|
services:
|
|
- name: docker
|
|
image: docker:27-dind
|
|
privileged: true
|
|
volumes:
|
|
- name: dockersock
|
|
path: /var/run
|
|
|
|
volumes:
|
|
- name: dockersock
|
|
temp: {}
|
|
- name: nuget-cache
|
|
temp: {}
|
|
|
|
steps:
|
|
- name: clone
|
|
image: alpine/git
|
|
commands:
|
|
- git clone https://gitea.musk.fun/nocr/flea
|
|
- cd flea
|
|
- git checkout $DRONE_COMMIT
|
|
- git submodule update --init --recursive
|
|
|
|
- name: dotnet-restore
|
|
image: mcr.microsoft.com/dotnet/sdk:8.0
|
|
volumes:
|
|
- name: nuget-cache
|
|
path: /root/.nuget/packages
|
|
commands:
|
|
- cd flea
|
|
- dotnet nuget add source --name musk https://gitea.musk.fun/api/packages/nocr/nuget/index.json
|
|
- echo "🔄 Restoring all projects..."
|
|
- dotnet restore telegram-listener/Nocr.TelegramListener.sln
|
|
- dotnet restore telegram-client/Nocr.TelegramClient.sln
|
|
- dotnet restore text-matcher/Nocr.TextMatcher.sln
|
|
- dotnet restore users/Nocr.Users.sln
|
|
depends_on:
|
|
- clone
|
|
|
|
- name: dotnet-build
|
|
image: mcr.microsoft.com/dotnet/sdk:8.0
|
|
volumes:
|
|
- name: nuget-cache
|
|
path: /root/.nuget/packages
|
|
commands:
|
|
- cd flea
|
|
- echo "🔨 Building all projects..."
|
|
- dotnet build telegram-listener/Nocr.TelegramListener.sln --no-restore -c Debug
|
|
- dotnet build telegram-client/Nocr.TelegramClient.sln --no-restore -c Debug
|
|
- dotnet build text-matcher/Nocr.TextMatcher.sln --no-restore -c Debug
|
|
- dotnet build users/Nocr.Users.sln --no-restore -c Debug
|
|
depends_on:
|
|
- dotnet-restore
|
|
|
|
- name: dotnet-test
|
|
image: mcr.microsoft.com/dotnet/sdk:8.0
|
|
volumes:
|
|
- name: nuget-cache
|
|
path: /root/.nuget/packages
|
|
- name: dockersock
|
|
path: /var/run
|
|
environment:
|
|
DOCKER_HOST: unix:///var/run/docker.sock
|
|
commands:
|
|
- cd flea
|
|
- echo "🧪 Running tests..."
|
|
- dotnet test text-matcher/Nocr.TextMatcher.sln --no-build -c Debug --logger trx --results-directory ./test-results
|
|
- echo "✅ Tests completed"
|
|
depends_on:
|
|
- dotnet-build
|
|
- docker
|
|
---
|
|
# ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
|
# 📝 Pipeline 2: Main Branch Validation
|
|
# Trigger: Push to main branch
|
|
# Purpose: Validate main branch after merge
|
|
# ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
|
kind: pipeline
|
|
type: kubernetes
|
|
name: main-validation
|
|
|
|
metadata:
|
|
namespace: musk-drone
|
|
|
|
trigger:
|
|
ref:
|
|
- refs/heads/main
|
|
event:
|
|
- push
|
|
|
|
clone:
|
|
disable: true
|
|
|
|
services:
|
|
- name: docker
|
|
image: docker:27-dind
|
|
privileged: true
|
|
volumes:
|
|
- name: dockersock
|
|
path: /var/run
|
|
|
|
volumes:
|
|
- name: dockersock
|
|
temp: {}
|
|
- name: nuget-cache
|
|
temp: {}
|
|
|
|
steps:
|
|
- name: clone
|
|
image: alpine/git
|
|
commands:
|
|
- git clone https://gitea.musk.fun/nocr/flea
|
|
- cd flea
|
|
- git checkout $DRONE_COMMIT
|
|
- git submodule update --init --recursive
|
|
|
|
- name: dotnet-restore
|
|
image: mcr.microsoft.com/dotnet/sdk:8.0
|
|
volumes:
|
|
- name: nuget-cache
|
|
path: /root/.nuget/packages
|
|
commands:
|
|
- cd flea
|
|
- dotnet nuget add source --name musk https://gitea.musk.fun/api/packages/nocr/nuget/index.json
|
|
- dotnet restore telegram-listener/Nocr.TelegramListener.sln
|
|
- dotnet restore telegram-client/Nocr.TelegramClient.sln
|
|
- dotnet restore text-matcher/Nocr.TextMatcher.sln
|
|
- dotnet restore users/Nocr.Users.sln
|
|
depends_on:
|
|
- clone
|
|
|
|
- name: dotnet-build
|
|
image: mcr.microsoft.com/dotnet/sdk:8.0
|
|
volumes:
|
|
- name: nuget-cache
|
|
path: /root/.nuget/packages
|
|
commands:
|
|
- cd flea
|
|
- dotnet build telegram-listener/Nocr.TelegramListener.sln --no-restore -c Release
|
|
- dotnet build telegram-client/Nocr.TelegramClient.sln --no-restore -c Release
|
|
- dotnet build text-matcher/Nocr.TextMatcher.sln --no-restore -c Release
|
|
- dotnet build users/Nocr.Users.sln --no-restore -c Release
|
|
depends_on:
|
|
- dotnet-restore
|
|
|
|
- name: dotnet-test
|
|
image: mcr.microsoft.com/dotnet/sdk:8.0
|
|
volumes:
|
|
- name: nuget-cache
|
|
path: /root/.nuget/packages
|
|
- name: dockersock
|
|
path: /var/run
|
|
environment:
|
|
DOCKER_HOST: unix:///var/run/docker.sock
|
|
commands:
|
|
- cd flea
|
|
- dotnet test text-matcher/Nocr.TextMatcher.sln --no-build -c Release --logger trx --results-directory ./test-results
|
|
depends_on:
|
|
- dotnet-build
|
|
- docker
|