From faf2485280ac04efbfb66993acc79a693f45015c Mon Sep 17 00:00:00 2001 From: northwestwitch Date: Thu, 12 Nov 2020 10:52:40 +0100 Subject: [PATCH 1/5] switch from Travis CI to github actions - pytest and coveralls --- .github/workflows/docker_build_n_publish.yml | 20 ++++++++++++ .github/workflows/pytest_n_coveralls.yml | 32 ++++++++++++++++++++ .travis.yml | 29 ------------------ CHANGELOG.md | 2 ++ 4 files changed, 54 insertions(+), 29 deletions(-) create mode 100644 .github/workflows/docker_build_n_publish.yml create mode 100644 .github/workflows/pytest_n_coveralls.yml delete mode 100644 .travis.yml diff --git a/.github/workflows/docker_build_n_publish.yml b/.github/workflows/docker_build_n_publish.yml new file mode 100644 index 00000000..b8c85096 --- /dev/null +++ b/.github/workflows/docker_build_n_publish.yml @@ -0,0 +1,20 @@ +name: Publish to Docker Hub + +on: + release: + types: + - created +jobs: + docker-image-CI: + name: Docker Image CI + runs-on: ubuntu-latest + steps: + - name: Check out git repository + uses: actions/checkout@v2 + - name: Publish to Registry + uses: elgohr/Publish-Docker-Github-Action@master + with: + name: clinicalgenomics/chanjo + username: ${{ secrets.DOCKER_USERNAME }} + password: ${{ secrets.DOCKER_PASSWORD }} + tags: "latest,${{ github.event.release.tag_name }}" diff --git a/.github/workflows/pytest_n_coveralls.yml b/.github/workflows/pytest_n_coveralls.yml new file mode 100644 index 00000000..245cf75e --- /dev/null +++ b/.github/workflows/pytest_n_coveralls.yml @@ -0,0 +1,32 @@ +name: Tests and coverage +on: [pull_request] +jobs: + Pytest_Coveralls: + runs-on: frolvlad/alpine-miniconda3 + steps: + - uses: actions/checkout@v2 + - name: Set up Python + uses: actions/setup-python@master + with: + python-version: 3.7 #installed on this Linux distro + - name: Install required linux libs via conda + run: | + conda update -n base -c defaults conda + conda install -c bioconda sambamba \ + conda install -c conda-forge ruamel.yaml + - name: Install other libs using Alpine apk + run: | + apk update + apk --no-cache add bash python3 + - name: Install repo and its dependencies + run: | + pip install -r requirements.txt + pip install -r requirements-dev.txt + pip install -e . + pip install coveralls + - name: Run pytest and coveralls + run: | + pytest --cov=chanjo tests/ + coveralls + env: + GITHUB_TOKEN: ${{ github.token }} diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index cb9d5fd0..00000000 --- a/.travis.yml +++ /dev/null @@ -1,29 +0,0 @@ -language: python -sudo: false -python: - - '3.6' - -before_install: - - pip install --upgrade pip - -install: - - mkdir -p ./bin - - wget https://github.com/lomereiter/sambamba/releases/download/v0.5.8/sambamba_v0.5.8_linux.tar.bz2 - - tar xvjf sambamba_v0.5.8_linux.tar.bz2 - - mv sambamba_v0.5.8 ./bin/sambamba - - chmod +x ./bin/sambamba - - export PATH="${PATH}:${PWD}/bin" - - pip install six==1.12.0 - - pip install -r requirements.txt -r requirements-dev.txt . - -before_script: - - pip check - - git reset --soft ${TRAVIS_COMMIT_RANGE%...*} && git lint - -script: - - coverage run --source "$(basename "$PWD")" setup.py test - -after_success: coveralls - -notifications: - email: never diff --git a/CHANGELOG.md b/CHANGELOG.md index 0a0e9800..bb43882e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,8 @@ This project adheres to [Semantic Versioning](http://semver.org/). ### Added - User can pass on file with row separated gene IDs for coverage calculation - Dockerfile +- Added the Docker image build and push triggered by new releases +- Added githib action running pytest and coveralls ## [4.3.0] - 2020-02-05 From a832f5f35e18051ecc48e07403df694bff5a64e9 Mon Sep 17 00:00:00 2001 From: northwestwitch Date: Thu, 12 Nov 2020 11:07:47 +0100 Subject: [PATCH 2/5] run action on ubuntu latest --- .github/workflows/pytest_n_coveralls.yml | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/.github/workflows/pytest_n_coveralls.yml b/.github/workflows/pytest_n_coveralls.yml index 245cf75e..25e47e23 100644 --- a/.github/workflows/pytest_n_coveralls.yml +++ b/.github/workflows/pytest_n_coveralls.yml @@ -2,7 +2,7 @@ name: Tests and coverage on: [pull_request] jobs: Pytest_Coveralls: - runs-on: frolvlad/alpine-miniconda3 + runs-on: ubuntu-latest steps: - uses: actions/checkout@v2 - name: Set up Python @@ -12,12 +12,9 @@ jobs: - name: Install required linux libs via conda run: | conda update -n base -c defaults conda - conda install -c bioconda sambamba \ + conda install -c bioconda sambamba conda install -c conda-forge ruamel.yaml - - name: Install other libs using Alpine apk - run: | - apk update - apk --no-cache add bash python3 + conda install python3 - name: Install repo and its dependencies run: | pip install -r requirements.txt From f2f445fd858f681773f8db6b7c6dea488b6f1e38 Mon Sep 17 00:00:00 2001 From: northwestwitch Date: Thu, 12 Nov 2020 11:11:43 +0100 Subject: [PATCH 3/5] remove a command --- .github/workflows/pytest_n_coveralls.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/pytest_n_coveralls.yml b/.github/workflows/pytest_n_coveralls.yml index 25e47e23..f395cd82 100644 --- a/.github/workflows/pytest_n_coveralls.yml +++ b/.github/workflows/pytest_n_coveralls.yml @@ -14,7 +14,6 @@ jobs: conda update -n base -c defaults conda conda install -c bioconda sambamba conda install -c conda-forge ruamel.yaml - conda install python3 - name: Install repo and its dependencies run: | pip install -r requirements.txt From 32e494ad8e88abfc59808add1be50389b84043dd Mon Sep 17 00:00:00 2001 From: northwestwitch Date: Thu, 12 Nov 2020 11:17:35 +0100 Subject: [PATCH 4/5] install conda software into the base environment --- .github/workflows/pytest_n_coveralls.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/pytest_n_coveralls.yml b/.github/workflows/pytest_n_coveralls.yml index f395cd82..6b1c484c 100644 --- a/.github/workflows/pytest_n_coveralls.yml +++ b/.github/workflows/pytest_n_coveralls.yml @@ -11,9 +11,9 @@ jobs: python-version: 3.7 #installed on this Linux distro - name: Install required linux libs via conda run: | - conda update -n base -c defaults conda - conda install -c bioconda sambamba - conda install -c conda-forge ruamel.yaml + $CONDA/bin/conda update -n base -c defaults conda + $CONDA/bin/conda install -c bioconda sambamba + $CONDA/bin/conda install -c conda-forge ruamel.yaml - name: Install repo and its dependencies run: | pip install -r requirements.txt From f37b6d1c0df914aad407fb2973048aadbcc27d46 Mon Sep 17 00:00:00 2001 From: northwestwitch Date: Thu, 12 Nov 2020 11:34:16 +0100 Subject: [PATCH 5/5] simplify how sambamba is installed --- .github/workflows/pytest_n_coveralls.yml | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/.github/workflows/pytest_n_coveralls.yml b/.github/workflows/pytest_n_coveralls.yml index 6b1c484c..736da6d1 100644 --- a/.github/workflows/pytest_n_coveralls.yml +++ b/.github/workflows/pytest_n_coveralls.yml @@ -9,11 +9,9 @@ jobs: uses: actions/setup-python@master with: python-version: 3.7 #installed on this Linux distro - - name: Install required linux libs via conda + - name: Install Sambamba run: | - $CONDA/bin/conda update -n base -c defaults conda - $CONDA/bin/conda install -c bioconda sambamba - $CONDA/bin/conda install -c conda-forge ruamel.yaml + brew install brewsci/bio/sambamba - name: Install repo and its dependencies run: | pip install -r requirements.txt