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

before_script:
  - export MU_ZEBU=$CI_PROJECT_DIR
  - export ZEBU_BUILD=release
  - export CARGO_HOME=.cargo
  - export CC=clang
John Zhang's avatar
John Zhang committed
12 13
  - source /home/gitlab-runner/ci/bin/activate

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

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

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

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

test:cargo:runtime:
41 42
  stage: test
  script:
43
    - RUST_BACKTRACE=1 RUST_TEST_THREADS=1 ./test-release --color=always test_runtime 2> /dev/null
John Zhang's avatar
John Zhang committed
44 45

testjit:milestones:
46 47
  stage: test
  script:
48
    - RUST_BACKTRACE=1 pytest tests/test_jit/test_milestones.py -v --color=yes
John Zhang's avatar
John Zhang committed
49 50

testjit:binops:
51 52
  stage: test
  script:
53
    - RUST_BACKTRACE=1 pytest tests/test_jit/test_binops.py -v --color=yes
John Zhang's avatar
John Zhang committed
54 55

testjit:cmpops:
56 57
  stage: test
  script:
58
    - RUST_BACKTRACE=1 pytest tests/test_jit/test_cmpops.py -v --color=yes
John Zhang's avatar
John Zhang committed
59

John Zhang's avatar
John Zhang committed
60 61 62 63
testjit:controlflow:
  stage: test
  script:
    - cd tests/test_jit
64
    - RUST_BACKTRACE=1 pytest test_controlflow.py -v --color=yes
John Zhang's avatar
John Zhang committed
65

John Zhang's avatar
John Zhang committed
66
testjit:convops:
John Zhang's avatar
John Zhang committed
67 68
  stage: test
  script:
69
    - RUST_BACKTRACE=1 pytest tests/test_jit/test_convops.py -v --color=yes
John Zhang's avatar
John Zhang committed
70

John Zhang's avatar
John Zhang committed
71 72 73
testjit:double:
  stage: test
  script:
74
    - RUST_BACKTRACE=1 pytest tests/test_jit/test_double.py -v --color=yes
John Zhang's avatar
John Zhang committed
75 76 77 78

testjit:memops:
  stage: test
  script:
79
    - RUST_BACKTRACE=1 pytest tests/test_jit/test_memops.py -v --color=yes
John Zhang's avatar
John Zhang committed
80 81 82 83

testjit:milestones:
  stage: test
  script:
84
    - RUST_BACKTRACE=1 pytest tests/test_jit/test_milestones.py -v --color=yes
John Zhang's avatar
John Zhang committed
85 86 87 88

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

John Zhang's avatar
John Zhang committed
91
testjit:rpython:
qinsoon's avatar
qinsoon committed
92 93 94 95 96 97 98 99
  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
Isaac Oscar Gariano's avatar
Isaac Oscar Gariano committed
100
    - MU_LOG_LEVEL=info LD_LIBRARY_PATH=./emit RUST_BACKTRACE=1 PYTHONPATH=mu-client-pypy pytest test_rpython*.py -v --color=yes
qinsoon's avatar
qinsoon committed
101 102

testjit:som:
John Zhang's avatar
John Zhang committed
103 104
  stage: test
  script:
105
    - if [ -d "tests/test_jit/RPySOM" ]; then rm -Rf tests/test_jit/RPySOM; fi
John Zhang's avatar
John Zhang committed
106
    - git clone https://github.com/microvm/RPySOM.git tests/test_jit/RPySOM
107
    - cd tests/test_jit/RPySOM; git submodule init; git submodule update; cd $CI_PROJECT_DIR
108 109 110 111 112
    - 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
113
    - cd $CI_PROJECT_DIR/tests/test_jit
Isaac Oscar Gariano's avatar
Isaac Oscar Gariano committed
114
    - MU_LOG_LEVEL=info LD_LIBRARY_PATH=./emit RUST_BACKTRACE=1 PYTHONPATH=mu-client-pypy:RPySOM/src RPYSOM=RPySOM pytest test_som.py -v --color=yes
115

116 117 118 119 120 121 122 123 124 125 126
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
    - git clone https://github.com/microvm/RPySOM.git
    - 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
127
    - pip install -Ue ./mu-perf-benchmarks
Zixian Cai's avatar
Zixian Cai committed
128
    - mkdir example
Zixian Cai's avatar
Zixian Cai committed
129
    - mubench local ./mu-perf-benchmarks/example/mu-impl-fast.yml --dump /home/gitlab-runner/results/$(git log -1 --pretty="%h_%at") --pipeline ""
130

131 132 133
rustfmt:
  stage: rustfmt
  script:
Isaac Oscar Gariano's avatar
Isaac Oscar Gariano committed
134 135
    - cargo-fmt -- --write-mode=diff --verbose -- src/ast/src/lib.rs src/gc/src/lib.rs src/utils/src/lib.rs