Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Configure pipelines (build, test, lint, docs) #39

Open
wants to merge 23 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
23 commits
Select commit Hold shift + click to select a range
b174f3a
feat: create Dockerfile with specific environments configurations
luis-furtado Jun 27, 2023
40bd8fb
refactor: improving code
luis-furtado Jun 27, 2023
a9b9b41
feat: create github action and respective logics to build latest imag…
luis-furtado Jun 27, 2023
0ade811
fix: add configure-pipe branch to run pipeline
luis-furtado Jun 27, 2023
31bb98c
fix: changing local to github actions file
luis-furtado Jun 27, 2023
6723494
fix: update pipe environment names
luis-furtado Jun 27, 2023
0af1d50
fix: change dockerhub username github to push docker image
luis-furtado Jun 27, 2023
fb17ad8
feat: configuring sphinx, generating documenationn build configuratio…
luis-furtado Jun 27, 2023
b4c8766
fix: change directory to docs files
luis-furtado Jun 27, 2023
b876bfb
fix: clone Makefile inside of Sphinx doc
luis-furtado Jun 27, 2023
a6b9222
add make.bat file for doc
luis-furtado Jun 27, 2023
0db4773
fix: change sourcedir of makefile
luis-furtado Jun 27, 2023
c6cd936
refactor: improving code
luis-furtado Jun 27, 2023
cd97d77
add build directory to generate doc
luis-furtado Jun 27, 2023
f43bf96
feat: create unit test pipeline
luis-furtado Jun 27, 2023
32ee387
fix: update unit test pipeline
luis-furtado Jun 27, 2023
06cfc68
fix: sudo in apt get
luis-furtado Jun 27, 2023
12e296a
feat: first test
luis-furtado Jun 27, 2023
9bf6969
fix: adjust directory of html build documentation
luis-furtado Jun 27, 2023
2029f97
fix: sphinx generation doc
luis-furtado Jun 27, 2023
4337601
fix: improving code
luis-furtado Jun 27, 2023
eba204b
feat: add lint pipe
luis-furtado Jun 27, 2023
03caf58
fix: change to run pipes on all branches
luis-furtado Jun 29, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 28 additions & 0 deletions .github/workflows/build-push-image.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
name: Build and Push Docker Image
on:
push:
branches:
- '*'

env:
DOCKERHUB_USERNAME: ${{ secrets.DOCKERHUB_USERNAME }}
DOCKERHUB_TOKEN: ${{ secrets.DOCKERHUB_TOKEN }}

jobs:
build-and-push:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: Login to Docker Hub
uses: docker/login-action@v1
with:
username: ${{ env.DOCKERHUB_USERNAME }}
password: ${{ env.DOCKERHUB_TOKEN }}
- name: Build Docker image
run: |
docker build -t bark:latest .
- name: Push Docker image
run: |
docker tag bark:latest ${{ env.DOCKERHUB_USERNAME }}/bark:latest
docker push ${{ env.DOCKERHUB_USERNAME }}/bark:latest
18 changes: 18 additions & 0 deletions .github/workflows/generate-sphinx-doc.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
name: Docs Build And Check
on:
push:
branches:
- '*'

jobs:
docs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
- uses: ammaraskar/sphinx-action@master
with:
docs-folder: "docs/"
- uses: actions/upload-artifact@v1
with:
name: DocumentationHTML
path: docs/build/html/
18 changes: 18 additions & 0 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
name: Python Linter
on:
push:
branches:
- '*'

jobs:
docs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Python Linter
uses: sunnysid3up/python-linter@master
with:
source: "bark"
mypy-options: "--ignore-missing-imports --show-error-codes"
pylint-options: "--rcfile=setup.cfg"
isort-options: "-w 100"
25 changes: 25 additions & 0 deletions .github/workflows/unit-test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
name: Unit Test
on:
push:
branches:
- '*'

jobs:
docs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: '3.11.3'
- name: Install dependencies
run: |
sudo apt update -y
sudo apt install -y python3-pip

