From 2b482277900c0a27442f276b7fa76ff8ce2acf73 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=90=9B=E8=82=AF=E6=99=AE=E9=80=9A?= Date: Fri, 28 Nov 2025 19:00:26 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=20.drone.yml?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .drone.yml | 33 +++++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) create mode 100644 .drone.yml diff --git a/.drone.yml b/.drone.yml new file mode 100644 index 0000000..09af2b5 --- /dev/null +++ b/.drone.yml @@ -0,0 +1,33 @@ +kind: pipeline +type: docker +name: multi-lang-ci + +# 克隆策略:只拉最新 commit,加速 +clone: + depth: 1 + +steps: + # 自动检测是否存在 Java (pom.xml) + - name: java-build + image: maven:3.8-eclipse-temurin-17 + commands: + - if [ -f pom.xml ]; then mvn clean compile; fi + when: + event: [ push, pull_request ] + + # 自动检测是否存在 Python (requirements.txt) + - name: python-test + image: python:3.9-slim + 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 + commands: + - echo "✅ CI completed at $(date)" + when: + status: [ success, failure ] \ No newline at end of file