summaryrefslogtreecommitdiff
path: root/.github/workflows
diff options
context:
space:
mode:
authorCole Robinson <crobinso@redhat.com>2020-07-17 15:27:08 -0400
committerCole Robinson <crobinso@redhat.com>2020-07-18 19:28:04 -0400
commitcd603672a8d6183e54c0c991f599d004989c7a99 (patch)
treeae9a70eac97e1c2ca901c97f491300d1e8f9749e /.github/workflows
parenta2829e65e994ec9acf619bca47445d8fbaf7f567 (diff)
downloadvirt-manager-cd603672a8d6183e54c0c991f599d004989c7a99.tar.gz
CI: Add ci.yml
Run RPM build and test suite against latest fedora + virt-preview, output and upload coverage info to codecov Signed-off-by: Cole Robinson <crobinso@redhat.com>
Diffstat (limited to '.github/workflows')
-rw-r--r--.github/workflows/ci.yml42
1 files changed, 42 insertions, 0 deletions
diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml
new file mode 100644
index 00000000..f6cb77ee
--- /dev/null
+++ b/.github/workflows/ci.yml
@@ -0,0 +1,42 @@
+name: CI
+
+on: [push, pull_request]
+
+jobs:
+ # Setup latest Fedora with latest libvirt from virt-preview, build
+ # the RPM, verify it installs, run test suite, upload coverage
+ test:
+ runs-on: ubuntu-latest
+ container:
+ image: fedora:latest
+
+ steps:
+ - uses: actions/checkout@v2
+
+ - name: Install RPM build deps
+ run: |
+ # glibc-langpacks-en needed to work around python locale issues
+ dnf install -y \
+ rpm-build \
+ dnf-plugins-core \
+ glibc-langpack-en \
+ python3-pytest python3-pytest-cov
+
+ dnf copr enable -y @virtmaint-sig/virt-preview
+ dnf install -y virt-install
+ dnf builddep -y ./virt-manager.spec
+
+ - name: Build RPM and test install
+ run: |
+ ./setup.py rpm
+ dnf update -y noarch/*.rpm
+
+ - name: Run test suite and generate coverage report
+ run: |
+ pytest --cov --cov-report=xml
+
+ - name: Upload coverage to Codecov
+ uses: codecov/codecov-action@v1
+ with:
+ file: ./coverage.xml
+ flags: unittests