Skip to content

makefile

makefile #4

Workflow file for this run

name: lens-translation CI/CD
on:
push:
pull_request:
branches:
- master
paths-ignore:
- "*.md"
jobs:
Lint:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Set up Python 3.11.9
uses: actions/setup-python@v5
with:
python-version: "3.11.9"
- name: Install flake8
run: |
python -m pip install --upgrade pip
pip install flake8==7.1.1
pip install flake8_black==0.3.6
- name: Lint with flake8
run: |
flake8 --max-line-length=119 --ignore=E722,I201,I100,BLK100,W503 --per-file-ignores=__init__.py:F401 lens/app/*.py
flake8 --max-line-length=119 --ignore=E722,I201,I100,BLK100,W503 --per-file-ignores=__init__.py:F401 trans-app/app/*.py
flake8 --max-line-length=119 --ignore=E722,I201,I100,BLK100,W503 --per-file-ignores=__init__.py:F401 ocr-app/app/*.py
Unit-test:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Set up Python 3.10.12
uses: actions/setup-python@v5
with:
python-version: "3.10.12"
- name: Install libraries
run: |
python -m pip install --upgrade pip
pip install pytest==8.3.3
pip install pytest-asyncio==0.24.0
pip install numpy==1.23.1
pip install Pillow==9.5.0
- name: Run unit tests
run: |
export PYTHONPATH=$PYTHONPATH:$(pwd)
pytest unittests/test_draw_fct.py
Build-Docker-Image:
runs-on: ubuntu-latest
needs: [Lint, Unit-test]
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Log in to Docker Hub
uses: docker/login-action@f4ef78c080cd8ba55a85445d5b36e214a81df20a
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Build and Push Lens Docker Image
uses: docker/build-push-action@v6
with:
context: ./lens
file: ./lens/Dockerfile
tags: anhtu293/lens-app:latest
push: true
- name: Build and Push OCR Docker Image
uses: docker/build-push-action@v6
with:
context: ./ocr-app
file: ./ocr-app/Dockerfile
tags: anhtu293/ocr-app:latest
push: true
- name: Build and Push Translation Docker Image
uses: docker/build-push-action@v6
with:
context: ./trans-app
file: ./trans-app/Dockerfile
tags: anhtu293/trans-app:latest
push: true