Skip to content

Commit 1e30549

Browse files
Merge pull request #9 from IvanildoBarauna/feat-Devops
FEATURES-Devops
2 parents 712a303 + 54c4a34 commit 1e30549

File tree

14 files changed

+560
-38
lines changed

14 files changed

+560
-38
lines changed

.github/workflows/CD.yaml

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
name: Build, Version, and Publish Package
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
8+
jobs:
9+
build:
10+
runs-on: ubuntu-latest
11+
12+
steps:
13+
- name: Checkout code
14+
uses: actions/checkout@v2
15+
16+
- name: Set up Python
17+
uses: actions/setup-python@v2
18+
with:
19+
python-version: '3.9'
20+
21+
- name: Install Poetry
22+
run: |
23+
pip install --upgrade pip
24+
curl -sSL https://install.python-poetry.org | python3 -
25+
poetry config virtualenvs.create false
26+
poetry install
27+
28+
29+
- name: Increment version
30+
run: |
31+
poetry version patch # params: patch, minor, major
32+
git config --global user.name 'GitHub Actions'
33+
git config --global user.email '[email protected]'
34+
git commit -am "chore: Incremented version"
35+
git tag $(poetry version -s)
36+
git push origin --tags
37+
38+
- name: Build package
39+
run: poetry build
40+
41+
- name: Publish package to PyPI
42+
env:
43+
POETRY_PYPI_TOKEN_PYPI: ${{ secrets.PYPI_TOKEN }}
44+
run: poetry publish --username __token__ --password $POETRY_PYPI_TOKEN_PYPI
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: Tests and Builds
1+
name: Code Coverage
22

33
on:
44
pull_request:
@@ -23,14 +23,13 @@ jobs:
2323

2424
- name: Setup tests
2525
run: |
26-
python -m pip install --upgrade pip
26+
pip install --upgrade pip
27+
curl -sSL https://install.python-poetry.org | python3 -
28+
poetry config virtualenvs.create false
29+
poetry install
2730
2831
- name: Run tests & CodeCov
29-
run: |
30-
python -m venv .venv
31-
source .venv/bin/activate
32-
.venv/bin/python -m pip install --upgrade pip
33-
pip install -e .
32+
run: |
3433
coverage run -m pytest
3534
coverage report
3635
coverage xml
@@ -39,18 +38,4 @@ jobs:
3938
uses: codecov/[email protected]
4039
with:
4140
token: ${{ secrets.CODECOV_TOKEN }}
42-
files: ./coverage.xml
43-
44-
# build:
45-
# needs: test
46-
# if: github.actor != 'actions[bot]'
47-
# runs-on: ubuntu-latest
48-
# steps:
49-
# - uses: actions/checkout@v2
50-
# with:
51-
# ref: ${{ github.head_ref }}
52-
53-
# - name: Build and Run Image
54-
# run: |
55-
# docker build -t api-to-dataframe .
56-
# docker run api-to-dataframe
41+
files: ./coverage.xml

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -159,4 +159,5 @@ cython_debug/
159159
# be found at https://github.com/github/gitignore/blob/main/Global/JetBrains.gitignore
160160
# and can be added to the global gitignore or merged into this file. For a more nuclear
161161
# option (not recommended) you can uncomment the following to ignore the entire idea folder.
162+
162163
#.idea/

.idea/.gitignore

Lines changed: 3 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.idea/api-to-dataframe.iml

Lines changed: 14 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.idea/inspectionProfiles/profiles_settings.xml

Lines changed: 6 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.idea/misc.xml

Lines changed: 7 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.idea/modules.xml

Lines changed: 8 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.idea/vcs.xml

Lines changed: 6 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Dockerfile

Lines changed: 0 additions & 9 deletions
This file was deleted.

0 commit comments

Comments
 (0)