-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #73 from hexylena/hexylena-patch-1
- Loading branch information
Showing
3 changed files
with
99 additions
and
1 deletion.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
name: Lint Code | ||
|
||
on: [pull_request] | ||
|
||
jobs: | ||
lint-workflows: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v2 | ||
with: | ||
fetch-depth: 1 | ||
|
||
# BEGIN Dependencies | ||
- uses: actions/setup-python@v2 | ||
with: | ||
python-version: '3.7' | ||
architecture: 'x64' | ||
|
||
- name: Install dependencies | ||
run: | | ||
pip install -r requirements.txt | ||
pip install -U setuptools | ||
pip install -U planemo | ||
pip install -U flake8 | ||
pip install -U xmldiff | ||
# END Dependencies | ||
|
||
- name: Lint 🔍👁👁 | ||
run: | | ||
python setup.py install | ||
flake8 argparse2tool --ignore=E2,E3,E4,E5,W3,W505 | ||
PYTHONPATH=$(argparse2tool) python examples/example.py --generate_galaxy_xml > tmp.xml | ||
xmldiff tmp.xml examples/example.xml | ||
planemo lint --report_level all --fail_level error --xsd tmp.xml | ||
# Galaxy tool generation for example with subparsers -- generating one large (invalid) tool | ||
echo '<root>' > tmp-sub.xml # wrap in extra level | ||
PYTHONPATH=$(argparse2tool) python examples/example-sub.py --generate_galaxy_xml >> tmp-sub.xml | ||
echo '</root>' >> tmp-sub.xml | ||
xmldiff tmp-sub.xml <(echo "<root>"; cat examples/example-sub.xml; echo "</root>") | ||
# Galaxy tool generation for example with subparsers -- generating separate tools | ||
PYTHONPATH=$(argparse2tool) python examples/example-sub.py --generate_galaxy_xml --command foo > tmp-sub-foo.xml | ||
PYTHONPATH=$(argparse2tool) python examples/example-sub.py --generate_galaxy_xml --command bar > tmp-sub-bar.xml | ||
xmldiff tmp-sub-foo.xml examples/example-sub-foo.xml | ||
planemo lint --report_level all --fail_level error --xsd tmp-sub-foo.xml | ||
xmldiff tmp-sub-bar.xml examples/example-sub-bar.xml | ||
planemo lint --report_level all --fail_level error --xsd tmp-sub-bar.xml | ||
PYTHONPATH=$(argparse2tool) python examples/example.py --generate_cwl_tool > tmp.cwl | ||
PYTHONPATH=$(argparse2tool) python examples/example-sub.py --generate_cwl_tool > tmp-sub.cwl | ||
sed -i 's/argparse2tool .*/argparse2tool/g' tmp.cwl tmp-sub.cwl | ||
diff tmp.cwl examples/example.cwl | ||
diff tmp-sub.cwl examples/example-sub.cwl | ||
PYTHONPATH=$(argparse2tool) python examples/example-click.py --generate_cwl_tool > tmp-click.cwl | ||
diff tmp-click.cwl examples/example-click.cwl |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
name: Publish | ||
|
||
on: | ||
push: | ||
branches: | ||
- main | ||
|
||
jobs: | ||
lint-workflows: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v2 | ||
with: | ||
fetch-depth: 1 | ||
|
||
# BEGIN Dependencies | ||
- uses: actions/setup-python@v2 | ||
with: | ||
python-version: '3.7' | ||
architecture: 'x64' | ||
|
||
- name: Install dependencies | ||
run: | | ||
pip install -r requirements.txt | ||
pip install -U setuptools | ||
pip install -U planemo | ||
pip install -U flake8 | ||
pip install -U xmldiff | ||
# END Dependencies | ||
|
||
- name: Install dependencies | ||
run: pip install wheel | ||
|
||
- name: Build package | ||
run: python setup.py sdist bdist_wheel | ||
|
||
- name: Publish a Python distribution to PyPI | ||
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags') | ||
uses: pypa/gh-action-pypi-publish@release/v1 | ||
with: | ||
user: __token__ | ||
password: ${{ secrets.PYPI_API_TOKEN }} |
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