diff --git a/.github/workflows/cwl-tests.yml b/.github/workflows/cwl-tests.yml new file mode 100644 index 0000000..7f33555 --- /dev/null +++ b/.github/workflows/cwl-tests.yml @@ -0,0 +1,25 @@ +name: CWL wrapper tests +# This workflow is triggered on pushes and PRs to the repository. +on: [push, pull_request] + +jobs: + CwlTests: + + runs-on: ubuntu-latest + + steps: + - name: Check out source-code repository + uses: actions/checkout@v2 + with: + submodules: true + + - name: Set up Python 3.8 + uses: actions/setup-python@v2 + with: + python-version: 3.8 + + - name: Install cwltool + run: pip install cwltool + + - name: CWL definition test + run: cwltool bionitio.cwl --fasta_file functional_tests/test_data/two_sequence.fasta diff --git a/.github/workflows/docker.yml b/.github/workflows/docker.yml new file mode 100644 index 0000000..9444f3d --- /dev/null +++ b/.github/workflows/docker.yml @@ -0,0 +1,24 @@ +name: Docker Image +# This workflow is triggered on pushes and package releases. +on: [push, published] + +jobs: + BuildPushDocker: + + runs-on: ubuntu-latest + + steps: + - name: Check out source-code repository + uses: actions/checkout@v2 + + - name: Push Docker image to GitHub Packages + uses: docker/build-push-action@v1 + with: + username: ${{ github.actor }} + password: ${{ secrets.GITHUB_TOKEN }} + registry: docker.pkg.github.com + repository: ${{github.repository}}/bionitio + tag_with_ref: true + + - name: Functional Docker tests + run: docker run bionitio --entrypoint /bionitio/functional_tests/bionitio-test.sh -p bionitio -d /bionitio/functional_tests/test_data -v diff --git a/.github/workflows/functional-tests.yml b/.github/workflows/functional-tests.yml new file mode 100644 index 0000000..002c11e --- /dev/null +++ b/.github/workflows/functional-tests.yml @@ -0,0 +1,27 @@ +name: Functional tests +# This workflow is triggered on pushes and PRs to the repository. +on: [push, pull_request] + +jobs: + FuncTests: + + runs-on: ubuntu-latest + + steps: + - name: Check out source-code repository + uses: actions/checkout@v2 + with: + submodules: true + + - name: Set up Python 3.8 + uses: actions/setup-python@v2 + with: + python-version: 3.8 + + - name: Install python dependencies + run: | + pip install -r requirements-dev.txt + pip install . + + - name: Run functional tests + run: functional_tests/bionitio-test.sh diff --git a/.github/workflows/unit-tests.yml b/.github/workflows/unit-tests.yml new file mode 100644 index 0000000..978a175 --- /dev/null +++ b/.github/workflows/unit-tests.yml @@ -0,0 +1,31 @@ +name: Unit tests +# This workflow is triggered on pushes and PRs to the repository. +on: [push, pull_request] + +jobs: + PythonTests: + + runs-on: ubuntu-latest + strategy: + matrix: + python-version: [3.6, 3.7, 3.8] + + steps: + - name: Check out source-code repository + uses: actions/checkout@v2 + + - name: Set up Python ${{ matrix.python-version }} + uses: actions/setup-python@v2 + with: + python-version: ${{ matrix.python-version }} + + - name: Install python dependencies + run: | + pip install -r requirements-dev.txt + pip install . + + - name: Run unit tests + run: python bionitio/bionitio_test.py + + - name: Check program style + run: pylint -E bionitio/*.py diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index 4e3cb73..0000000 --- a/.travis.yml +++ /dev/null @@ -1,21 +0,0 @@ -sudo: true -dist: xenial -services: - - docker -language: python -python: - - "3.5" - -before_install: - - pip3 install cwltool - - docker build -t bionitio . - -script: - # Both of these same tests, in Docker - # Functional tests - - docker run --entrypoint /bionitio/.travis/unit-test.sh bionitio - # Unit tests - - docker run --entrypoint /bionitio/functional_tests/bionitio-test.sh bionitio -p bionitio -d /bionitio/functional_tests/test_data -v - - # CWL definition test - - cwltool bionitio.cwl --fasta_file functional_tests/test_data/two_sequence.fasta diff --git a/.travis/install-dependencies.sh b/.travis/install-dependencies.sh deleted file mode 100755 index bef6e6c..0000000 --- a/.travis/install-dependencies.sh +++ /dev/null @@ -1,9 +0,0 @@ -#!/bin/sh - -# Install Python dependencies - -echo 'Python install' -( - pip install -r requirements-dev.txt - pip install . -) diff --git a/.travis/unit-test.sh b/.travis/unit-test.sh deleted file mode 100755 index 26a72f8..0000000 --- a/.travis/unit-test.sh +++ /dev/null @@ -1,23 +0,0 @@ -#!/bin/bash - -set -e -errors=0 - -# Run unit tests -python bionitio/bionitio_test.py || { - echo "'python python/bionitio/bionitio_test.py' failed" - let errors+=1 -} - -# Check program style -pylint -E bionitio/*.py || { - echo 'pylint -E bionitio/*.py failed' - let errors+=1 -} - -[ "$errors" -gt 0 ] && { - echo "There were $errors errors found" - exit 1 -} - -echo "Ok : Python specific tests"