.gitlab-ci.yml 1.03 KB
Newer Older
Wei Shoulin's avatar
Wei Shoulin committed
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
stages:
  - build
  - code_check
  - test
  - deploy

build-job:
  stage: build
  image: python:3.11
  variables:
    GIT_CLONE_PATH: $CI_BUILDS_DIR/work
  before_script:
    - ls
  after_script:
    - ls
  script:
    - whoami
    - echo $SHELL
    - pwd
    - make wheel
  artifacts:
    paths:
      - dist/*.whl
  only:
    - main
  tags:
    - asos2-unit-test

test-job:
  stage: test
  image: python:3.11
  variables:
    GIT_CLONE_PATH: $CI_BUILDS_DIR/work
  script:
    - pip install -r requirements-test.txt -i https://mirrors.aliyun.com/pypi/simple
    - pip install .
    - make test
  coverage: '/TOTAL.*\s+(\d+\%)/'
  only:
    - main
  tags:
    - asos2-unit-test

deploy-job:
  stage: deploy
  image: python:3.11
  variables:
    GIT_CLONE_PATH: $CI_BUILDS_DIR/work
  script:
    - pip install -r requirements-deploy.txt --trusted-host mirror.int.cnlab.net -i http://mirror.int.cnlab.net/repository/py/simple
    - make wheel
    - make publish
  artifacts:
    paths:
      - dist/*.whl    
  only:
    - main
  tags:
    - asos2-unit-test