瀏覽代碼

Add drone (CI) files

add_tests
demisel 6 月之前
父節點
當前提交
510fbd9a96
共有 2 個檔案被更改,包括 31 行新增0 行删除
  1. 20
    0
      .drone.yml
  2. 11
    0
      Dockerfile

+ 20
- 0
.drone.yml 查看文件

@@ -0,0 +1,20 @@
1
+kind: pipeline
2
+type: docker
3
+name: run_tests
4
+
5
+volumes:
6
+- name: docker_sock
7
+  host:
8
+    path: /var/run/docker.sock
9
+
10
+steps:
11
+- name: build and test in docker image
12
+  image: docker
13
+  volumes:
14
+  - name: docker_sock
15
+    path: /var/run/docker.sock
16
+  commands:
17
+  - docker build --build-arg STAGE=test -t mytestimage .
18
+  - docker run --network="host" mytestimage python -m pytest test
19
+  when:
20
+    event: [push]

+ 11
- 0
Dockerfile 查看文件

@@ -0,0 +1,11 @@
1
+FROM python:3.11-buster
2
+
3
+
4
+RUN pip install poetry
5
+
6
+COPY pyproject.toml poetry.lock ./
7
+COPY ./million ./million
8
+COPY ./test ./test
9
+
10
+RUN poetry config virtualenvs.create false \
11
+    && poetry install --no-interaction --no-ansi

Loading…
取消
儲存