Merge pull request #1336 from WardDeb/maturin #422
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: Test | |
on: [push, pull_request] | |
defaults: | |
run: | |
shell: bash -l {0} | |
jobs: | |
check_versions_matches: | |
name: Check deeptools version matches galaxy tools | |
runs-on: ubuntu-latest | |
if: github.base_ref == 'master' | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Check path | |
run: find /home/runner/work/deepTools/deepTools -name "pyproject.toml" | |
- name: Get Version of Deeptools | |
run: echo "deeptools_version=$(grep "version" /home/runner/work/deepTools/deepTools/pyproject.toml | awk '{print substr($NF, 2, length($NF) - 2)}')" >> $GITHUB_ENV | |
- name: Get Version of Galaxy tools | |
run: echo "galaxy_deeptools_version=$(grep "token.*TOOL_VERSION" /home/runner/work/deepTools/deepTools/galaxy/wrapper/deepTools_macros.xml | awk -F '>|<' '{print $3}')" >> $GITHUB_ENV | |
- name: Versions | |
run: | | |
echo deeptools version=${deeptools_version} | |
echo deeptools version in galaxy=${galaxy_deeptools_version} | |
- name: Fail PR if versions not matching | |
run: | | |
if [ -z $galaxy_deeptools_version ]; then | |
echo "galaxy_deeptools_version not defined change the github action" | |
exit 1 | |
fi | |
if [ -z $deeptools_version ]; then | |
echo "deeptools_version not defined change the github action" | |
exit 1 | |
fi | |
if [ "$galaxy_deeptools_version" != "$deeptools_version" ]; then | |
echo "versions do not match" | |
exit 1 | |
fi | |
build-linux: | |
name: Test on Linux | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: actions/setup-python@v5 | |
with: | |
python-version: '3.12' | |
cache: 'pip' | |
- name: pip install | |
run: | | |
pip install .[actions] | |
- name: PEP8 | |
run: | | |
micromamba activate test_and_build | |
flake8 . --exclude=.venv,.build,build --ignore=E501,F403,E402,F999,F405,E722,W504,W605 | |
- name: Test deepTools | |
run: | | |
pytest -v | |
- name: make an artifact | |
run: | | |
rm -f dist/* | |
python -m build | |
- uses: actions/upload-artifact@v4 | |
with: | |
name: "distfiles" | |
path: "dist" | |
test-wheels: | |
name: test wheel | |
runs-on: ubuntu-latest | |
needs: build-linux | |
strategy: | |
matrix: | |
python-version: ['3.9','3.10', '3.11', '3.12'] | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: actions/download-artifact@v4 | |
with: | |
name: "distfiles" | |
path: ~/dist/ | |
- uses: actions/setup-python@v5 | |
with: | |
python-version: ${{ matrix.python-version }} | |
cache: 'pip' | |
- name: install wheel | |
run: | | |
pip install ~/dist/*whl | |
deeptools -h | |
- name: pytest | |
run: | | |
pip install pytest | |
pytest -v | |
build-osx: | |
name: Test on OSX | |
runs-on: macOS-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: actions/setup-python@v5 | |
with: | |
python-version: '3.12' | |
cache: 'pip' | |
- name: pip install | |
run: | | |
pip install .[actions] | |
- name: Test deepTools | |
run: | | |
pytest -v |