4e5dbe2
From c59c3417db54c26aac092b1463f130f7540aa33a Mon Sep 17 00:00:00 2001
4e5dbe2
From: Adam Williamson <awilliam@redhat.com>
4e5dbe2
Date: Wed, 24 Jan 2024 17:49:12 -0800
4e5dbe2
Subject: [PATCH 19/21] Add a Github Action workflow to run CI checks
4e5dbe2
4e5dbe2
I can't really test this, but I think it ought to work. This
4e5dbe2
should run the container unit tests, pylint, and flake8 checks
4e5dbe2
on each pull request.
4e5dbe2
4e5dbe2
This also removes .travis.yml, as we clearly haven't used travis
4e5dbe2
for about a decade at this point.
4e5dbe2
4e5dbe2
Signed-off-by: Adam Williamson <awilliam@redhat.com>
4e5dbe2
---
4e5dbe2
 .github/workflows/ci.yml | 41 ++++++++++++++++++++++++++++++++++++++++
4e5dbe2
 .travis.yml              | 33 --------------------------------
4e5dbe2
 2 files changed, 41 insertions(+), 33 deletions(-)
4e5dbe2
 create mode 100644 .github/workflows/ci.yml
4e5dbe2
 delete mode 100644 .travis.yml
4e5dbe2
4e5dbe2
diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml
4e5dbe2
new file mode 100644
4e5dbe2
index 0000000..4fcd212
4e5dbe2
--- /dev/null
4e5dbe2
+++ b/.github/workflows/ci.yml
4e5dbe2
@@ -0,0 +1,41 @@
4e5dbe2
+---
4e5dbe2
+name: Run CI checks
4e5dbe2
+
4e5dbe2
+on: [pull_request]
4e5dbe2
+
4e5dbe2
+jobs:
4e5dbe2
+  unittests-fedora:
4e5dbe2
+    runs-on: ubuntu-latest
4e5dbe2
+    steps:
4e5dbe2
+      - name: Checkout the repo
4e5dbe2
+        uses: actions/checkout@v4
4e5dbe2
+        with:
4e5dbe2
+          fetch-depth: 0
4e5dbe2
+      - name: Install make and docker
4e5dbe2
+        run: apt-get install make docker docker.io
4e5dbe2
+      - name: Run the tests
4e5dbe2
+        run: make container-unittests-fedora
4e5dbe2
+  unittests-el7:
4e5dbe2
+    runs-on: ubuntu-latest
4e5dbe2
+    steps:
4e5dbe2
+      - name: Checkout the repo
4e5dbe2
+        uses: actions/checkout@v4
4e5dbe2
+        with:
4e5dbe2
+          fetch-depth: 0
4e5dbe2
+      - name: Install make and docker
4e5dbe2
+        run: apt-get install make docker
4e5dbe2
+      - name: Run the tests
4e5dbe2
+        run: make container-unittests-el7
4e5dbe2
+  lint:
4e5dbe2
+    runs-on: ubuntu-latest
4e5dbe2
+    steps:
4e5dbe2
+      - name: Checkout the repo
4e5dbe2
+        uses: actions/checkout@v4
4e5dbe2
+        with:
4e5dbe2
+          fetch-depth: 0
4e5dbe2
+      - name: Install make, pylint and flake8
4e5dbe2
+        run: apt-get install make pylint flake8
4e5dbe2
+      - name: Run pylint
4e5dbe2
+        run: make pylint
4e5dbe2
+      - name: Run flake8
4e5dbe2
+        run: make flake8
4e5dbe2
diff --git a/.travis.yml b/.travis.yml
4e5dbe2
deleted file mode 100644
4e5dbe2
index 2a2b8d6..0000000
4e5dbe2
--- a/.travis.yml
4e5dbe2
+++ /dev/null
4e5dbe2
@@ -1,33 +0,0 @@
4e5dbe2
-language: python
4e5dbe2
-
4e5dbe2
-python:
4e5dbe2
-#  - "3.3"
4e5dbe2
-#  - "3.2"
4e5dbe2
-  - "2.7"
4e5dbe2
-
4e5dbe2
-before_install:
4e5dbe2
-  - sudo add-apt-repository -y ppa:pdffs/precise-virt
4e5dbe2
-  - sudo apt-get update
4e5dbe2
-  - sudo apt-get install -qq genisoimage libvirt-dev mtools openssh-client python-dev python-guestfs swig libssl1.0.0 python-m2crypto python-libvirt
4e5dbe2
-
4e5dbe2
-# Travis uses an isolated virtualenv (see http://about.travis-ci.org/docs/user/languages/python/#Travis-CI-Uses-Isolated-virtualenvs)
4e5dbe2
-# Install the system python packages to get their deps and then install the pip version to have them locally
4e5dbe2
-install:
4e5dbe2
-  - pip install -r requirements.txt              
4e5dbe2
-  - sudo cp /usr/lib/python2.7/dist-packages/*guestfs* $VIRTUAL_ENV/lib/python$TRAVIS_PYTHON_VERSION/site-packages/
4e5dbe2
-  - python setup.py install
4e5dbe2
-  - pip install coverage
4e5dbe2
-  - pip install coveralls
4e5dbe2
-  - py.test --genscript=runtests.py
4e5dbe2
-
4e5dbe2
-env:
4e5dbe2
-  - TESTFOLDER=tdl
4e5dbe2
-  - TESTFOLDER=guest
4e5dbe2
-  - TESTFOLDER=ozutil
4e5dbe2
-  - TESTFOLDER=factory
4e5dbe2
-
4e5dbe2
-script: 
4e5dbe2
-  - coverage run -p --source=oz runtests.py --verbose --tb=short tests/$TESTFOLDER
4e5dbe2
-
4e5dbe2
-after_success:
4e5dbe2
-  - coveralls
4e5dbe2
-- 
4e5dbe2
2.43.0
4e5dbe2