From ac52469021c247c3fd13364e652ad7701014547d Mon Sep 17 00:00:00 2001 From: Ana Guerrero Lopez Date: Tue, 10 Aug 2021 10:57:34 +0200 Subject: [PATCH] CI: Add new checks for spell, signed-off and build eggs Add job to build package (egg) Check signed-off-by to make sure new commits are signed by the author. Add spellchecker together with its requirements on pyenchant to requirements-travis.txt Sphinx is already listed in requirements-travis.txt, remove it. Signed-off-by: Ana Guerrero Lopez --- .github/workflows/ci.yml | 33 ++++++++++++++++++++++++++++++--- requirements-travis.txt | 1 + selftests/signedoff-check.sh | 10 ++++++++++ 3 files changed, 41 insertions(+), 3 deletions(-) create mode 100755 selftests/signedoff-check.sh diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 9ce6a11be2..acaff6614d 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -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: @@ -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 }}." diff --git a/requirements-travis.txt b/requirements-travis.txt index 807e16e9e7..a5321b864f 100644 --- a/requirements-travis.txt +++ b/requirements-travis.txt @@ -6,3 +6,4 @@ aexpect==1.6.0 simplejson==3.8.0 netaddr==0.7.19 netifaces>=0.10.5 +pyenchant diff --git a/selftests/signedoff-check.sh b/selftests/signedoff-check.sh new file mode 100755 index 0000000000..3e05fbbeed --- /dev/null +++ b/selftests/signedoff-check.sh @@ -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