forked from quic/gunyah-hypervisor
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.gitlab-ci.yml
90 lines (81 loc) · 2.19 KB
/
.gitlab-ci.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
image: python3:latest
# Default environment variables
variables:
# Change pip's cache directory to be inside the project directory since we
# can only cache local items.
PIP_CACHE_DIR: "$CI_PROJECT_ID/.cache/.pip"
SCAN_DIR: "../.scan"
# Always use a fresh clone so submodule doesn't break.
GIT_STRATEGY: clone
stages:
- check
- build
cache:
paths:
- .cache/.pip
- gunyah-venv/
before_script:
- python3 -m venv gunyah-venv
- source gunyah-venv/bin/activate
code-style:
stage: check
tags:
- gunyah
only:
- merge_requests
script:
- pip install flake8
- pip install autopep8
- git ls-files -- '*.py' | xargs autopep8 -i
- git ls-files -- '*.py' | xargs flake8
- git ls-files -- '*.[ch]' | xargs $LLVM/bin/clang-format --style=file -i
- git ls-files -- '*.tc' '*.ev' '*.hvc' | xargs sed -i 's/ /\t/g'
- git ls-files -- '*.tc' '*.ev' '*.hvc' | xargs sed -i 's/\t /\t/g'
- git ls-files -- '*.[chS]' '*.tc' '*.ev' '*.hvc' | xargs sed -i 's/ \t/\t/g'
- git diff --exit-code
git-checks:
stage: check
tags:
- gunyah
only:
- merge_requests
script:
- if ! git ls-files --error-unmatch hyp/core/boot/include/version.h; then echo "version.h not present"; else echo "version.h should not be committed!"; exit 1; fi
- git diff --check origin/master HEAD
branch-up-to-date:
stage: check
tags:
- gunyah
only:
- merge_requests
allow_failure: true
script:
- COMMITS=`git cherry -v HEAD origin/$CI_MERGE_REQUEST_TARGET_BRANCH_NAME`
- echo $COMMITS
- if [[ "$COMMITS" ]]; then false; else true; fi
build-gunyah-rm:
stage: build
tags:
- gunyah
only:
- merge_requests
script:
- ./.gitlab-ci-build-setup.sh
- scons featureset=gunyah-rm-qemu all=1 -j4
sa-production:
stage: build
tags:
- gunyah
# Do not set allow_failure to true, unless agreed that new failure cannot be
# immediately addressed and merge is necessary regardless.
allow_failure: false
only:
- merge_requests
script:
- ./.gitlab-ci-build-setup.sh
- ./.gitlab-ci-run-sa.sh qemu/gunyah-rm-qemu production
artifacts:
when: on_failure
expire_in: 3 days
paths:
- sa-results/*.html