.gitlab-ci.yml 6.14 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
typo  
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
John Zhang's avatar
John Zhang committed
51

qinsoon's avatar
qinsoon committed
52 53 54 55 56
.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
57
  export ANTLR_HOME=/home/gitlab-runner/antlr4/runtime/Cpp/run
58
  cp -r $ANTLR_HOME/usr/local/lib/* ./lib/
59 60 61
  export CC=gcc
  export CXX=g++
  make
qinsoon's avatar
qinsoon committed
62
  cd ..
qinsoon's avatar
qinsoon committed
63 64 65 66

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

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

qinsoon's avatar
qinsoon committed
78 79 80 81 82
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
83
  allow_failure: true
qinsoon's avatar
qinsoon committed
84

85 86 87 88 89
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
90
  allow_failure: true
91

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

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

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

John Zhang's avatar
John Zhang committed
110 111 112
testjit:controlflow:
  stage: test
  script:
113 114 115
    # 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
116
    - RUST_BACKTRACE=1 pytest test_controlflow.py -v --color=yes
117
  allow_failure: true
John Zhang's avatar
John Zhang committed
118

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

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

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

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

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

John Zhang's avatar
John Zhang committed
149
testjit:rpython:
qinsoon's avatar
qinsoon committed
150 151 152 153 154 155 156 157
  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
Zixian Cai's avatar
Zixian Cai committed
158
    - 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
159
  allow_failure: true
qinsoon's avatar
qinsoon committed
160 161

testjit:som:
John Zhang's avatar
John Zhang committed
162 163
  stage: test
  script:
164
    - if [ -d "tests/test_jit/RPySOM" ]; then rm -Rf tests/test_jit/RPySOM; fi
John Zhang's avatar
John Zhang committed
165
    - git clone https://github.com/microvm/RPySOM.git tests/test_jit/RPySOM
166
    - cd tests/test_jit/RPySOM; git submodule init; git submodule update; cd $CI_PROJECT_DIR
167 168 169 170 171
    - 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
172
    - cd $CI_PROJECT_DIR/tests/test_jit
Zixian Cai's avatar
Zixian Cai committed
173
    - 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
174
  allow_failure: true
175

176 177 178
mubench:
  stage: mubench
  script:
179
    - cp ./target/release/deps/libmu.so ./target/release/libmu.so
180 181 182
    - 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
Zixian Cai's avatar
Zixian Cai committed
183
    - cd mu-client-pypy; git apply pypy.patch; git apply clang_opt_flag.patch; cd $CI_PROJECT_DIR
184
    - git clone https://github.com/microvm/RPySOM.git
185
    - cd RPySOM; git submodule init; git submodule update; cd $CI_PROJECT_DIR
186 187 188 189
    - 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
190
    - pip install -Ue ./mu-perf-benchmarks
Zixian Cai's avatar
Zixian Cai committed
191
    - mkdir ci
Zixian Cai's avatar
Zixian Cai committed
192
    - mubench local ./mu-perf-benchmarks/ci/*.yml --dump /home/gitlab-runner/results/$(git log -1 --pretty="%h_%at") --pipeline ""
193
    - rsync -a /home/gitlab-runner/results/* squirrel:~/mu-impl-fast/angus
194

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