Skip to content

Refactor GHA CI workflow for speed. - #3681

Closed
JoaoRodrigues wants to merge 19 commits into
biopython:masterfrom
JoaoRodrigues:gha_cache_improvement
Closed

JoaoRodrigues wants to merge 19 commits into
biopython:masterfrom
JoaoRodrigues:gha_cache_improvement

Conversation

@JoaoRodrigues

Copy link
Copy Markdown
Member

A first (or n-th) attempt to use cache to make things a little faster. I also added the concurrency keyword which runs only one action/workflow per github branch or reference, and a timeout of 20 minutes to the tests to prevent hanging.

  • I hereby agree to dual licence this and any previous contributions under both
    the Biopython License Agreement AND the BSD 3-Clause License.

  • I have read the CONTRIBUTING.rst file, have run pre-commit locally,
    and understand that AppVeyor and TravisCI will be used to confirm the Biopython unit
    tests and style checks pass with these changes.

  • I have added my name to the alphabetical contributors listings in the files
    NEWS.rst and CONTRIB.rst as part of this pull request, am listed
    already, or do not wish to be listed. (This acknowledgement is optional.)

@codecov

codecov Bot commented Aug 1, 2021 •

Copy link
Copy Markdown

Codecov Report

Merging #3681 (c3bc997) into master (b3f7904) will decrease coverage by 1.70%.
The diff coverage is n/a.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #3681      +/-   ##
==========================================
- Coverage   83.60%   81.89%   -1.71%     
==========================================
  Files         316      296      -20     
  Lines       52496    49376    -3120     
==========================================
- Hits        43888    40437    -3451     
- Misses       8608     8939     +331     
Impacted Files Coverage Δ
Bio/Phylo/CDAOIO.py 4.46% <0.00%> (-80.36%) ⬇️
Bio/phenotype/pm_fitting.py 12.28% <0.00%> (-75.44%) ⬇️
Bio/PDB/mmtf/__init__.py 28.57% <0.00%> (-61.91%) ⬇️
Bio/Graphics/__init__.py 25.00% <0.00%> (-58.34%) ⬇️
Bio/Phylo/CDAO.py 42.85% <0.00%> (-57.15%) ⬇️
Bio/Phylo/_utils.py 25.00% <0.00%> (-52.41%) ⬇️
Bio/codonalign/codonseq.py 44.16% <0.00%> (-44.31%) ⬇️
Bio/Phylo/_cdao_owl.py 89.47% <0.00%> (-10.53%) ⬇️
Bio/KEGG/KGML/KGML_pathway.py 73.58% <0.00%> (-6.67%) ⬇️
Bio/motifs/jaspar/db.py 3.04% <0.00%> (-5.33%) ⬇️
... and 26 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update b3f7904...c3bc997. Read the comment docs.

@JoaoRodrigues

Copy link
Copy Markdown
Member Author

@peterjc I quit :) I have no idea how to fix the PyPy3 issues. Getting some dependencies built takes forever (10+ min) and testing generally speaking is very slow.

I would maybe move PyPy3 CI to a different yaml file/workflow and try to make it optional (or run only on push or periodically), otherwise our entire CI is slowed down considerably. What do you think?

I got the docs error to go away, but the RST linting is failing (never worked in GHA) because of this error below. Could you take a look?


  # Check sort order (bash call work around for pipe character)
  bash -c \' grep "^- " CONTRIB.rst | LC_ALL=C sort -u -c -f \'
  # Check copyright date
  bash -c \' grep "1999-`date +'%Y'`" LICENSE.rst \'
  # Check no __docformat__ lines
  bash -c "if grep --include '*.py' -rn '^__docformat__ ' Bio BioSQL Tests Scripts Doc ; then echo 'Remove __docformat__ line(s), we assume restructuredtext.'; false; fi"
  # Black style check:
  black --check --diff .
  shell: /usr/bin/bash --noprofile --norc -e -o pipefail {0}
  env:
    pythonLocation: /opt/hostedtoolcache/Python/3.9.6/x64
    LD_LIBRARY_PATH: /opt/hostedtoolcache/Python/3.9.6/x64/lib
sort: open failed: "'": No such file or directory
grep: -c: line 0: unexpected EOF while looking for matching `''
grep: -c: line 1: syntax error: unexpected end of file
Error: Process completed with exit code 2.

@peterjc

peterjc commented Aug 2, 2021 •

Copy link
Copy Markdown
Member

Pragmatic answer: Test pypy with as few dependencies as possible, I would suggest just numpy and mysqlclient as per the old TravisCI setup where again, the pypy tests were the slowest.

See https://github.com/biopython/biopython/blob/biopython-179/.travis-tox.ini#L55 and the list of dependencies thereafter.

@peterjc

peterjc commented Aug 2, 2021

Copy link
Copy Markdown
Member

And yes, #3682 aims to fix the RST / Sphinx API doc testing

@JoaoRodrigues

Copy link
Copy Markdown
Member Author

Will split pypy3 into its own job (seems the simplest) and keep deps to a minimum, like the macos and windows builds.

@peterjc

peterjc commented Aug 5, 2021

Copy link
Copy Markdown
Member

I don't immediately see why that grep based linting is failing, but you could try dropping the bash -c ... bit which was a hack on TravisCI?

@JoaoRodrigues
JoaoRodrigues deleted the gha_cache_improvement branch April 26, 2022 15:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants