Skip to content

Merge pull request #47 from iKonoTelecomunicaciones/46-fix-tests #178

Merge pull request #47 from iKonoTelecomunicaciones/46-fix-tests

Merge pull request #47 from iKonoTelecomunicaciones/46-fix-tests #178

Workflow file for this run

name: Python lint and CI/CD
on: [push, pull_request]
jobs:
lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v4
with:
python-version: "3.10"
- uses: isort/isort-action@master
with:
sortPaths: "./menuflow"
- uses: psf/black@stable
with:
src: "./menuflow"
version: "22.3.0"
- name: pre-commit
run: |
pip install pre-commit
pre-commit run -av trailing-whitespace
pre-commit run -av end-of-file-fixer
pre-commit run -av check-yaml
pre-commit run -av check-added-large-files
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Set up Python 3.10
uses: actions/setup-python@v3
with:
python-version: "3.10"
- uses: actions/cache@v3
id: cache
with:
path: ~/.cache/pip
key: ${{ runner.os }}-pip-${{ hashFiles('**/requirements.*') }}
restore-keys: |
${{ runner.os }}-pip-
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -r requirements.txt -r requirements-dev.txt
- name: Run pytest
run: |
pytest -vv
docker:
if: "github.ref_name == 'main'"
runs-on: ubuntu-latest
needs: [lint, test]
environment: deploy
steps:
- name: Checkout code
uses: actions/checkout@v3
-
name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
-
name: Login to Docker Hub
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}
-
name: Build and push
uses: docker/build-push-action@v2
with:
context: .
file: ./Dockerfile
push: true
tags: bramenn/menuflow:latest