.gitlab-ci.yml 4.24 KB
Newer Older
Yi Lin's avatar
Yi Lin committed
1 2 3
# This file is a template, and might need editing before it works on your project.
# Unofficial language image. Look for the different tagged releases at:
# https://hub.docker.com/r/scorpil/rust/tags/
4
image: "qinsoon/ubuntu-zebu-test:latest"
Yi Lin's avatar
Yi Lin committed
5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20

# Optional: Pick zero or more services to be used on all builds.
# Only needed when using a docker container to run your tests in.
# Check out: http://docs.gitlab.com/ce/ci/docker/using_docker_images.html#what-is-service
#services:
#  - mysql:latest
#  - redis:latest
#  - postgres:latest

# Optional: Install a C compiler, cmake and git into the container.
# You will often need this when you (or any of your dependencies) depends on C code.
#before_script:
#- apt-get update -yqq
#- apt-get install -yqq --no-install-recommends build-essential

# Use cargo to test the project
21 22 23 24 25 26 27
# cache:
#   key: "$CI_BUILD_STAGE/$CI_BUILD_REF_NAME"
#   paths:
#     - .cargo/registry/cache
#     - .cargo/registry/index
#     - target
#     - Cargo.lock
John Zhang's avatar
John Zhang committed
28

29 30 31 32
stages:
  - build
  - test

33
build:
34 35 36
  stage: build
  script:
    - rustc --version
37
    - time CARGO_HOME=.cargo RUST_BACKTRACE=1 CC=clang cargo test --release --no-run --color=always
qinsoon's avatar
typo  
qinsoon committed
38
  artifacts:
qinsoon's avatar
qinsoon committed
39
    paths:
Yi Lin's avatar
Yi Lin committed
40
      - target/release/libmu.so
Yi Lin's avatar
Yi Lin committed
41
      - target/release/libmu.a
42
      - target/release/lib-*
43

John Zhang's avatar
John Zhang committed
44
before_script:
qinsoon's avatar
fix  
qinsoon committed
45
  - export PATH=$PATH:/root/.cargo/bin
qinsoon's avatar
qinsoon committed
46
  - export MU_ZEBU=$CI_PROJECT_DIR
qinsoon's avatar
qinsoon committed
47
  - export ZEBU_BUILD=release
Yi Lin's avatar
Yi Lin committed
48 49
  - export CARGO_HOME=.cargo
  - export CC=clang
John Zhang's avatar
John Zhang committed
50

51
test:cargo:api:
52 53
  stage: test
  script:
54
    - RUST_BACKTRACE=1 RUST_TEST_THREADS=1 ./test-release --color=always test_api 2> /dev/null
55 56

test:cargo:ir:
57 58
  stage: test
  script:
59
    - RUST_BACKTRACE=1 RUST_TEST_THREADS=1 ./test-release --color=always test_ir 2> /dev/null
60 61

test:cargo:compiler:
62 63
  stage: test
  script:
64
    - RUST_BACKTRACE=1 RUST_TEST_THREADS=1 ./test-release --color=always test_compiler 2> /dev/null
65 66

test:cargo:runtime:
67 68
  stage: test
  script:
69
    - RUST_BACKTRACE=1 RUST_TEST_THREADS=1 ./test-release --color=always test_runtime 2> /dev/null
John Zhang's avatar
John Zhang committed
70 71

testjit:milestones:
72 73
  stage: test
  script:
74
    - RUST_BACKTRACE=1 pytest tests/test_jit/test_milestones.py -v --color=yes
John Zhang's avatar
John Zhang committed
75 76

testjit:binops:
77 78
  stage: test
  script:
79
    - RUST_BACKTRACE=1 pytest tests/test_jit/test_binops.py -v --color=yes
John Zhang's avatar
John Zhang committed
80 81

testjit:cmpops:
82 83
  stage: test
  script:
84
    - RUST_BACKTRACE=1 pytest tests/test_jit/test_cmpops.py -v --color=yes
John Zhang's avatar
John Zhang committed
85

John Zhang's avatar
John Zhang committed
86 87 88 89
testjit:controlflow:
  stage: test
  script:
    - cd tests/test_jit
90
    - RUST_BACKTRACE=1 pytest test_controlflow.py -v --color=yes
John Zhang's avatar
John Zhang committed
91

John Zhang's avatar
John Zhang committed
92
testjit:convops:
John Zhang's avatar
John Zhang committed
93 94
  stage: test
  script:
95
    - RUST_BACKTRACE=1 pytest tests/test_jit/test_convops.py -v --color=yes
John Zhang's avatar
John Zhang committed
96

John Zhang's avatar
John Zhang committed
97 98 99
testjit:double:
  stage: test
  script:
100
    - RUST_BACKTRACE=1 pytest tests/test_jit/test_double.py -v --color=yes
John Zhang's avatar
John Zhang committed
101 102 103 104

testjit:memops:
  stage: test
  script:
105
    - RUST_BACKTRACE=1 pytest tests/test_jit/test_memops.py -v --color=yes
John Zhang's avatar
John Zhang committed
106 107 108 109

testjit:milestones:
  stage: test
  script:
110
    - RUST_BACKTRACE=1 pytest tests/test_jit/test_milestones.py -v --color=yes
John Zhang's avatar
John Zhang committed
111 112 113 114

testjit:otherops:
  stage: test
  script:
115
    - RUST_BACKTRACE=1 pytest tests/test_jit/test_otherops.py -v --color=yes
John Zhang's avatar
John Zhang committed
116

John Zhang's avatar
John Zhang committed
117
testjit:rpython:
qinsoon's avatar
qinsoon committed
118 119 120 121 122 123 124 125
  stage: test
  script:
    - if [ -d "tests/test_jit/mu-client-pypy" ]; then rm -Rf tests/test_jit/mu-client-pypy; fi
    - git clone https://gitlab.anu.edu.au/mu/mu-client-pypy.git tests/test_jit/mu-client-pypy
    - cd tests/test_jit/mu-client-pypy
    - git checkout mu-rewrite
    - git apply pypy.patch
    - cd $CI_PROJECT_DIR/tests/test_jit
126
    - MU_LOG_LEVEL=info LD_LIBRARY_PATH=. RUST_BACKTRACE=1 PYTHONPATH=mu-client-pypy pytest test_rpython*.py -v --color=yes
qinsoon's avatar
qinsoon committed
127 128

testjit:som:
John Zhang's avatar
John Zhang committed
129 130
  stage: test
  script:
131
    - if [ -d "tests/test_jit/RPySOM" ]; then rm -Rf tests/test_jit/RPySOM; fi
John Zhang's avatar
John Zhang committed
132
    - git clone https://github.com/microvm/RPySOM.git tests/test_jit/RPySOM
133
    - cd tests/test_jit/RPySOM; git submodule init; git submodule update; cd $CI_PROJECT_DIR
134 135 136 137 138
    - if [ -d "tests/test_jit/mu-client-pypy" ]; then rm -Rf tests/test_jit/mu-client-pypy; fi
    - git clone https://gitlab.anu.edu.au/mu/mu-client-pypy.git tests/test_jit/mu-client-pypy
    - cd tests/test_jit/mu-client-pypy
    - git checkout mu-rewrite
    - git apply pypy.patch
139
    - cd $CI_PROJECT_DIR/tests/test_jit
140
    - MU_LOG_LEVEL=info LD_LIBRARY_PATH=. RUST_BACKTRACE=1 PYTHONPATH=mu-client-pypy:RPySOM/src RPYSOM=RPySOM pytest test_som.py -v --color=yes