.gitlab-ci.yml 3.49 KB
Newer Older
1
image: "qinsoon/ubuntu-zebu-test:latest"
Yi Lin's avatar
Yi Lin committed
2

3 4 5
stages:
  - build
  - test
6 7 8 9 10 11 12 13
  - rustfmt

before_script:
  - export PATH=$PATH:/root/.cargo/bin
  - export MU_ZEBU=$CI_PROJECT_DIR
  - export ZEBU_BUILD=release
  - export CARGO_HOME=.cargo
  - export CC=clang
14

15
build:
16 17 18
  stage: build
  script:
    - rustc --version
19
    - time CARGO_HOME=.cargo RUST_BACKTRACE=1 CC=clang cargo test --release --no-run --color=always
qinsoon's avatar
typo  
qinsoon committed
20
  artifacts:
qinsoon's avatar
qinsoon committed
21
    paths:
Yi Lin's avatar
Yi Lin committed
22
      - target/release/libmu.so
Yi Lin's avatar
Yi Lin committed
23
      - target/release/libmu.a
24
      - target/release/lib-*
25

26
test:cargo:api:
27 28
  stage: test
  script:
29
    - RUST_BACKTRACE=1 RUST_TEST_THREADS=1 ./test-release --color=always test_api 2> /dev/null
30 31

test:cargo:ir:
32 33
  stage: test
  script:
34
    - RUST_BACKTRACE=1 RUST_TEST_THREADS=1 ./test-release --color=always test_ir 2> /dev/null
35 36

test:cargo:compiler:
37 38
  stage: test
  script:
39
    - RUST_BACKTRACE=1 RUST_TEST_THREADS=1 ./test-release --color=always test_compiler 2> /dev/null
40 41

test:cargo:runtime:
42 43
  stage: test
  script:
44
    - RUST_BACKTRACE=1 RUST_TEST_THREADS=1 ./test-release --color=always test_runtime 2> /dev/null
John Zhang's avatar
John Zhang committed
45 46

testjit:milestones:
47 48
  stage: test
  script:
49
    - RUST_BACKTRACE=1 pytest tests/test_jit/test_milestones.py -v --color=yes
John Zhang's avatar
John Zhang committed
50 51

testjit:binops:
52 53
  stage: test
  script:
54
    - RUST_BACKTRACE=1 pytest tests/test_jit/test_binops.py -v --color=yes
John Zhang's avatar
John Zhang committed
55 56

testjit:cmpops:
57 58
  stage: test
  script:
59
    - RUST_BACKTRACE=1 pytest tests/test_jit/test_cmpops.py -v --color=yes
John Zhang's avatar
John Zhang committed
60

John Zhang's avatar
John Zhang committed
61 62 63 64
testjit:controlflow:
  stage: test
  script:
    - cd tests/test_jit
65
    - RUST_BACKTRACE=1 pytest test_controlflow.py -v --color=yes
John Zhang's avatar
John Zhang committed
66

John Zhang's avatar
John Zhang committed
67
testjit:convops:
John Zhang's avatar
John Zhang committed
68 69
  stage: test
  script:
70
    - RUST_BACKTRACE=1 pytest tests/test_jit/test_convops.py -v --color=yes
John Zhang's avatar
John Zhang committed
71

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

testjit:memops:
  stage: test
  script:
80
    - RUST_BACKTRACE=1 pytest tests/test_jit/test_memops.py -v --color=yes
John Zhang's avatar
John Zhang committed
81 82 83 84

testjit:milestones:
  stage: test
  script:
85
    - RUST_BACKTRACE=1 pytest tests/test_jit/test_milestones.py -v --color=yes
John Zhang's avatar
John Zhang committed
86 87 88 89

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

John Zhang's avatar
John Zhang committed
92
testjit:rpython:
qinsoon's avatar
qinsoon committed
93 94 95 96 97 98 99 100
  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
101
    - 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
102 103

testjit:som:
John Zhang's avatar
John Zhang committed
104 105
  stage: test
  script:
106
    - if [ -d "tests/test_jit/RPySOM" ]; then rm -Rf tests/test_jit/RPySOM; fi
John Zhang's avatar
John Zhang committed
107
    - git clone https://github.com/microvm/RPySOM.git tests/test_jit/RPySOM
108
    - cd tests/test_jit/RPySOM; git submodule init; git submodule update; cd $CI_PROJECT_DIR
109 110 111 112 113
    - 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
114
    - cd $CI_PROJECT_DIR/tests/test_jit
115 116 117 118 119 120
    - 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

rustfmt:
  stage: rustfmt
  script:
    - rustup run nightly cargo fmt -- --write-mode=diff src/ast/src/lib.rs src/gc/src/lib.rs src/utils/src/lib.rs --verbose