cicd-test/.drone.yml
君肯普通 172ff7e011
Some checks reported errors
continuous-integration/drone/push Build encountered an error
禁止远程拉取镜像
2025-12-05 10:58:02 +08:00

36 lines
898 B
YAML
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

kind: pipeline
type: docker
name: multi-lang-ci
# 克隆策略:只拉最新 commit加速
clone:
depth: 1
steps:
# 自动检测是否存在 Java (pom.xml)
- name: java-build
image: maven:3.9-eclipse-temurin
pull: false
commands:
- if [ -f pom.xml ]; then mvn clean compile; fi
when:
event: [ push, pull_request ]
# 自动检测是否存在 Python (requirements.txt)
- name: python-test
image: python:3.12.0-slim
pull: false
commands:
- if [ -f requirements.txt ]; then pip install -r requirements.txt; fi
- if [ -f test_example.py ]; then python -m pytest test_example.py -v; fi
when:
event: [ push, pull_request ]
# 最终报告(无论成功失败都运行)
- name: summary
image: alpine
pull: false
commands:
- echo "✅ CI completed at $(date)"
when:
status: [ success, failure ]