-
Notifications
You must be signed in to change notification settings - Fork 16
151 lines (128 loc) · 6.01 KB
/
lint_and_test_macos.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
name: Lint And Test MacOS
# NOTE: Due to 10X minute multiplier, do NOT run on macos-latest on every push!
# https://docs.github.com/en/billing/managing-billing-for-github-actions/about-billing-for-github-actions#minute-multipliers
# Run on macos on a separate weekly schedule.
on:
# push: # Do NOT run on MacOS on every push!
# pull_request: (either on origin or on upstream pull request)
schedule:
# Instead, run it every Tuesday at midnight.
- cron: '0 0 * * 2'
workflow_dispatch:
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
permissions:
actions: read
contents: read
pull-requests: read
jobs:
lint_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 }}-macos-latest-${{ github.ref }}
cancel-in-progress: true
strategy:
fail-fast: false
runs-on: macos-latest
steps:
- name: Checkout workflow-inference-compiler
if: always()
uses: actions/checkout@v3
with:
repository: ${{ github.repository_owner }}/workflow-inference-compiler
ref: master
path: workflow-inference-compiler
- name: Checkout biobb_adapters
if: always()
uses: actions/checkout@v3
with:
repository: vjaganat90/biobb_adapters
ref: master
path: biobb_adapters
- name: Checkout mm-workflows
if: always()
uses: actions/checkout@v3
with:
repository: ${{ github.repository_owner }}/mm-workflows
ref: main
path: mm-workflows
- name: Checkout image-workflows
if: always()
uses: actions/checkout@v3
with:
repository: ${{ github.repository_owner }}/image-workflows
ref: main
path: image-workflows
- name: Setup mamba (linux, macos)
if: runner.os != 'Windows'
uses: conda-incubator/setup-miniconda@v2.2.0
with:
miniforge-variant: Mambaforge-pypy3
miniforge-version: latest
environment-file: workflow-inference-compiler/install/system_deps.yml
activate-environment: wic
use-mamba: true
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 workflow-inference-compiler/ -name "*.sh" -and -not -path "./3/*")
- name: Install Workflow Inference Compiler
if: always()
run: cd workflow-inference-compiler/ && pip install ".[all_except_runner_src]"
- name: Install Molecular Modeling Workflows
if: always()
# Also run mm-workflows command to generate
# mm-workflows/autogenerated/schemas/config_schemas.json
# NOTE: Use ".[test]" instead of ".[all_except_runner_src]"
# We do not want or need to install the workflow_deps extra.
# (Many of the packages conflict with pypy.)
run: cd mm-workflows/ && pip install ".[test]" && mm-workflows --generate_schemas
- name: Generate Sophios Python API Workflows (*.py -> *.wic)
if: always()
run: cd workflow-inference-compiler/ && python -c 'import sophios; import sophios.plugins; sophios.plugins.blindly_execute_python_workflows()'
- name: Generate Sophios Validation Jsonschema
if: always()
run: cd workflow-inference-compiler/ && sophios --generate_schemas
# Please read docs/validation.md#Property-Based-Testing
# This is essentially an integration test for all of the
# Sophios Python API workflows as well as the Sophios Python API itself.
- name: Validate Sophios Python API Workflows (*.py -> *.wic)
if: always()
run: cd workflow-inference-compiler/ && python -c 'import sophios; import sophios.plugins; sophios.plugins.blindly_execute_python_workflows()'
- name: Build Documentation
if: always()
run: cd workflow-inference-compiler/docs && make html
- name: MyPy Check Type Annotations
if: always()
run: cd workflow-inference-compiler/ && mypy src/ examples/ tests/
# NOTE: Do not use `mypy .` because then mypy will check both src/ and build/ causing:
# src/workflow-inference-compiler/__init__.py: error: Duplicate module named "wic"
# (also at "./build/lib/workflow-inference-compiler/__init__.py")
- name: PyLint Check Code Quality
if: always()
run: cd workflow-inference-compiler/ && pylint src/ examples/**/*.py tests/
# NOTE: See fail-under threshold in .pylintrc
- name: PEP8 Code Formatting
if: always()
id: autopep8
run: cd workflow-inference-compiler/ && autopep8 --exit-code --recursive --diff --max-line-length 120 examples/ src/ tests/
- name: Fail if autopep8 made changes
if: steps.autopep8.outputs.exit-code == 2
run: exit 1
# NOTE: Do NOT add coverage to PYPY CI runs https://github.com/tox-dev/tox/issues/2252
- name: PyTest CWL Embedding Independence
if: always()
run: cd workflow-inference-compiler/ && pytest -k test_cwl_embedding_independence # --cov --cov-config=.coveragerc_serial
# NOTE: This test MUST be run in serial! See is_isomorphic_with_timeout()
timeout-minutes: 5 # backup timeout for windows
- name: PyTest Inline Subworkflows
if: always()
run: cd workflow-inference-compiler/ && pytest -k test_inline_subworkflows # --cov --cov-config=.coveragerc_serial
# NOTE: This test MUST be run in serial! See is_isomorphic_with_timeout()
timeout-minutes: 5 # backup timeout for windows