Merge pull request #318 from Steinbeck-Lab/dev-nisha #219
This file contains 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 worklflow will perform following actions when the code is pushed to development branch: | |
# - Test linting with pylint. | |
# - Fetch Latest release. | |
# - Build the latest docker image in development which needs test to pass first. | |
# - Push the docker image to Github Artifact Registry-Dev. | |
# | |
# Maintainers: | |
# - name: Nisha Sharma | |
# - email: nisha.sharma@uni-jena.de | |
name : Dev Build, Test and Publish | |
on: | |
push: | |
branches: [development] | |
env: | |
DOCKER_HUB_USERNAME : ${{ secrets.DOCKER_USERNAME }} | |
DOCKER_HUB_PASSWORD : ${{ secrets.DOCKER_PASSWORD }} | |
REPOSITORY_NAME: cheminformatics-python-microservice | |
REPOSITORY_NAMESPACE: caffeinejena | |
jobs: | |
test: | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
python-version: ["3.10"] | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Set up Python ${{ matrix.python-version }} | |
uses: actions/setup-python@v3 | |
with: | |
python-version: ${{ matrix.python-version }} | |
- name: Install dependencies | |
run: | | |
python -m pip install --upgrade pip | |
pip3 install --upgrade setuptools pip | |
pip3 install --no-cache-dir -r requirements.txt | |
pip3 install rdkit | |
python3 -m pip uninstall -y imantics | |
pip3 install imantics==0.1.12 | |
pip3 install openbabel-wheel | |
pip3 install --no-deps decimer-segmentation | |
pip3 install --no-deps decimer>=2.2.0 | |
pip3 install --no-deps STOUT-pypi>=2.0.5 | |
pip install flake8 pytest | |
- name: Analysing the code with pylint | |
run: | | |
flake8 --per-file-ignores="__init__.py:F401" --ignore E402,E501,W503 $(git ls-files '*.py') . | |
- name: Run test | |
run: | | |
python3 -m pytest -p no:warnings | |
push_to_registry: | |
name: Push Docker image to Docker Hub | |
runs-on: ubuntu-latest | |
needs: test | |
steps: | |
- name: Check out the repo | |
uses: actions/checkout@v3 | |
- name: Log in to Docker Hub | |
uses: docker/login-action@f4ef78c080cd8ba55a85445d5b36e214a81df20a | |
with: | |
username: ${{ env.DOCKER_HUB_USERNAME }} | |
password: ${{ env.DOCKER_HUB_PASSWORD }} | |
- name: Build and push Docker image | |
uses: docker/build-push-action@v4 | |
with: | |
context: . | |
file: ./Dockerfile | |
push: true | |
build-args: | | |
RELEASE_VERSION=dev-latest | |
tags: ${{ env.REPOSITORY_NAMESPACE }}/${{ env.REPOSITORY_NAME }}:dev-latest | |
username: ${{ env.DOCKER_HUB_USERNAME }} | |
password: ${{ env.DOCKER_HUB_PASSWORD }} |