From 4e14d0906506353a62186a6294e27e83f6d5d25d Mon Sep 17 00:00:00 2001 From: Okke van Eck <39912605+OkkeVanEck@users.noreply.github.com> Date: Fri, 30 Apr 2021 09:36:51 +0200 Subject: [PATCH] Add CI caching for python environments (#23) * Added first pytest script for protein class and a script for performing local tests. * Added pytest in CI * Forgot -r for file * Version of pytest with pytest at end of pipeline * New pytest CI where pip installs local package * Fixed tabs and added caching of python/pip environment * Removed dot and added removal of build dirs to manage clean command * Added cache ignores for env setup and ids for the caches * Fixed cache IDs * Renamed cache because GitHub does not allow for clearing caches... * Moved python setup to be before cache loading * Run that will install the dependencies * Uncommented the cache-hit detection for installing dependencies * Updated pre-commit version in hope that runner will create new cache * Added more tests and added flake8 incompatability * Other flake8 config try * Reset to .flake8 file * Downgrade of pre-commit to force dep. installation in CI * Different pre-commit version * Added depth_first tests * Added depth_first_bnb tests * Push to try and install all dependencies correctly * Added back cache check for installing dependencies. New way of calling flake8, added class dependencies on tests * Removed ls * Core change test * Core change test - new correctly * Core archiving works * Fixed pytest ordering and upgraded pandas version to trigger new cache * Upgraded pandas * Changed pandas version to 1.1.0 * Dependency check * new flake8 installation * Flake8 action * Added pip update flag * Cleaned up the flake8 action usage * Trying to install new deps * Removed caching, only using dependencies during pytest --- .github/workflows/build_deploy.yml | 29 ++++++++++------------------- 1 file changed, 10 insertions(+), 19 deletions(-) diff --git a/.github/workflows/build_deploy.yml b/.github/workflows/build_deploy.yml index b0d2d08..7592c99 100644 --- a/.github/workflows/build_deploy.yml +++ b/.github/workflows/build_deploy.yml @@ -22,29 +22,21 @@ jobs: syntax_check: name: Check for syntax errors runs-on: ubuntu-latest - strategy: - matrix: - python-version: [3.6] - os: [ubuntu-latest, windows-latest, macos-latest] steps: - uses: actions/checkout@v2 - - name: Set up Python ${{ matrix.python-version }} - uses: actions/setup-python@v2 + - name: Flake8 - Error on syntax errors or undefined names + uses: py-actions/flake8@v1.1.0 with: - python-version: ${{ matrix.python-version }} + args: --count --select=E9,F63,F7,F82 --show-source --statistics + update-pip: "true" - - name: Install dependencies - run: | - python -m pip install --upgrade pip - python -m pip install flake8 - - - name: Lint with flake8 - run: | - # Stop the build if there are Python syntax errors or undefined names - flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics - # Exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide - flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics + - name: Flake8 - Warn on everything else + uses: py-actions/flake8@v1.1.0 + with: + args: --count --exit-zero --max-complexity=10 --statistics + max-line-length: 127 + update-pip: "true" pytest: name: Pytest @@ -71,7 +63,6 @@ jobs: - name: Test with pytest run: pytest - build_wheels: name: Build wheels needs: [pytest, matrix_prep]