forked from simonschoening/libhermit-rs
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.gitlab-ci.yml
116 lines (108 loc) · 4.43 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
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
stages:
- prepare
- build
- test
variables:
DOCKER_FILE: Dockerfile
DOCKER_TAG: latest
DOCKER_IMAGE: ${CI_REGISTRY_IMAGE}
GIT_SUBMODULE_STRATEGY: normal
FF_GITLAB_REGISTRY_HELPER_IMAGE: 1
.prepare:docker: &prepare_docker
stage: prepare
image:
name: gcr.io/kaniko-project/executor:debug
entrypoint: [ "" ]
script:
- mkdir -p /kaniko/.docker
- echo "{\"auths\":{\"${CI_REGISTRY}\":{\"username\":\"${CI_REGISTRY_USER}\",\"password\":\"${CI_REGISTRY_PASSWORD}\"}}}" > /kaniko/.docker/config.json
- /kaniko/executor --context ${CI_PROJECT_DIR} --dockerfile ${CI_PROJECT_DIR}/${DOCKER_FILE} --destination ${DOCKER_IMAGE}:${DOCKER_TAG} --snapshotMode=redo --cache=false
prepare:docker:
<<: *prepare_docker
build:demo:
stage: build
image: ${DOCKER_IMAGE}:${DOCKER_TAG}
script:
- if [ -d "$HOME/tmp_libhermit-rs" ]; then rm -rf $HOME/tmp_libhermit-rs; fi
- mkdir $HOME/tmp_libhermit-rs
- shopt -s dotglob nullglob && mv ./* $HOME/tmp_libhermit-rs
# If for some reason target exists (due to a bad cache) then delete it.
- if [ -d "$HOME/tmp_libhermit-rs/target" ]; then rm -rf $HOME/tmp_libhermit-rs/target; fi
- git clone https://github.com/hermitcore/rusty-hermit.git
- cd rusty-hermit
- echo "rusty-hermit at commit $(git rev-parse HEAD)"
# Ensure that libhermit-rs is empty - This shouldn't be necessary since we don't initialize the submodules
# But let's do it anyway to be safe
- if [ -d "libhermit-rs" ]; then rm -rf libhermit-rs; fi
- mkdir libhermit-rs
- shopt -s dotglob nullglob && mv $HOME/tmp_libhermit-rs/* libhermit-rs/.
- cargo build -Zbuild-std=std,panic_abort --target x86_64-unknown-hermit --package rusty_demo
- cargo build -Zbuild-std=std,panic_abort --target x86_64-unknown-hermit --package rusty_demo --release
artifacts:
paths:
- rusty-hermit/target/x86_64-unknown-hermit/debug/rusty_demo
- rusty-hermit/target/x86_64-unknown-hermit/release/rusty_demo
test:integration:
stage: test
image: ${DOCKER_IMAGE}:${DOCKER_TAG}
script:
- lscpu
- kvm-ok
- python3 --version
- HERMIT_LOG_LEVEL_FILTER=Debug cargo test --test '*' --no-fail-fast
--no-default-features --features=pci,acpi
--target x86_64-unknown-none -- --veryverbose
- HERMIT_LOG_LEVEL_FILTER=Debug cargo test --test '*' --no-fail-fast
--no-default-features --features=pci,acpi
--target x86_64-unknown-none -- --num_cores 2
--veryverbose
tags:
- privileged
test:uhyve:
stage: test
dependencies:
- build:demo
image: ${DOCKER_IMAGE}:${DOCKER_TAG}
script:
- lscpu
- kvm-ok
- uhyve -v -c 1 rusty-hermit/target/x86_64-unknown-hermit/debug/rusty_demo
- uhyve -v -c 2 rusty-hermit/target/x86_64-unknown-hermit/debug/rusty_demo
- uhyve -v -c 1 rusty-hermit/target/x86_64-unknown-hermit/release/rusty_demo
- uhyve -v -c 2 rusty-hermit/target/x86_64-unknown-hermit/release/rusty_demo
tags:
- privileged
test:qemu:
stage: test
dependencies:
- build:demo
image: ${DOCKER_IMAGE}:${DOCKER_TAG}
script:
- lscpu
- kvm-ok
- qemu-system-x86_64 -smp 1
-cpu qemu64,apic,fsgsbase,rdtscp,xsave,xsaveopt,fxsr,rdrand
-device isa-debug-exit,iobase=0xf4,iosize=0x04
-display none -m 64M -serial stdio -enable-kvm
-kernel /usr/local/bin/rusty-loader-x86_64
-initrd rusty-hermit/target/x86_64-unknown-hermit/debug/rusty_demo
- qemu-system-x86_64 -smp 4
-cpu qemu64,apic,fsgsbase,rdtscp,xsave,xsaveopt,fxsr,rdrand
-device isa-debug-exit,iobase=0xf4,iosize=0x04
-display none -m 128M -serial stdio -enable-kvm
-kernel /usr/local/bin/rusty-loader-x86_64
-initrd rusty-hermit/target/x86_64-unknown-hermit/debug/rusty_demo
- qemu-system-x86_64 -smp 1
-cpu qemu64,apic,fsgsbase,rdtscp,xsave,xsaveopt,fxsr,rdrand
-device isa-debug-exit,iobase=0xf4,iosize=0x04
-display none -m 64M -serial stdio -enable-kvm
-kernel /usr/local/bin/rusty-loader-x86_64
-initrd rusty-hermit/target/x86_64-unknown-hermit/release/rusty_demo
- qemu-system-x86_64 -smp 4
-cpu qemu64,apic,fsgsbase,rdtscp,xsave,xsaveopt,fxsr,rdrand
-device isa-debug-exit,iobase=0xf4,iosize=0x04
-display none -m 128M -serial stdio -enable-kvm
-kernel /usr/local/bin/rusty-loader-x86_64
-initrd rusty-hermit/target/x86_64-unknown-hermit/release/rusty_demo
tags:
- privileged