.gitlab-ci.yml 3.59 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
John Zhang's avatar
John Zhang committed
14 15 16 17
  - source /home/gitlab-runner/ci/bin/activate

after_script:
  - deactivate
18

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

30
test:cargo:api:
31 32
  stage: test
  script:
33
    - RUST_BACKTRACE=1 RUST_TEST_THREADS=1 ./test-release --color=always test_api 2> /dev/null
34 35

test:cargo:ir:
36 37
  stage: test
  script:
38
    - RUST_BACKTRACE=1 RUST_TEST_THREADS=1 ./test-release --color=always test_ir 2> /dev/null
39 40

test:cargo:compiler:
41 42
  stage: test
  script:
43
    - RUST_BACKTRACE=1 RUST_TEST_THREADS=1 ./test-release --color=always test_compiler 2> /dev/null
44 45

test:cargo:runtime:
46 47
  stage: test
  script:
48
    - RUST_BACKTRACE=1 RUST_TEST_THREADS=1 ./test-release --color=always test_runtime 2> /dev/null
John Zhang's avatar
John Zhang committed
49 50

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

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

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

John Zhang's avatar
John Zhang committed
65 66 67 68
testjit:controlflow:
  stage: test
  script:
    - cd tests/test_jit
69
    - RUST_BACKTRACE=1 pytest test_controlflow.py -v --color=yes
John Zhang's avatar
John Zhang committed
70

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

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

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

testjit:milestones:
  stage: test
  script:
89
    - RUST_BACKTRACE=1 pytest tests/test_jit/test_milestones.py -v --color=yes
John Zhang's avatar
John Zhang committed
90 91 92 93

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

John Zhang's avatar
John Zhang committed
96
testjit:rpython:
qinsoon's avatar
qinsoon committed
97 98 99 100 101 102 103 104
  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
Isaac Oscar Gariano's avatar
Isaac Oscar Gariano committed
105
    - MU_LOG_LEVEL=info LD_LIBRARY_PATH=./emit RUST_BACKTRACE=1 PYTHONPATH=mu-client-pypy pytest test_rpython*.py -v --color=yes
qinsoon's avatar
qinsoon committed
106 107

testjit:som:
John Zhang's avatar
John Zhang committed
108 109
  stage: test
  script:
110
    - if [ -d "tests/test_jit/RPySOM" ]; then rm -Rf tests/test_jit/RPySOM; fi
John Zhang's avatar
John Zhang committed
111
    - git clone https://github.com/microvm/RPySOM.git tests/test_jit/RPySOM
112
    - cd tests/test_jit/RPySOM; git submodule init; git submodule update; cd $CI_PROJECT_DIR
113 114 115 116 117
    - 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
118
    - cd $CI_PROJECT_DIR/tests/test_jit
Isaac Oscar Gariano's avatar
Isaac Oscar Gariano committed
119
    - MU_LOG_LEVEL=info LD_LIBRARY_PATH=./emit RUST_BACKTRACE=1 PYTHONPATH=mu-client-pypy:RPySOM/src RPYSOM=RPySOM pytest test_som.py -v --color=yes
120 121 122 123

rustfmt:
  stage: rustfmt
  script:
qinsoon's avatar
qinsoon committed
124
    - CARGO_HOME=/opt/rust rustup run nightly cargo fmt -- --write-mode=diff src/ast/src/lib.rs src/gc/src/lib.rs src/utils/src/lib.rs --verbose