fix onionnet_featuriz bug #308
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Build And Test | |
on: | |
push: | |
defaults: | |
run: | |
shell: bash -l {0} # Invoke bash in login mode, NOT interactive mode. | |
# This will cause bash to look for the startup file ~/.bash_profile, NOT ~/.bashrc | |
# This is important since conda init writes to ~/.bashrc | |
# https://docs.github.com/en/actions/learn-github-actions/understanding-github-actions#jobs | |
# Rather than use a single job with a linear pipeline of steps, you may be | |
# tempted to make each step into a separate job and specify the dependencies | |
# using the `needs` syntax for more parallelism. | |
# However, data cannot be shared between jobs because each job will be run on a | |
# different runner. Even on a self-hosted runner, the `needs` syntax does not | |
# guarantee that the data can be shared! | |
# Using if: always() allows all steps to run, while still properly reporting failure. | |
# See https://stackoverflow.com/questions/62045967/github-actions-is-there-a-way-to-continue-on-error-while-still-getting-correct | |
permissions: | |
actions: read | |
contents: read | |
pull-requests: read | |
jobs: | |
build_and_test: | |
# See https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#concurrency | |
# This will prevent DOS attacks from people blasting the CI with rapid fire commits. | |
concurrency: | |
group: ${{ github.workflow }}-${{ matrix.os }}-${{ github.ref }} | |
cancel-in-progress: true | |
strategy: | |
fail-fast: false | |
matrix: | |
os: [ubuntu-latest, windows-latest, macos-latest] | |
runs-on: ${{ matrix.os }} | |
steps: | |
- name: Checkout mm-workflows | |
if: always() | |
uses: actions/checkout@v3 | |
with: | |
path: mm-workflows | |
- name: Checkout biobb_adapters | |
if: always() | |
uses: actions/checkout@v3 | |
with: | |
repository: vjaganat90/biobb_adapters # TODO: use check_existence | |
ref: master | |
path: biobb_adapters | |
- name: Setup mamba (linux, macos) | |
if: runner.os != 'Windows' | |
uses: conda-incubator/[email protected] | |
with: | |
miniforge-variant: Miniforge-pypy3 | |
miniforge-version: latest | |
environment-file: mm-workflows/install/system_deps.yml | |
activate-environment: mm | |
channels: conda-forge | |
python-version: "3.9.*" # pypy is not yet compatible with 3.10 and 3.11 | |
- name: Setup mamba (windows) | |
if: runner.os == 'Windows' | |
uses: conda-incubator/[email protected] | |
with: | |
miniforge-variant: Miniforge-pypy3 | |
miniforge-version: latest | |
environment-file: mm-workflows/install/system_deps_windows.yml | |
activate-environment: mm | |
channels: conda-forge | |
python-version: "3.9.*" # pypy is not yet compatible with 3.10 and 3.11 | |
- name: ShellCheck Script Quality | |
if: always() | |
# "SC1017 (error): Literal carriage return. Run script through tr -d '\r' ." | |
run: shellcheck -e SC1017 $(find mm-workflows/ -name "*.sh" -not -path "./biobb_adapters/*" -and -not -path "./3/*") | |
- name: Install Molecular Modeling Workflows | |
if: always() | |
# Also run mm-workflows command to generate | |
# mm-workflows/autogenerated/schemas/config_schemas.json | |
run: cd mm-workflows/ && pip install ".[all]" && mm-workflows | |
- name: Build Documentation | |
if: always() | |
run: cd mm-workflows/docs && make html | |
- name: MyPy Check Type Annotations | |
if: always() | |
run: cd mm-workflows/ && mypy src/ examples/ cwl_adapters/ | |
# NOTE: Do not use `mypy .` because then mypy will check both src/ and build/ causing: | |
# src/wic/__init__.py: error: Duplicate module named "wic" (also at "./build/lib/wic/__init__.py") | |
- name: PyLint Check Code Quality | |
if: always() | |
run: cd mm-workflows/ && pylint src/ examples/**/*.py | |
# NOTE: See fail-under threshold in .pylintrc | |
- name: PEP8 Code Formatting | |
if: always() | |
id: autopep8 | |
run: cd mm-workflows/ && autopep8 --exit-code --recursive --diff --max-line-length 120 examples/ src/ | |
- name: Fail if autopep8 made changes | |
if: steps.autopep8.outputs.exit-code == 2 | |
run: exit 1 |