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

15
build:
16 17 18
  stage: build
  script:
    - rustc --version
Zixian Cai's avatar
Zixian Cai committed
19
    - time CARGO_HOME=.cargo RUST_BACKTRACE=1 CC=clang cargo test -j6 --release --no-run --color=always
qinsoon's avatar
qinsoon committed
20
  artifacts:
qinsoon's avatar
qinsoon committed
21
    paths:
Yi Lin's avatar
Yi Lin committed
22
      - target/release/libmu.so
Yi Lin's avatar
Yi Lin committed
23
      - target/release/libmu.a
24
      - target/release/lib-*
25

26
test:cargo:api:
27 28
  stage: test
  script:
29
    - RUST_BACKTRACE=1 RUST_TEST_THREADS=1 ./test-release --color=always test_api 2> /dev/null
30 31

test:cargo:ir:
32 33
  stage: test
  script:
34
    - RUST_BACKTRACE=1 RUST_TEST_THREADS=1 ./test-release --color=always test_ir 2> /dev/null
35 36

test:cargo:compiler:
37 38
  stage: test
  script:
39
    - RUST_BACKTRACE=1 RUST_TEST_THREADS=1 ./test-release --color=always test_compiler 2> /dev/null
40 41

test:cargo:runtime:
42 43
  stage: test
  script:
44
    - RUST_BACKTRACE=1 RUST_TEST_THREADS=1 ./test-release --color=always test_runtime 2> /dev/null
45

qinsoon's avatar
qinsoon committed
46 47 48 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
  ln -s $MU_ZEBU/target/release/libmu.so lib/
  make
  cd ..
qinsoon's avatar
qinsoon committed
55 56 57 58

testmuc:test_simple:
  stage: test
  script:
qinsoon's avatar
qinsoon committed
59
    - *build_muc
qinsoon's avatar
qinsoon committed
60 61 62 63 64
    - 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
65
    - *build_muc
qinsoon's avatar
qinsoon committed
66 67
    - 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
68 69 70 71 72 73
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

74 75 76 77 78 79
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

80
testjit:milestones:
81 82
  stage: test
  script:
83
    - RUST_BACKTRACE=1 pytest tests/test_jit/test_milestones.py -v --color=yes
84 85

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

testjit:cmpops:
91 92
  stage: test
  script:
93
    - RUST_BACKTRACE=1 pytest tests/test_jit/test_cmpops.py -v --color=yes
John Zhang's avatar
John Zhang committed
94

John Zhang's avatar
John Zhang committed
95 96 97
testjit:controlflow:
  stage: test
  script:
98 99 100
    # 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
101
    - RUST_BACKTRACE=1 pytest test_controlflow.py -v --color=yes
John Zhang's avatar
John Zhang committed
102

John Zhang's avatar
John Zhang committed
103
testjit:convops:
John Zhang's avatar
John Zhang committed
104 105
  stage: test
  script:
106
    - RUST_BACKTRACE=1 pytest tests/test_jit/test_convops.py -v --color=yes
107

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

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

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

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

128
testjit:rpython:
qinsoon's avatar
qinsoon committed
129 130 131 132 133 134 135 136
  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
137
    - 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
138 139

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

153 154 155 156 157 158
mubench:
  stage: mubench
  script:
    - 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
159
    - cd mu-client-pypy; git apply pypy.patch; git apply clang_opt_flag.patch; cd $CI_PROJECT_DIR
160
    - git clone https://github.com/microvm/RPySOM.git
161
    - cd RPySOM; git submodule init; git submodule update; cd $CI_PROJECT_DIR
162 163 164 165
    - 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
166
    - pip install -Ue ./mu-perf-benchmarks
Zixian Cai's avatar
Zixian Cai committed
167
    - mkdir ci
Zixian Cai's avatar
Zixian Cai committed
168
    - mubench local ./mu-perf-benchmarks/ci/*.yml --dump /home/gitlab-runner/results/$(git log -1 --pretty="%h_%at") --pipeline ""
169 170
    - rsync -a /home/gitlab-runner/results/* squirrel:~/mu-impl-fast/angus
    
171 172 173
rustfmt:
  stage: rustfmt
  script:
qinsoon's avatar
qinsoon committed
174
    - cargo-fmt -- --write-mode=diff --verbose -- src/lib.rs src/ast/src/lib.rs src/gc/src/lib.rs src/utils/src/lib.rs
Isaac Oscar Gariano's avatar
Isaac Oscar Gariano committed
175