.gitlab-ci.yml 6.04 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 RUST_TEST_THREADS=1
13
  - export LD_LIBRARY_PATH=$MU_ZEBU/target/$ZEBU_BUILD/deps/:$LD_LIBRARY_PATH
John Zhang's avatar
John Zhang committed
14 15
  - source /home/gitlab-runner/ci/bin/activate

16
build:
17 18
  stage: build
  script:
19 20
    - python --version
    - python2 --version
21 22 23 24
    - 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
25
  artifacts:
qinsoon's avatar
qinsoon committed
26
    paths:
27 28 29
      - target/release/deps/libmu.so
      - target/release/deps/libmu.a
      - target/release/deps/lib-*
30

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

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

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

test:cargo:runtime:
47 48
  stage: test
  script:
49
    - 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
50

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

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

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

qinsoon's avatar
qinsoon committed
75 76 77 78 79
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
80
  allow_failure: true
qinsoon's avatar
qinsoon committed
81

82 83 84 85 86
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
87
  allow_failure: true
88

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

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

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

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

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

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

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

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

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

John Zhang's avatar
John Zhang committed
146
testjit:rpython:
qinsoon's avatar
qinsoon committed
147 148 149 150 151 152 153 154
  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
155
    - 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
156
  allow_failure: true
qinsoon's avatar
qinsoon committed
157 158

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

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

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