Mercurial > p > roundup > code
comparison .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 |
comparison
equal
deleted
inserted
replaced
| 7762:a9da9c8e4295 | 7763:a8891a0e10cb |
|---|---|
| 110 - name: Display Python and key module versions | 110 - name: Display Python and key module versions |
| 111 run: | | 111 run: | |
| 112 python -c "import sys; print('python version: ', sys.version)" | 112 python -c "import sys; print('python version: ', sys.version)" |
| 113 python -c "import sqlite3; print('sqlite version: ', sqlite3.sqlite_version)" | 113 python -c "import sqlite3; print('sqlite version: ', sqlite3.sqlite_version)" |
| 114 python -c "import setuptools; print('setuptools version: ', setuptools.__version__);" | 114 python -c "import setuptools; print('setuptools version: ', setuptools.__version__);" |
| 115 | |
| 116 - name: Update pip | |
| 117 run: python -m pip install --upgrade pip | |
| 118 | |
| 119 - name: Install pytest and other packages needed for running tests | |
| 120 run: pip install flake8 mock pytest pytest-cov requests sphinx-tabs | |
| 121 | |
| 122 - name: run flake8 - abort for syntax error, otherwise warn only | |
| 123 run: | | |
| 124 # stop the build for Python syntax errors or undefined names | |
| 125 # talgettext is a utility function ignore it. | |
| 126 flake8 roundup --count --select=E9,F63,F7,F82 --show-source --statistics --extend-exclude talgettext.py | |
| 127 # exit-zero treats all errors as warnings. | |
| 128 # The GitHub editor is 127 chars wide | |
| 129 flake8 roundup --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics | |
| 115 | 130 |
| 116 # Install the databases | 131 # Install the databases |
| 117 - name: Install mysql/mariadb | 132 - name: Install mysql/mariadb |
| 118 run: | | 133 run: | |
| 119 #set -xv | 134 #set -xv |
| 159 | 174 |
| 160 - name: install redis | 175 - name: install redis |
| 161 run: | | 176 run: | |
| 162 sudo apt-get install redis | 177 sudo apt-get install redis |
| 163 pip install redis | 178 pip install redis |
| 164 | |
| 165 - name: Update pip | |
| 166 run: python -m pip install --upgrade pip | |
| 167 | 179 |
| 168 - name: Install python db libraries | 180 - name: Install python db libraries |
| 169 run: pip install psycopg2 mysqlclient | 181 run: pip install psycopg2 mysqlclient |
| 170 | 182 |
| 171 - name: Install auxiliary packages | 183 - name: Install auxiliary packages |
| 216 diff -u configure.FCS configure || true; \ | 228 diff -u configure.FCS configure || true; \ |
| 217 ./configure --prefix=$VIRTUAL_ENV --with-python3 --disable-documentation; \ | 229 ./configure --prefix=$VIRTUAL_ENV --with-python3 --disable-documentation; \ |
| 218 fi | 230 fi |
| 219 case "$PYTHON_VERSION" in nightly) echo skipping xapian build;; *) make && sudo make install; esac | 231 case "$PYTHON_VERSION" in nightly) echo skipping xapian build;; *) make && sudo make install; esac |
| 220 | 232 |
| 221 - name: Install pytest and other packages needed for running tests | |
| 222 run: pip install flake8 mock pytest pytest-cov requests sphinx-tabs | |
| 223 | |
| 224 - name: Test build roundup and install locale so lang tests work. | 233 - name: Test build roundup and install locale so lang tests work. |
| 225 run: | | 234 run: | |
| 226 sudo apt-get install gettext | 235 sudo apt-get install gettext |
| 227 python setup.py build | 236 python setup.py build |
| 228 (cd locale; make local_install; ls -lR locale/de/LC_MESSAGES) | 237 (cd locale; make local_install; ls -lR locale/de/LC_MESSAGES) |
| 229 | |
| 230 - name: run flake8 - abort for syntax error, otherwise warn only | |
| 231 run: | | |
| 232 # stop the build for Python syntax errors or undefined names | |
| 233 # talgettext is a utility function ignore it. | |
| 234 flake8 roundup --count --select=E9,F63,F7,F82 --show-source --statistics --extend-exclude talgettext.py | |
| 235 # exit-zero treats all errors as warnings. | |
| 236 # The GitHub editor is 127 chars wide | |
| 237 flake8 roundup --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics | |
| 238 | 238 |
| 239 # Run the tests using pytest with test files in tests directory. | 239 # Run the tests using pytest with test files in tests directory. |
| 240 - name: Run tests | 240 - name: Run tests |
| 241 run: | | 241 run: | |
| 242 if [[ "$PYTHON_VERSION" != "2."* ]]; then | 242 if [[ "$PYTHON_VERSION" != "2."* ]]; then |
