Skip to content

Commit

Permalink
CI: Add CI
Browse files Browse the repository at this point in the history
  • Loading branch information
ChristosMatzoros committed Jul 10, 2024
1 parent 8972d77 commit 885287f
Show file tree
Hide file tree
Showing 4 changed files with 144 additions and 0 deletions.
33 changes: 33 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
name: CI
on:
pull_request:
branches: ["main"]
push:
branches: ["main"]

jobs:
ci:
uses: qiime2/distributions/.github/workflows/lib-ci-dev.yaml@dev
with:
distro: metagenome
additional-reports-path: ./coverage.xml
additional-reports-name: coverage

coverage:
needs: [ci]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

- uses: actions/download-artifact@v3
name: 'Fetch coverage from builds'
with:
name: ${{ needs.ci.outputs.additional-reports-name }}
path: ${{ needs.ci.outputs.additional-reports-path }}

- uses: codecov/codecov-action@v4
name: 'Upload coverage'
with:
fail_ci_if_error: true
env:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
43 changes: 43 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v2.3.0
hooks:
- id: end-of-file-fixer
- id: trailing-whitespace
- id: check-merge-conflict
- repo: https://github.com/PyCQA/isort
rev: 5.12.0
hooks:
- id: isort
files: ^(.+)(?<!\_version)\.py$
args: ["--profile", "black"]
- repo: https://github.com/psf/black
rev: 22.3.0
hooks:
- id: black
args:
- --safe
- --quiet
files: ^(.+)(?<!\_version)\.py$
- repo: https://github.com/PyCQA/flake8
rev: 4.0.1
hooks:
- id: flake8
additional_dependencies:
- pycodestyle==2.8.0
- pyflakes==2.4.0
- pydocstyle==6.1.1
- flake8-comprehensions==3.8.0
- flake8-noqa==1.2.1
- mccabe==0.6.1
files: ^(.+)(?<!\_version)\.py$
- repo: local
hooks:
- id: q2lint
name: q2lint
language: python
pass_filenames: false
entry: q2lint
stages: [ commit ]
additional_dependencies:
- https://github.com/qiime2/q2lint/archive/master.zip
29 changes: 29 additions & 0 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
BSD 3-Clause License

Copyright (c) 2024, Christos Matzoros.
All rights reserved.

Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:

* Redistributions of source code must retain the above copyright notice, this
list of conditions and the following disclaimer.

* Redistributions in binary form must reproduce the above copyright notice,
this list of conditions and the following disclaimer in the documentation
and/or other materials provided with the distribution.

* Neither the name of the copyright holder nor the names of its
contributors may be used to endorse or promote products derived from
this software without specific prior written permission.

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
39 changes: 39 additions & 0 deletions ci/recipe/meta.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
{% set data = load_setup_py_data() %}
{% set version = data.get('version') or 'placehold' %}

package:
name: q2-viromics
version: {{ version }}

source:
path: ../..

build:
script: make install

requirements:
host:
- python {{ python }}
- setuptools

run:
- python {{ python }}
- qiime2 {{ qiime2_epoch }}.*
- q2-types {{ qiime2_epoch }}.*
- checkv
- pyhmmer

test:
requires:
- coverage
- pytest-cov
imports:
- q2_viromics
- qiime2.plugins.viromics
commands:
- pytest --cov q2_viromics --cov-report xml:coverage.xml --pyargs q2_viromics

about:
home: https://github.com/bokulich-lab/q2-viromics
license: BSD-3-Clause
license_family: BSD

0 comments on commit 885287f

Please sign in to comment.