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

28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47
test:cargo:api:
  stage: test
  script:
    - rustup run 1.30.1-x86_64-unknown-linux-gnu cargo test test_api --release 2> /dev/null

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

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

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

qinsoon's avatar
qinsoon committed
48 49 50 51 52
.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
53
  export ANTLR_HOME=/home/gitlab-runner/antlr4/runtime/Cpp/run
54 55
  mkdir lib
  cp -r $ANTLR_HOME/usr/local/lib/* $PWD/lib/
56
  cp -r $MU_ZEBU/target/release/deps/* $PWD/lib/
57 58
  export CC=clang
  export CXX=clang++
59
  make
qinsoon's avatar
qinsoon committed
60
  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 67 68 69 70
    - LD_LIBRARY_PATH=mu-tool-compiler/lib/ MUC=mu-tool-compiler/muc python2 -m pytest test_simple.py -v

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

qinsoon's avatar
qinsoon committed
74 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 81 82 83 84 85
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

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

testjit:binops:
92 93
  stage: test
  script:
94
    - RUST_BACKTRACE=1 pytest tests/test_jit/test_binops.py -v --color=yes
95 96

testjit:cmpops:
97 98
  stage: test
  script:
99
    - RUST_BACKTRACE=1 pytest tests/test_jit/test_cmpops.py -v --color=yes
John Zhang's avatar
John Zhang committed
100

John Zhang's avatar
John Zhang committed
101 102 103
testjit:controlflow:
  stage: test
  script:
104 105 106
    # 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
107
    - RUST_BACKTRACE=1 pytest test_controlflow.py -v --color=yes
John Zhang's avatar
John Zhang committed
108

John Zhang's avatar
John Zhang committed
109
testjit:convops:
John Zhang's avatar
John Zhang committed
110 111
  stage: test
  script:
112
    - RUST_BACKTRACE=1 pytest tests/test_jit/test_convops.py -v --color=yes
113

John Zhang's avatar
John Zhang committed
114 115 116
testjit:double:
  stage: test
  script:
117
    - RUST_BACKTRACE=1 pytest tests/test_jit/test_double.py -v --color=yes
John Zhang's avatar
John Zhang committed
118 119 120 121

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

testjit:milestones:
  stage: test
  script:
127
    - RUST_BACKTRACE=1 pytest tests/test_jit/test_milestones.py -v --color=yes
John Zhang's avatar
John Zhang committed
128 129 130 131

testjit:otherops:
  stage: test
  script:
132
    - RUST_BACKTRACE=1 pytest tests/test_jit/test_otherops.py -v --color=yes
John Zhang's avatar
John Zhang committed
133

134
testjit:rpython:
qinsoon's avatar
qinsoon committed
135 136 137 138 139 140 141 142
  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
143
    - 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
qinsoon's avatar
qinsoon committed
144 145

testjit:som:
146 147
  stage: test
  script:
148
    - if [ -d "tests/test_jit/RPySOM" ]; then rm -Rf tests/test_jit/RPySOM; fi
149
    - git clone https://github.com/microvm/RPySOM.git tests/test_jit/RPySOM
150
    - cd tests/test_jit/RPySOM; git submodule init; git submodule update; cd $CI_PROJECT_DIR
151 152 153 154 155
    - 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
156
    - cd $CI_PROJECT_DIR/tests/test_jit
157
    - 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
158

159 160 161
mubench:
  stage: mubench
  script:
162
    - cp ./target/release/deps/libmu.so ./target/release/libmu.so
163 164 165
    - 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
166
    - cd mu-client-pypy; git apply pypy.patch; git apply clang_opt_flag.patch; cd $CI_PROJECT_DIR
167
    - git clone https://github.com/microvm/RPySOM.git
168
    - cd RPySOM; git submodule init; git submodule update; cd $CI_PROJECT_DIR
169 170 171 172
    - 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
173
    - pip install -Ue ./mu-perf-benchmarks
Zixian Cai's avatar
Zixian Cai committed
174
    - mkdir ci
Zixian Cai's avatar
Zixian Cai committed
175
    - mubench local ./mu-perf-benchmarks/ci/*.yml --dump /home/gitlab-runner/results/$(git log -1 --pretty="%h_%at") --pipeline ""
176
    - rsync -a /home/gitlab-runner/results/* squirrel:~/mu-impl-fast/angus
177

178 179 180
rustfmt:
  stage: rustfmt
  script:
181
    - cargo-fmt -- --check --verbose -- src/lib.rs src/ast/src/lib.rs src/gc/src/lib.rs src/utils/src/lib.rs