Mercurial > p > roundup > code
diff .github/workflows/ci-test.yml @ 7763:a8891a0e10cb
chore: optimize build file make it error sooner on flake8 tests
Move:
pip update,
pip install of required python test modules (pytest, flake8 ...)
flake8 sanity test
before all the code that sets installs xapian, whoosh, databases etc.
This should make a syntax error creeping in fail faster.
| author | John Rouillard <rouilj@ieee.org> |
|---|---|
| date | Sat, 02 Mar 2024 01:43:39 -0500 |
| parents | b7a8d9664938 |
| children | 5ac9253d2a5f |
line wrap: on
line diff
--- a/.github/workflows/ci-test.yml Sat Mar 02 01:38:41 2024 -0500 +++ b/.github/workflows/ci-test.yml Sat Mar 02 01:43:39 2024 -0500 @@ -113,6 +113,21 @@ python -c "import sqlite3; print('sqlite version: ', sqlite3.sqlite_version)" python -c "import setuptools; print('setuptools version: ', setuptools.__version__);" + - name: Update pip + run: python -m pip install --upgrade pip + + - name: Install pytest and other packages needed for running tests + run: pip install flake8 mock pytest pytest-cov requests sphinx-tabs + + - name: run flake8 - abort for syntax error, otherwise warn only + run: | + # stop the build for Python syntax errors or undefined names + # talgettext is a utility function ignore it. + flake8 roundup --count --select=E9,F63,F7,F82 --show-source --statistics --extend-exclude talgettext.py + # exit-zero treats all errors as warnings. + # The GitHub editor is 127 chars wide + flake8 roundup --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics + # Install the databases - name: Install mysql/mariadb run: | @@ -162,9 +177,6 @@ sudo apt-get install redis pip install redis - - name: Update pip - run: python -m pip install --upgrade pip - - name: Install python db libraries run: pip install psycopg2 mysqlclient @@ -218,24 +230,12 @@ fi case "$PYTHON_VERSION" in nightly) echo skipping xapian build;; *) make && sudo make install; esac - - name: Install pytest and other packages needed for running tests - run: pip install flake8 mock pytest pytest-cov requests sphinx-tabs - - name: Test build roundup and install locale so lang tests work. run: | sudo apt-get install gettext python setup.py build (cd locale; make local_install; ls -lR locale/de/LC_MESSAGES) - - name: run flake8 - abort for syntax error, otherwise warn only - run: | - # stop the build for Python syntax errors or undefined names - # talgettext is a utility function ignore it. - flake8 roundup --count --select=E9,F63,F7,F82 --show-source --statistics --extend-exclude talgettext.py - # exit-zero treats all errors as warnings. - # The GitHub editor is 127 chars wide - flake8 roundup --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics - # Run the tests using pytest with test files in tests directory. - name: Run tests run: |
