Skip to content

Commit

Permalink
Merge pull request avocado-framework#3186 from ana/update_gha_check
Browse files Browse the repository at this point in the history
Updates to CI
  • Loading branch information
chunfuwen authored Aug 23, 2021
2 parents 7014673 + ac52469 commit 9c2bc11
Show file tree
Hide file tree
Showing 7 changed files with 46 additions and 9 deletions.
33 changes: 30 additions & 3 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,7 @@ jobs:
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: |
pip install Sphinx==1.3b1
pip install -r requirements-travis.txt
run: pip install -r requirements-travis.txt
- name: Check out Avocado libs
uses: actions/checkout@v2
with:
Expand All @@ -56,4 +54,33 @@ jobs:
run: AVOCADO_LOG_DEBUG=yes avocado vt-bootstrap --vt-skip-verify-download-assets --yes-to-all
- name: Run tests
run: inspekt checkall --disable-lint W,R,C,E1002,E1101,E1103,E1120,F0401,I0011,E1003,W605 --disable-style W605,W606,E501,E265,W601,E402,E722,E741 --exclude avocado-libs,scripts/github --no-license-check
- name: Run spellchecker
run: pylint --errors-only --disable=all --ignore=avocado-libs --enable=spelling --spelling-dict=en_US --spelling-private-dict-file=spell.ignore *
- name: Check signed-off-by
run: ./selftests/signedoff-check.sh
- run: echo "This job's status is ${{ job.status }}."

package-build:
name: Build Package for Python ${{ matrix.python-version }}
runs-on: ubuntu-20.04

strategy:
matrix:
python-version: [3.6, 3.7, 3.8, 3.9]
fail-fast: false

steps:
- uses: actions/checkout@v2
- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install build
- name: Build package
run: python -m build
- name: Build eggs
run: python setup.py bdist_egg
- run: echo "🥑 This job's status is ${{ job.status }}."
7 changes: 2 additions & 5 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -42,11 +42,11 @@ all:
@echo

requirements: pip
- $(PYTHON) -m pip install "pip>=6.0.1"
- $(PYTHON) -m pip install -r requirements.txt

check:
inspekt checkall --disable-lint W,R,C,E1002,E1101,E1103,E1120,F0401,I0011,E1003 --no-license-check
inspekt checkall --disable-lint W,R,C,E1002,E1101,E1103,E1120,F0401,I0011,E1003,W605 --disable-style W605,W606,E501,E265,W601,E402,E722,E741 --exclude avocado-libs,scripts/github --no-license-check
pylint --errors-only --disable=all --enable=spelling --spelling-dict=en_US --spelling-private-dict-file=spell.ignore *

clean:
$(PYTHON) setup.py clean
Expand All @@ -67,9 +67,6 @@ unlink:
[ -L ../$(AVOCADO_DIRNAME)/$$CONF ] && rm -f ../$(AVOCADO_DIRNAME)/$$CONF || true;\
done

spell:
pylint --errors-only --disable=all --enable=spelling --spelling-dict=en_US --spelling-private-dict-file=spell.ignore * && echo OK

pypi: clean
if test ! -d PYPI_UPLOAD; then mkdir PYPI_UPLOAD; fi
$(PYTHON) setup.py bdist_wheel -d PYPI_UPLOAD
Expand Down
1 change: 1 addition & 0 deletions requirements-travis.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,4 @@ aexpect==1.6.0
simplejson==3.8.0
netaddr==0.7.19
netifaces>=0.10.5
pyenchant
10 changes: 10 additions & 0 deletions selftests/signedoff-check.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
#!/bin/sh -e

echo "** Running signedoff-check..."

AUTHOR="$(git log --no-merges -1 --pretty='format:%aN <%aE>')"
git log --no-merges -1 --pretty=format:%B | grep -i "Signed-off-by: $AUTHOR"
if [ $? != 0 ]; then
echo "The commit message does not contain author's signature (Signed-off-by: $AUTHOR)"
exit 1
fi
1 change: 1 addition & 0 deletions spell.ignore
Original file line number Diff line number Diff line change
Expand Up @@ -752,6 +752,7 @@ superclass's
LENOVO
idmap
gid
tc

# The list below needs a second review
abc
Expand Down
2 changes: 1 addition & 1 deletion virttest/libvirt_xml/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -308,7 +308,7 @@ def setup_attrs(self, **attrs):
value.pop('reset_all')
# If Element tag is not found, we need to create a new instance
# to set the attributes.
# If reset_all, it means we will discard the exising instance
# If reset_all, it means we will discard the existing instance
# of current sub-xml and create a new one to replace it.
if reset_all or not self.xmltreefile.find(key):
# Get args to create an instance of subclass
Expand Down
1 change: 1 addition & 0 deletions virttest/utils_libvirt/libvirt_embedded_qemu.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ class EmbeddedQemuSession(object):
"""
Interaction embeddedQemu session can start a qemu process.
"""

def __init__(self,
logging_handler=None,
logging_params=(),
Expand Down

0 comments on commit 9c2bc11

Please sign in to comment.