GitLab will continue to be upgraded from 11.4.5-ce.0 on November 25th 2019 at 4.00pm (AEDT) to 5.00pm (AEDT) due to Critical Security Patch Availability. During the update, GitLab and Mattermost services will not be available.

.gitlab-ci.yml 6.2 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
.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 59
  mkdir lib
  cp -r $ANTLR_HOME/usr/local/lib/* $PWD/lib/
60
  cp -r $MU_ZEBU/target/release/deps/* $PWD/lib/
61 62 63
  export CC=gcc
  export CXX=g++
  make
qinsoon's avatar
qinsoon committed
64
  cd ..
qinsoon's avatar
qinsoon committed
65 66 67 68

testmuc:test_simple:
  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_simple.py -v
71
  allow_failure: true
qinsoon's avatar
qinsoon committed
72 73 74 75

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

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

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

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

testjit:binops:
101 102
  stage: test
  script:
103
    - RUST_BACKTRACE=1 pytest tests/test_jit/test_binops.py -v --color=yes
104
  allow_failure: true
105 106

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

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

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

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

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

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

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

151
testjit:rpython:
qinsoon's avatar
qinsoon committed
152 153 154 155 156 157 158 159
  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
160
    - 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
161
  allow_failure: true
qinsoon's avatar
qinsoon committed
162 163

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

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

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