update github workflow, version bump #282
This file contains hidden or 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
| # This workflow will install Python dependencies, run tests and lint with a variety of Python versions | |
| # For more information see: https://help.github.com/actions/language-and-framework-guides/using-python-with-github-actions | |
| name: build | |
| on: | |
| push: | |
| branches: | |
| - master | |
| - 0.1.0 | |
| tags: | |
| - '*' | |
| pull_request: | |
| branches: [ master ] | |
| jobs: | |
| build: | |
| runs-on: ubuntu-22.04 | |
| strategy: | |
| matrix: | |
| python-version: [3.12] | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Set up Python ${{ matrix.python-version }} | |
| uses: actions/setup-python@v5 | |
| with: | |
| python-version: ${{ matrix.python-version }} | |
| - name: Install metaeuk | |
| run: | | |
| wget https://mmseqs.com/metaeuk/metaeuk-linux-avx2.tar.gz | |
| tar -xzf metaeuk-linux-avx2.tar.gz | |
| sudo install -m 755 metaeuk/bin/metaeuk /usr/local/bin/metaeuk | |
| - name: Install miniprot | |
| run: | | |
| git clone --depth 1 https://github.com/lh3/miniprot | |
| make -C miniprot | |
| sudo install -m 755 miniprot/miniprot /usr/local/bin/miniprot | |
| - name: Install augustus | |
| run: | | |
| sudo apt-get update | |
| sudo apt-get install -y \ | |
| build-essential \ | |
| zlib1g-dev \ | |
| libgsl-dev \ | |
| libboost-all-dev \ | |
| liblpsolve55-dev \ | |
| libmysql++-dev \ | |
| libmysqlclient-dev \ | |
| libbamtools-dev \ | |
| libhts-dev | |
| git clone --depth 1 https://github.com/Gaius-Augustus/Augustus.git | |
| make -C Augustus clean | |
| make -C Augustus \ | |
| MYSQL=0 \ | |
| SQLITE=0 \ | |
| COMPGENEPRED=1 | |
| sudo make -C Augustus install | |
| echo "$GITHUB_WORKSPACE/Augustus/scripts" >> $GITHUB_PATH | |
| - name: Install python dependencies | |
| run: | | |
| python -m pip install --upgrade pip | |
| python -m pip install flake8 pytest wheel | |
| if [ -f requirements.txt ]; then pip install -r requirements.txt; fi | |
| - name: Lint with flake8 | |
| run: | | |
| # stop the build if there are Python syntax errors or undefined names | |
| flake8 . --exclude=Augustus --count --select=E9,F63,F7,F82 --show-source --statistics | |
| # exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide | |
| flake8 . --exclude=Augustus --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics | |
| - name: Test | |
| run: | | |
| pwd | |
| python -m pip install . | |
| sudo apt-get update | |
| path=$(fdog.setup -d ./ --getSourcepath); xargs -a $path/data/dependencies.txt sudo apt-get install -y -qq | |
| echo "######### current dir #########" | |
| pwd | |
| ls | |
| bash scripts/run_tests.sh | |
| conda-test: | |
| runs-on: ubuntu-22.04 | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Setup micromamba | |
| uses: mamba-org/setup-micromamba@v3 | |
| with: | |
| environment-name: fdog-env | |
| create-args: >- | |
| python=3.12 pip | |
| cache-environment: true | |
| cache-downloads: true | |
| init-shell: bash | |
| - name: Run tests (conda env) | |
| shell: bash -l {0} | |
| run: | | |
| python -m pip install . | |
| bash scripts/run_tests.sh | |
| deploy: | |
| needs: [build, conda-test] | |
| runs-on: ubuntu-22.04 | |
| if: startsWith(github.event.ref, 'refs/tags') | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Set up Python | |
| uses: actions/setup-python@v5 | |
| with: | |
| python-version: "3.12" | |
| - name: Install build tools | |
| run: | | |
| python -m pip install --upgrade pip | |
| python -m pip install build | |
| - name: Build distribution packages | |
| run: python -m build | |
| - name: Publish to PyPI | |
| uses: pypa/gh-action-pypi-publish@release/v1 | |
| with: | |
| password: ${{ secrets.pypi }} |