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