.gitlab-ci.yml 5.77 KB
Newer Older
1 2 3
stages:
  - build
  - test
Zixian Cai's avatar
Zixian Cai committed
4
  - mubench
5 6 7 8
  - rustfmt

before_script:
  - export MU_ZEBU=$CI_PROJECT_DIR
9 10
  - export ZEBU_BUILD=release
  - export ZEBU_CARGO_ARG="--release"
11 12
  - export CARGO_HOME=.cargo
  - export CC=clang
13
  - export CXX=clang++
14
  - export RUST_TEST_THREADS=1
15
  - export LD_LIBRARY_PATH=$MU_ZEBU/target/$ZEBU_BUILD/deps/:$LD_LIBRARY_PATH
16
  - export PYTHONPATH=mu-client-pypy
17
  - source /home/gitlab-runner/ci/bin/activate
John Zhang's avatar
John Zhang committed
18

19
build:
20 21
  stage: build
  script:
22 23
    - rustc --version
    - cargo clean
24
    - time cargo test -j6 $ZEBU_CARGO_ARG --no-run --color=always
qinsoon's avatar
qinsoon committed
25
  artifacts:
qinsoon's avatar
qinsoon committed
26
    paths:
27 28 29 30 31 32
      - target/debug/deps/libmu.so
      - target/debug/deps/libmu.a
      - target/debug/deps/lib-*
      - target/release/deps/libmu.so
      - target/release/deps/libmu.a
      - target/release/deps/lib-*
33

34 35 36
test:cargo:api:
  stage: test
  script:
37
    - cargo test test_api $ZEBU_CARGO_ARG 2> /dev/null
38 39 40 41

test:cargo:ir:
  stage: test
  script:
42
    - cargo test test_ir $ZEBU_CARGO_ARG 2> /dev/null
43 44 45 46

test:cargo:compiler:
  stage: test
  script:
47
    - cargo test test_compiler $ZEBU_CARGO_ARG 2> /dev/null
48 49 50 51

test:cargo:runtime:
  stage: test
  script:
52
    - cargo test test_runtime $ZEBU_CARGO_ARG 2> /dev/null
53

qinsoon's avatar
qinsoon committed
54 55 56 57 58
.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
59
  export ANTLR_HOME=/home/gitlab-runner/antlr4/runtime/Cpp/run
60 61
  mkdir lib
  cp -r $ANTLR_HOME/usr/local/lib/* $PWD/lib/
62
  cp -r $MU_ZEBU/target/$ZEBU_BUILD/deps/* $PWD/lib/
63 64
  export CC=clang
  export CXX=clang++
65
  make
qinsoon's avatar
qinsoon committed
66
  cd ..
qinsoon's avatar
qinsoon committed
67 68 69 70

testmuc:test_simple:
  stage: test
  script:
qinsoon's avatar
qinsoon committed
71
    - *build_muc
qinsoon's avatar
qinsoon committed
72 73 74 75 76
    - 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
77
    - *build_muc
qinsoon's avatar
qinsoon committed
78 79
    - 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
80 81 82 83 84 85
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

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
testjit:milestones:
93 94
  stage: test
  script:
95
    - RUST_BACKTRACE=1 pytest tests/test_jit/test_milestones.py -v --color=yes
96 97

testjit:binops:
98 99
  stage: test
  script:
100
    - RUST_BACKTRACE=1 pytest tests/test_jit/test_binops.py -v --color=yes
101 102

testjit:cmpops:
103 104
  stage: test
  script:
105
    - RUST_BACKTRACE=1 pytest tests/test_jit/test_cmpops.py -v --color=yes
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
John Zhang's avatar
John Zhang committed
114

John Zhang's avatar
John Zhang committed
115
testjit:convops:
John Zhang's avatar
John Zhang committed
116 117
  stage: test
  script:
118
    - RUST_BACKTRACE=1 pytest tests/test_jit/test_convops.py -v --color=yes
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
John Zhang's avatar
John Zhang committed
124 125 126 127

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

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

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

140
testjit:rpython:
qinsoon's avatar
qinsoon committed
141 142 143 144 145 146 147 148
  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
149
    - 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
150 151

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

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

184 185 186
rustfmt:
  stage: rustfmt
  script:
187
    - cargo-fmt -- --check --verbose -- src/lib.rs src/ast/src/lib.rs src/gc/src/lib.rs src/utils/src/lib.rs
Javad Ebrahimian Amiri's avatar
Javad Ebrahimian Amiri committed
188
  allow_failure: true