.gitlab-ci.yml 6.06 KB
Newer Older
1 2 3
stages:
  - build
  - test
Zixian Cai's avatar
Zixian Cai committed
4
  - mubench
5 6 7 8 9 10 11
  - rustfmt

before_script:
  - export MU_ZEBU=$CI_PROJECT_DIR
  - export ZEBU_BUILD=release
  - export CARGO_HOME=.cargo
  - export CC=clang
12
  - export CXX=clang++
13
  - export RUST_TEST_THREADS=1
14
  - export LD_LIBRARY_PATH=$MU_ZEBU/target/$ZEBU_BUILD/deps/:$LD_LIBRARY_PATH
John Zhang's avatar
John Zhang committed
15 16
  - source /home/gitlab-runner/ci/bin/activate

17
build:
18 19
  stage: build
  script:
20 21
    - python --version
    - python2 --version
22 23 24 25
    - rustup show
    - rustup run 1.30.1-x86_64-unknown-linux-gnu rustc --version
    - rustup run 1.30.1-x86_64-unknown-linux-gnu cargo clean
    - time rustup run 1.30.1-x86_64-unknown-linux-gnu cargo test -j6 --release --no-run --color=always
qinsoon's avatar
qinsoon committed
26
  artifacts:
qinsoon's avatar
qinsoon committed
27
    paths:
28 29 30
      - target/release/deps/libmu.so
      - target/release/deps/libmu.a
      - target/release/deps/lib-*
31

32
test:cargo:api:
33 34
  stage: test
  script:
35
    - rustup run 1.30.1-x86_64-unknown-linux-gnu cargo test test_api --release 2> /dev/null
36 37

test:cargo:ir:
38 39
  stage: test
  script:
40
    - rustup run 1.30.1-x86_64-unknown-linux-gnu cargo test test_ir --release 2> /dev/null
41 42

test:cargo:compiler:
43 44
  stage: test
  script:
45
    - rustup run 1.30.1-x86_64-unknown-linux-gnu cargo test test_compiler --release 2> /dev/null
46 47

test:cargo:runtime:
48 49
  stage: test
  script:
50
    - rustup run 1.30.1-x86_64-unknown-linux-gnu cargo test test_runtime --release 2> /dev/null
51

qinsoon's avatar
qinsoon committed
52 53 54 55 56 57
.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
58
  ln -s $MU_ZEBU/target/release/deps/libmu.so lib/
qinsoon's avatar
qinsoon committed
59 60
  make
  cd ..
qinsoon's avatar
qinsoon committed
61 62 63 64

testmuc:test_simple:
  stage: test
  script:
qinsoon's avatar
qinsoon committed
65
    - *build_muc
qinsoon's avatar
qinsoon committed
66
    - LD_LIBRARY_PATH=mu-tool-compiler/lib/ MUC=mu-tool-compiler/muc python2 -m pytest test_simple.py -v
67
  allow_failure: true
qinsoon's avatar
qinsoon committed
68 69 70 71

testmuc:test_swapstack:
  stage: test
  script:
qinsoon's avatar
qinsoon committed
72
    - *build_muc
qinsoon's avatar
qinsoon committed
73
    - LD_LIBRARY_PATH=mu-tool-compiler/lib/ MUC=mu-tool-compiler/muc python2 -m pytest test_thread_and_stack.py -v
74
  allow_failure: true
qinsoon's avatar
qinsoon committed
75

qinsoon's avatar
qinsoon committed
76 77 78 79 80
testmuc:test_cmp:
  stage: test
  script:
    - *build_muc
    - LD_LIBRARY_PATH=mu-tool-compiler/lib/ MUC=mu-tool-compiler/muc python2 -m pytest test_cmp.py -v
81
  allow_failure: true
qinsoon's avatar
qinsoon committed
82

83 84 85 86 87
testmuc:test_binop:
  stage: test
  script:
    - *build_muc
    - LD_LIBRARY_PATH=mu-tool-compiler/lib/ MUC=mu-tool-compiler/muc python2 -m pytest test_binop.py -v
88
  allow_failure: true
89

90
testjit:milestones:
91 92
  stage: test
  script:
93
    - RUST_BACKTRACE=1 pytest tests/test_jit/test_milestones.py -v --color=yes
94
  allow_failure: true
95 96

testjit:binops:
97 98
  stage: test
  script:
99
    - RUST_BACKTRACE=1 pytest tests/test_jit/test_binops.py -v --color=yes
100
  allow_failure: true
101 102

testjit:cmpops:
103 104
  stage: test
  script:
105
    - RUST_BACKTRACE=1 pytest tests/test_jit/test_cmpops.py -v --color=yes
106
  allow_failure: true
John Zhang's avatar
John Zhang committed
107

