-
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #56 from IvanildoBarauna/main
Update Branch
- Loading branch information
Showing
36 changed files
with
1,478 additions
and
10,409 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,9 @@ | ||
# Arquivo .gitattributes | ||
|
||
# Permite a detecção linguística apenas para células de código | ||
*.ipynb linguist-language=Python | ||
*.html linguist-language=Jupyter Notebook | ||
# *.ipynb linguist-language=Python | ||
*.html linguist-language=Python | ||
|
||
# Indica que apenas as células de código devem ser detectadas | ||
*.ipynb.diff linguist-language=Python | ||
*.ipynb.merge linguist-language=Python | ||
# # Indica que apenas as células de código devem ser detectadas | ||
*.ipynb.diff linguist-language=Jupyter Notebook | ||
*.ipynb.merge linguist-language=Jupyter Notebook |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,82 +5,78 @@ on: | |
branches: | ||
- main | ||
paths-ignore: | ||
- '**/README.md' | ||
- '**/CONTRIBUTING.md' | ||
- '**/CODE_OF_CONDUCT.md' | ||
- '.github/**' | ||
- 'docs/**' | ||
- '**/.editorconfig' | ||
- '**/.gitignore' | ||
- '**/LICENSE' | ||
- '**/CREDITS' | ||
- "**/README.md" | ||
- "**/CONTRIBUTING.md" | ||
- "**/CODE_OF_CONDUCT.md" | ||
- ".github/**" | ||
- "docs/**" | ||
- "**/.editorconfig" | ||
- "**/.gitignore" | ||
- "**/LICENSE" | ||
- "**/CREDITS" | ||
|
||
workflow_dispatch: | ||
|
||
jobs: | ||
test: | ||
if: github.actor != 'actions[bot]' | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v2 | ||
with: | ||
ref: ${{ github.head_ref }} | ||
|
||
- name: Set up Python 3.9 | ||
uses: actions/setup-python@v2 | ||
with: | ||
python-version: 3.9 | ||
|
||
- name: Install dependencies | ||
run: | | ||
python -m pip install --upgrade pip | ||
pip install -r requirements.txt | ||
# Gerar o arquivo .env | ||
echo "SERVER_URL=https://economia.awesomeapi.com.br" > .env | ||
- name: Run tests | ||
run: pytest | ||
- uses: actions/checkout@v2 | ||
with: | ||
ref: ${{ github.head_ref }} | ||
|
||
- name: Set up Python 3.9 | ||
uses: actions/setup-python@v2 | ||
with: | ||
python-version: 3.9 | ||
|
||
- name: Install and Run Tests | ||
run: | | ||
python -m pip install --upgrade pip | ||
python -m pip install poetry | ||
poetry install | ||
poetry run pytest | ||
build: | ||
needs: test | ||
if: github.actor != 'actions[bot]' | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v2 | ||
with: | ||
ref: ${{ github.head_ref }} | ||
|
||
- name: Build Docker Image using Dockerfile | ||
run: | | ||
docker build -t etl-awesome-api . | ||
- name: Run Docker Image using Dockerfile | ||
run: | | ||
docker run etl-awesome-api | ||
- name: Build Docker Image using Docker Compose | ||
run: | | ||
docker-compose up --build -d | ||
- name: Run Docker image using Docker Compose | ||
run: | | ||
docker run etl-awesome-api-compose | ||
- name: Run Application using Python Native | ||
run: | | ||
python -m venv .venv | ||
source .venv/bin/activate | ||
.venv/bin/python -m pip install --upgrade pip | ||
echo "SERVER_URL=https://economia.awesomeapi.com.br" > .env | ||
pip install -e . | ||
python etl/main.py | ||
- name: Run Application using Poetry | ||
run: | | ||
pip install poetry | ||
poetry install | ||
poetry run python etl/main.py | ||
- uses: actions/checkout@v2 | ||
with: | ||
ref: ${{ github.head_ref }} | ||
|
||
- name: Build Docker Image using Dockerfile | ||
run: | | ||
docker build -t etl-awesome-api . | ||
- name: Run Docker Image using Dockerfile | ||
run: | | ||
docker run etl-awesome-api | ||
- name: Build Docker Image using Docker Compose | ||
run: | | ||
docker-compose up --build -d | ||
- name: Run Docker image using Docker Compose | ||
run: | | ||
docker run etl-awesome-api-compose | ||
- name: Run Application using Python Native | ||
run: | | ||
python -m venv .venv | ||
source .venv/bin/activate | ||
.venv/bin/python -m pip install --upgrade pip | ||
pip install -e . | ||
python etl/run.py | ||
- name: Run Application using Poetry | ||
run: | | ||
pip install poetry | ||
poetry install | ||
poetry run python etl/run.py | ||
deploy: | ||
needs: build | ||
if: github.actor != 'actions[bot]' | ||
|
@@ -97,20 +93,21 @@ jobs: | |
- name: Set up Python | ||
uses: actions/setup-python@v2 | ||
with: | ||
python-version: '3.9' | ||
python-version: "3.9" | ||
|
||
- name: Install Jupyter | ||
run: pip install notebook | ||
|
||
- name: Convert notebook to HTML | ||
run: | | ||
jupyter nbconvert --to html notebooks/data_explorer.ipynb --output-dir=views --output=index | ||
jupyter nbconvert --to html notebooks/data_explorer.ipynb --output-dir=docs --output=index | ||
jupyter nbconvert --to html notebooks/data_explorer.ipynb --output-dir=etl/views --output=index | ||
- name: Setup Git | ||
run: | | ||
git config --global user.name 'GitHub Actions' | ||
git config --global user.email '[email protected]' | ||
- name: Commit and Push Notebook | ||
run: | | ||
git add . | ||
|
@@ -119,4 +116,4 @@ jobs: | |
else | ||
git commit -m "Add generated HTML to README" | ||
git push | ||
fi | ||
fi |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -165,3 +165,5 @@ cython_debug/ | |
poetry.lock | ||
etl/common/logs/* | ||
|
||
*.DS_Store | ||
|
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,16 +1,8 @@ | ||
{ | ||
"python.testing.pytestArgs": [ | ||
"tests" | ||
], | ||
"python.testing.unittestEnabled": false, | ||
"python.testing.pytestEnabled": true, | ||
"python.testing.unittestArgs": [ | ||
"-v", | ||
"-s", | ||
"./tests", | ||
"-p", | ||
"test_*.py" | ||
], | ||
"python.analysis.autoImportCompletions": true, | ||
"python.analysis.typeCheckingMode": "basic" | ||
} | ||
"python.testing.pytestArgs": ["."], | ||
"python.testing.unittestEnabled": false, | ||
"python.testing.pytestEnabled": true, | ||
"python.testing.unittestArgs": ["-v", "-s", "./tests", "-p", "test_*.py"], | ||
"python.analysis.autoImportCompletions": true, | ||
"python.analysis.typeCheckingMode": "basic" | ||
} |
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 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
Oops, something went wrong.