summary refs log tree commit diff
path: root/.gitlab-ci.yml
diff options
context:
space:
mode:
authorLakshmipathi <lakshmipathi.ganapathi@collabora.com>2021-01-05 18:31:05 +0530
committerCristian Ciocaltea <cristian.ciocaltea@collabora.com>2022-12-12 17:57:12 +0200
commit2b1fa149006ad584098c94d4ef600512b0506858 (patch)
tree47143afb4fdd4ff02f93c20c695e76d6f1e4d94b /.gitlab-ci.yml
parent830b3c68c1fb1e9176028d02ef86f3cf76aa2476 (diff)
downloadlinux-2b1fa149006ad584098c94d4ef600512b0506858.tar.gz
gitlabci: Enable GitLabCI jobs
Signed-off-by: Lakshmipathi <lakshmipathi.ganapathi@collabora.com>
Diffstat (limited to '.gitlab-ci.yml')
-rw-r--r--.gitlab-ci.yml50
1 files changed, 50 insertions, 0 deletions
diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
new file mode 100644
index 000000000000..babf330c0a53
--- /dev/null
+++ b/.gitlab-ci.yml
@@ -0,0 +1,50 @@
+variables:
+  DOCKER_DRIVER: overlay2
+  KERNEL: 'bzImage'
+  ROOTFS_NAME: 'ubuntu-19.04-desktopV4-amd64.img.qcow2'
+  ROOTFS_IMAGE_URL: 'https://people.collabora.com/~laks/lava/kernel_test/ubuntu-19.04-desktopV4-amd64.img.qcow2.gz'
+  GIT_AUTHOR_NAME: "Gitlab-ci"
+  GIT_AUTHOR_EMAIL: "gitlab@gitlab.steamos.cloud"
+  TAG: CI_${CI_PIPELINE_ID}_${CI_COMMIT_SHORT_SHA}
+  
+before_script:
+   - apt-get update -y
+
+stages:
+  - build
+
+kernel build:
+  stage: build
+  tags:
+     - autoscaled 
+  before_script:
+    - apt-get update -y
+    - apt-get install -y rsync git build-essential bc kmod cpio flex cpio libncurses5-dev bison libssl-dev libelf-dev openssh-client curl qemu-system*
+  script:
+     - make x86_64_defconfig && make kvm_guest.config
+     - ./scripts/kconfig/merge_config.sh .config .config-fragment
+     - make -j`nproc`
+     - git rev-parse HEAD &> commit_id_file
+     - cp -v arch/x86/boot/bzImage .
+     - cp .config kernel_config
+     # download rootfs
+     - curl  ${ROOTFS_IMAGE_URL} -o "${ROOTFS_NAME}.gz"
+     - gunzip "${ROOTFS_NAME}.gz"
+     - echo "Running cmd $QEMU_CMD"
+     - qemu-system-x86_64 -enable-kvm -nographic -kernel ${KERNEL} -drive file=${ROOTFS_NAME},format=qcow2 -device virtio-serial-pci -virtfs local,path=$(pwd),mount_tag=steamlogs,security_model=none -m 2G -smp 2 -cpu host -net user,hostfwd=tcp::2222-:22 -net nic,model=virtio --append "root=/dev/sda1 rw console=ttyS0"    
+     # notify
+     - test -f "fail.txt" && exit 1
+     - echo "All tests passed..setup tags"
+     - git config --global user.email ${GIT_AUTHOR_EMAIL}
+     - git config --global user.name ${GIT_AUTHOR_NAME}
+     - sed -i -r 's/(url = .*):(.*)@(.*)/\1:'${LINUX_INTEGRATION_TOKEN}'@\3/' .git/config
+     - git tag ${TAG}
+     - git tag -f latest
+     - git push -o ci.skip origin -f --tags
+  artifacts:
+    expire_in: 1 week
+    when: always
+    paths:
+      - bzImage
+      - kernel_config
+      - kernel_results.log