Skip to content

Commit

Permalink
ad ci/cd and test and deployment
Browse files Browse the repository at this point in the history
  • Loading branch information
Kamilcuk committed Nov 28, 2024
1 parent 977b312 commit be059b0
Show file tree
Hide file tree
Showing 11 changed files with 138 additions and 121 deletions.
1 change: 1 addition & 0 deletions .github/FUNDING.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
github: Kamilcuk
31 changes: 0 additions & 31 deletions .github/workflows/release.yml

This file was deleted.

27 changes: 0 additions & 27 deletions .github/workflows/test.yml

This file was deleted.

41 changes: 41 additions & 0 deletions .github/workflows/workflow.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
---
on:
- push
env:
PYTHONUNBUFFERED: 1
jobs:
test:
runs-on: ubuntu-latest
timeout-minutes: 5
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python }}
cache: 'pip'
cache-dependency-path: ./requirements*.txt
- run: pip install .
- run: pip install -r ./requirements-test.txt
- uses: jakebailey/pyright-action@v2
- run: pytest -sv

pypi-publish:
name: Upload release to PyPI
needs: [test]
if: github.event_name == 'push' && contains(github.ref, 'refs/tags/')
runs-on: ubuntu-latest
timeout-minutes: 5
environment:
name: pypi
url: https://pypi.org/p/L_bash_profile
permissions:
id-token: write # IMPORTANT: this permission is mandatory for trusted publishing
steps:
- name: checkout
uses: actions/checkout@v4
- name: install build python package
run: python -m pip install -U setuptools wheel build
- name: build the package
run: python -m build .
- name: Publish package distributions to PyPI
uses: pypa/gh-action-pypi-publish@release/v1
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,5 @@ venv/
# due to using nox and pytest
.nox
.cache

profile.*
6 changes: 4 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,13 @@ all:
echo
test:
pytest -sv
pyright:
basedpyright src
L_lib:
L_bash_profile profile profile.txt '. ../L_lib/bin/L_lib.sh test'
L_bash_profile profile -o profile.txt '. ../L_lib/bin/L_lib.sh test'
xdot:
L_bash_profile analyze profile.txt --dot profile.dot --dotlimit 3
xdot profile.dot
snakeviz:
L_bash_profile analyze profile.txt --pstatsfile profile.pstats
L_bash_profile analyze profile.txt --pstats profile.pstats
snakeviz profile.pstats
16 changes: 15 additions & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,20 @@ license = { file = "LICENSE.txt" }
keywords = ["bash", "profile", "development"]
authors = [{ name = "Kamil Cukrowski", email = "[email protected]" }]
maintainers = [{ name = "Kamil Cukrowski", email = "[email protected]" }]
dependencies = ["graphviz", "tabulate", "click", "clickdc"]
dynamic = ["dependencies", "optional-dependencies"]

[tool.setuptools.dynamic]
dependencies = {file = ["requirements.txt"]}
optional-dependencies = {test = { file = ["requirements-test.txt"] }}

[project.urls]
"Homepage" = "https://github.com/kamilcuk/L_bash_profile"
"Bug Reports" = "https://github.com/kamilcuk/L_bash_profile/issues"
"Source" = "https://github.com/kamilcuk/L_bash_profile/"

[project.scripts]
L_bash_profile = "L_bash_profile:cli.main"

[tool.pytest.ini_options]
minversion = "6.0"
addopts = "--tb=short"
Expand All @@ -28,3 +35,10 @@ filterwarnings = [
log_file_format = "%(asctime)s %(levelname)s %(filename)s:%(lineno)s %(message)s"
log_file_level = "DEBUG"

[tool.pyright]
include = ["src"]
pythonVersion = "3.7"
typeCheckingMode = "basic"
reportUnnecessaryComparison = "error"
reportUnusedParameter = false
reportUnknownParameterType = false
1 change: 1 addition & 0 deletions requirements-test.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
pytest
4 changes: 4 additions & 0 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
graphviz
tabulate
click
clickdc
Loading

0 comments on commit be059b0

Please sign in to comment.