pip3 install .
pip3 install -e '.[dev]'
- name: Test with pytest
run: |
pytest
25 changes: 25 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
# Copyright (c) Meta, Inc. and its affiliates.
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
FROM ubuntu:22.04

# Installing the required packages
RUN apt update -y
RUN apt install -y git curl
RUN apt install -y python3-pip

WORKDIR /root

COPY . .

# Download the Bark Github repo
RUN git clone https://github.com/luis-furtado/bark-with-voice-clone.git ~/app

RUN cd ~/app

# Install dependencies and dev dependencies to run tests
RUN cd ~/app && \
pip3 install . && \
pip3 install -e '.[dev]'

CMD ["python3", "setup.py", "--help"]
5 changes: 5 additions & 0 deletions bark/test_sample.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
def func(x):
return x + 1

def test_answer():
assert func(4) == 5
Empty file added build/html/.gitkeep
Empty file.
20 changes: 20 additions & 0 deletions docs/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# Minimal makefile for Sphinx documentation
#

# You can set these variables from the command line, and also
# from the environment for the first two.
SPHINXOPTS ?=
SPHINXBUILD ?= sphinx-build
SOURCEDIR = .
BUILDDIR = build

# Put it first so that "make" without argument is like "make help".
help:
@$(SPHINXBUILD) -M help "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)

.PHONY: help Makefile

# Catch-all target: route all unknown targets to Sphinx using the new
# "make mode" option. $(O) is meant as a shortcut for $(SPHINXOPTS).
%: Makefile
@$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)
45 changes: 45 additions & 0 deletions docs/bark.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
bark package
============

Submodules
----------

bark.api module
---------------

.. automodule:: bark.api
:members:
:undoc-members:
:show-inheritance:

bark.generation module
----------------------

.. automodule:: bark.generation
:members:
:undoc-members:
:show-inheritance:

bark.model module
-----------------

.. automodule:: bark.model
:members:
:undoc-members:
:show-inheritance:

bark.model\_fine module
-----------------------

.. automodule:: bark.model_fine
:members:
:undoc-members:
:show-inheritance:

Module contents
---------------

.. automodule:: bark
:members:
:undoc-members:
:show-inheritance:
Binary file added docs/build/doctrees/bark.doctree
Binary file not shown.
Binary file added docs/build/doctrees/environment.pickle
Binary file not shown.
Binary file added docs/build/doctrees/index.doctree
Binary file not shown.
Binary file added docs/build/doctrees/modules.doctree
Binary file not shown.
4 changes: 4 additions & 0 deletions docs/build/html/.buildinfo
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# Sphinx build info version 1
# This file hashes the configuration used when building these files. When it is not found, a full rebuild will be done.
config: 3c3a45f7380646673145bdabaed7ce09
tags: 645f666f9bcd5a90fca523b33c5a78b7
45 changes: 45 additions & 0 deletions docs/build/html/_sources/bark.rst.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
bark package
============

Submodules
----------

bark.api module
---------------

.. automodule:: bark.api
:members:
:undoc-members:
:show-inheritance:

bark.generation module
----------------------

.. automodule:: bark.generation
:members:
:undoc-members:
:show-inheritance:

bark.model module
-----------------

.. automodule:: bark.model
:members:
:undoc-members:
:show-inheritance:

bark.model\_fine module
-----------------------

.. automodule:: bark.model_fine
:members:
:undoc-members:
:show-inheritance:

Module contents
---------------

.. automodule:: bark
:members:
:undoc-members:
:show-inheritance:
20 changes: 20 additions & 0 deletions docs/build/html/_sources/index.rst.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
.. Bark documentation master file, created by
sphinx-quickstart on Tue Jun 27 10:35:37 2023.
You can adapt this file completely to your liking, but it should at least
contain the root `toctree` directive.

Welcome to Bark's documentation!
================================

.. toctree::
:maxdepth: 2
:caption: Contents:



Indices and tables
==================

* :ref:`genindex`
* :ref:`modindex`
* :ref:`search`
7 changes: 7 additions & 0 deletions docs/build/html/_sources/modules.rst.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
bark
====

.. toctree::
:maxdepth: 4

bark
Loading