diff --git a/.github/workflows/main.yml b/.github/workflows/Crunchy_CI.yml similarity index 59% rename from .github/workflows/main.yml rename to .github/workflows/Crunchy_CI.yml index f190c20..d0f6092 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/Crunchy_CI.yml @@ -1,8 +1,8 @@ -name: Build +name: Crunchy CI on: [push, pull_request] jobs: - build: + test-coverage: name: Test Crunchy (${{ matrix.python-version }}, ${{ matrix.os }}) runs-on: ubuntu-latest strategy: @@ -15,6 +15,11 @@ jobs: - name: Git checkout uses: actions/checkout@v2.5.0 + - name: Install and configure Poetry + uses: snok/install-poetry@v1 + with: + virtualenvs-create: false + - name: Get Conda uses: conda-incubator/setup-miniconda@v2.2.0 with: @@ -32,15 +37,16 @@ jobs: run: | conda install -c bioconda samtools - - name: Install dependencies - shell: bash -l {0} - run: | - python -m pip install --upgrade pip - python setup.py install + - name: Install Dependencies + run: poetry install - - name: Test with pytest - shell: bash -l {0} + - name: Unit tests and coverage run: | - pip install pytest - pip install pytest-mock - py.test -rxs tests/ \ No newline at end of file + poetry run pytest --cov=./ --cov-report xml --cov-report term + + - name: Upload coverage to Codecov + uses: codecov/codecov-action@v3.1.1 + with: + token: ${{ secrets.CODECOV_TOKEN }} + file: ./coverage.xml + flags: unittests \ No newline at end of file diff --git a/.github/workflows/build_and_publish_pypi.yml b/.github/workflows/build_and_publish_pypi.yml index a2c6070..10f578a 100644 --- a/.github/workflows/build_and_publish_pypi.yml +++ b/.github/workflows/build_and_publish_pypi.yml @@ -1,38 +1,34 @@ name: Publish to PyPI on: - release: - types: - - created + release: + types: + - created jobs: - build-n-publish: - name: Build and publish Python distribution to PyPI - runs-on: ubuntu-18.04 - steps: - - name: Check out git repository - uses: actions/checkout@v2.5.0 + build-n-publish: + name: Build and publish Python distribution to PyPI + runs-on: ubuntu-latest + steps: + - name: Check out git repository + uses: actions/checkout@v4.1.1 - - name: Set up Python - uses: actions/setup-python@v4.3.1 - with: - python-version: "3.10" + - name: Set up Python + uses: actions/setup-python@v5 + with: + python-version: "3.10" - - name: Install build tools - run: >- - python -m - pip install - wheel - twine - --user - - name: Build a binary wheel and a source tarball - run: >- - python - setup.py - sdist - bdist_wheel - - name: Publish distribution 📦 to PyPI - uses: pypa/gh-action-pypi-publish@v1.5.1 - with: - user: __token__ - password: ${{ secrets.pypi_password }} + - name: Install and configure Poetry + uses: snok/install-poetry@v1 + with: + virtualenvs-create: false + + - name: Build and Publish Distribution to PyPI 📦 + env: + PYPI_USERNAME: __token__ + PYPI_PASSWORD: ${{ secrets.pypi_password }} + POETRY_REQUESTS_TIMEOUT: 60 + run: | + poetry publish --no-interaction --build \ + --username $PYPI_USERNAME \ + --password $PYPI_PASSWORD diff --git a/.github/workflows/workflow-master.yaml b/.github/workflows/workflow-master.yaml deleted file mode 100644 index 4858b17..0000000 --- a/.github/workflows/workflow-master.yaml +++ /dev/null @@ -1,56 +0,0 @@ -name: Python Master Workflow -on: - push: - branches: - - 'master' - -jobs: - codecov: - name: Codecov Workflow - runs-on: ubuntu-latest - strategy: - matrix: - python-version: ["3.10"] - - steps: - - - name: Git checkout - uses: actions/checkout@v2.5.0 - - - name: Get Conda - uses: conda-incubator/setup-miniconda@v2.2.0 - with: - auto-update-conda: true - python-version: ${{ matrix.python-version }} - - # Need to add shell to make conda environments work - - name: Install spring - shell: bash -l {0} - run: | - conda install -c bioconda spring - - - name: Install samtools - shell: bash -l {0} - run: | - conda install -c bioconda samtools - - - name: Install dependencies - shell: bash -l {0} - run: | - python -m pip install --upgrade pip - python setup.py install - - - name: Generate coverage report - shell: bash -l {0} - run: | - pip install pytest - pip install pytest-cov - pip install pytest-mock - pytest --cov=./ --cov-report xml --cov-report term - - - name: Upload coverage to Codecov - uses: codecov/codecov-action@v1 - with: - token: ${{ secrets.CODECOV_TOKEN }} - file: ./coverage.xml - flags: unittests