.gitlab-ci.yml 6 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 21 22
    - 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
23
  artifacts:
qinsoon's avatar
qinsoon committed
24
    paths:
25 26 27
      - target/release/deps/libmu.so
      - target/release/deps/libmu.a
      - target/release/deps/lib-*
28

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

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

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

test:cargo:runtime:
45 46
  stage: test
  script:
47
    - rustup run 1.30.1-x86_64-unknown-linux-gnu cargo test test_runtime --release 2> /dev/null
48

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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