.gitlab-ci.yml 4.07 KB
Newer Older
1 2 3
stages:
  - build
  - test
4 5 6 7 8 9 10
  - rustfmt

before_script:
  - export MU_ZEBU=$CI_PROJECT_DIR
  - export ZEBU_BUILD=release
  - export CARGO_HOME=.cargo
  - export CC=clang
John Zhang's avatar
John Zhang committed
11 12
  - source /home/gitlab-runner/ci/bin/activate

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

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

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

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

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

qinsoon's avatar
qinsoon committed
44 45 46 47 48 49 50 51 52
.build_muc: &build_muc |
  if [ -d "tests/test_muc/mu-tool-compiler" ]; then rm -Rf tests/test_muc/mu-tool-compiler; fi
  cd tests/test_muc
  git clone https://gitlab.anu.edu.au/mu/mu-tool-compiler
  cd mu-tool-compiler
  mkdir lib
  ln -s $MU_ZEBU/target/release/libmu.so lib/
  make
  cd ..
qinsoon's avatar
qinsoon committed
53 54 55 56

testmuc:test_simple:
  stage: test
  script:
qinsoon's avatar
qinsoon committed
57
    - *build_muc
qinsoon's avatar
qinsoon committed
58 59 60 61 62
    - LD_LIBRARY_PATH=mu-tool-compiler/lib/ MUC=mu-tool-compiler/muc python2 -m pytest test_simple.py -v

testmuc:test_swapstack:
  stage: test
  script:
qinsoon's avatar
qinsoon committed
63
    - *build_muc
qinsoon's avatar
qinsoon committed
64 65
    - LD_LIBRARY_PATH=mu-tool-compiler/lib/ MUC=mu-tool-compiler/muc python2 -m pytest test_thread_and_stack.py -v

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

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

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

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

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

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

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

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

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

John Zhang's avatar
John Zhang committed
111
testjit:rpython:
qinsoon's avatar
qinsoon committed
112 113 114 115 116 117 118 119
  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
120
    - 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
121 122

testjit:som:
John Zhang's avatar
John Zhang committed
123 124
  stage: test
  script:
125
    - if [ -d "tests/test_jit/RPySOM" ]; then rm -Rf tests/test_jit/RPySOM; fi
John Zhang's avatar
John Zhang committed
126
    - git clone https://github.com/microvm/RPySOM.git tests/test_jit/RPySOM
127
    - cd tests/test_jit/RPySOM; git submodule init; git submodule update; cd $CI_PROJECT_DIR
128 129 130 131 132
    - 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
133
    - cd $CI_PROJECT_DIR/tests/test_jit
Isaac Oscar Gariano's avatar
Isaac Oscar Gariano committed
134
    - 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
135 136 137 138

rustfmt:
  stage: rustfmt
  script:
Isaac Oscar Gariano's avatar
Isaac Oscar Gariano committed
139 140
    - cargo-fmt -- --write-mode=diff --verbose -- src/ast/src/lib.rs src/gc/src/lib.rs src/utils/src/lib.rs