John Zhang's avatar
John Zhang committed
108 109 110
testjit:controlflow:
  stage: test
  script:
111 112 113
    # run this test under test_jit directory
    # as a C source file is expected in a relative path to current working directory
    - cd tests/test_jit
qinsoon's avatar
qinsoon committed
114
    - RUST_BACKTRACE=1 pytest test_controlflow.py -v --color=yes
115
  allow_failure: true
John Zhang's avatar
John Zhang committed
116

John Zhang's avatar
John Zhang committed
117
testjit:convops:
John Zhang's avatar
John Zhang committed
118 119
  stage: test
  script:
120
    - RUST_BACKTRACE=1 pytest tests/test_jit/test_convops.py -v --color=yes
121
  allow_failure: true
122

John Zhang's avatar
John Zhang committed
123 124 125
testjit:double:
  stage: test
  script:
126
    - RUST_BACKTRACE=1 pytest tests/test_jit/test_double.py -v --color=yes
127
  allow_failure: true
John Zhang's avatar
John Zhang committed
128 129 130 131

testjit:memops:
  stage: test
  script:
132
    - RUST_BACKTRACE=1 pytest tests/test_jit/test_memops.py -v --color=yes
133
  allow_failure: true
John Zhang's avatar
John Zhang committed
134 135 136 137

testjit:milestones:
  stage: test
  script:
138
    - RUST_BACKTRACE=1 pytest tests/test_jit/test_milestones.py -v --color=yes
139
  allow_failure: true
John Zhang's avatar
John Zhang committed
140 141 142 143

testjit:otherops:
  stage: test
  script:
144
    - RUST_BACKTRACE=1 pytest tests/test_jit/test_otherops.py -v --color=yes
145
  allow_failure: true
John Zhang's avatar
John Zhang committed
146

147
testjit:rpython:
qinsoon's avatar
qinsoon committed
148 149 150 151 152 153 154 155
  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
156
    - MU_LOG_LEVEL=info LD_LIBRARY_PATH=./emit:$LD_LIBRARY_PATH RUST_BACKTRACE=1 PYTHONPATH=mu-client-pypy pytest test_rpython*.py -v --color=yes
157
  allow_failure: true
qinsoon's avatar
qinsoon committed
158 159

testjit:som:
160 161
  stage: test
  script:
162
    - if [ -d "tests/test_jit/RPySOM" ]; then rm -Rf tests/test_jit/RPySOM; fi
163
    - git clone https://github.com/microvm/RPySOM.git tests/test_jit/RPySOM
164
    - cd tests/test_jit/RPySOM; git submodule init; git submodule update; cd $CI_PROJECT_DIR
165 166 167 168 169
    - 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
170
    - cd $CI_PROJECT_DIR/tests/test_jit
171
    - MU_LOG_LEVEL=info LD_LIBRARY_PATH=./emit:$LD_LIBRARY_PATH RUST_BACKTRACE=1 PYTHONPATH=mu-client-pypy:RPySOM/src RPYSOM=RPySOM pytest test_som.py -v --color=yes
172
  allow_failure: true
173

174 175 176
mubench:
  stage: mubench
  script:
177
    - cp ./target/release/deps/libmu.so ./target/release/libmu.so
178 179 180
    - deactivate
    - git clone https://gitlab.anu.edu.au/mu/mu-perf-benchmarks.git
    - git clone https://gitlab.anu.edu.au/mu/mu-client-pypy.git
181
    - cd mu-client-pypy; git apply pypy.patch; git apply clang_opt_flag.patch; cd $CI_PROJECT_DIR
182
    - git clone https://github.com/microvm/RPySOM.git
183
    - cd RPySOM; git submodule init; git submodule update; cd $CI_PROJECT_DIR
184 185 186 187
    - export RPYSOM=RPySOM
    - export PYPY=mu-client-pypy
    - virtualenv -p python3 mubench_venv
    - source mubench_venv/bin/activate
Zixian Cai's avatar
Zixian Cai committed
188
    - pip install -Ue ./mu-perf-benchmarks
Zixian Cai's avatar
Zixian Cai committed
189
    - mkdir ci
Zixian Cai's avatar
Zixian Cai committed
190
    - mubench local ./mu-perf-benchmarks/ci/*.yml --dump /home/gitlab-runner/results/$(git log -1 --pretty="%h_%at") --pipeline ""
191
    - rsync -a /home/gitlab-runner/results/* squirrel:~/mu-impl-fast/angus
192

193 194 195
rustfmt:
  stage: rustfmt
  script:
196
    - cargo-fmt -- --check --verbose -- src/lib.rs src/ast/src/lib.rs src/gc/src/lib.rs src/utils/src/lib.rs