From: Prarit Bhargava <pra...@redhat.com>

.gitlab-ci.yaml: Add test for dist-get-buildreqs target

Add a test for the dist-get-buildreqs target.

Signed-off-by: Prarit Bhargava <pra...@redhat.com>

diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
index blahblah..blahblah 100644
--- a/.gitlab-ci.yml
+++ b/.gitlab-ci.yml
@@ -239,6 +239,37 @@ rawhide_release:
   rules:
     - if: '$CI_PIPELINE_SOURCE == "schedule" && $RAWHIDE_RELEASE == "true"'
 
+test_makefile:
+  image: quay.io/fedora/fedora:rawhide
+  variables:
+    GIT_DEPTH: "0"
+    GIT_CLONE_PATH: $CI_BUILDS_DIR/$CI_CONCURRENT_ID/kernel-ark
+  before_script:
+    - echo "fastestmirror=true" >> /etc/dnf/dnf.conf
+    - dnf -y install python3-gitlab git openssh-clients dnf-utils gnupg2
+    # These packages are required for 'make dist-get-buildreqs'
+    - dnf -y install make rpm-build
+    - git config user.name "Fedora Kernel Team"
+    - git config user.email "kernel-t...@fedoraproject.org"
+    - echo "$PYTHON_GITLAB_CONFIG" >> ~/.python-gitlab.cfg
+    # Need SSH since the clone is set up without write access.
+    - eval $(ssh-agent -s)
+    - echo "$PRIVATE_KEY" | tr -d '\r' | ssh-add - > /dev/null
+    - mkdir -p ~/.ssh
+    - chmod 700 ~/.ssh
+    - echo "$GITLAB_KNOWN_HOSTS" >> ~/.ssh/known_hosts
+    - chmod 644 ~/.ssh/known_hosts
+    - git remote add gitlab g...@gitlab.com:cki-project/kernel-ark.git
+    - gpg2 --import "$TORVALDS_GPG_KEY"
+  script:
+    - export missing=$(make dist-get-buildreqs | grep "Missing dependencies:" 
| cut -d":" -f2)
+    - if [ "$missing" == "" ]; then echo "Missing dependencies should not be 
null but are empty. Review test log." && exit 1; fi;
+    - dnf -y install $missing
+    - export missingafter=$(make dist-get-buildreqs | grep "Missing 
dependencies:" | cut -d":" -f2)
+    - if [ "$missingafter" != "" ]; then echo "Missing dependencies should be 
null but are $missingafter. Review test log." && exit 1; fi;
+  rules:
+    - if: '$CI_MERGE_REQUEST_TARGET_BRANCH_NAME == "os-build"'
+
 test_docs:
   stage: test
   image: registry.gitlab.com/cki-project/containers/python

--
https://gitlab.com/cki-project/kernel-ark/-/merge_requests/1900
_______________________________________________
kernel mailing list -- kernel@lists.fedoraproject.org
To unsubscribe send an email to kernel-le...@lists.fedoraproject.org
Fedora Code of Conduct: 
https://docs.fedoraproject.org/en-US/project/code-of-conduct/
List Guidelines: https://fedoraproject.org/wiki/Mailing_list_guidelines
List Archives: 
https://lists.fedoraproject.org/archives/list/kernel@lists.fedoraproject.org
Do not reply to spam on the list, report it: 
https://pagure.io/fedora-infrastructure

Reply via email to