-
Notifications
You must be signed in to change notification settings - Fork 0
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 #1 from hari0205/ci
Added CI Workflow
- Loading branch information
Showing
6 changed files
with
168 additions
and
4 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 |
---|---|---|
@@ -0,0 +1,14 @@ | ||
[flake8] | ||
max-line-length = 88 | ||
exclude = | ||
.git, | ||
__pycache__, | ||
.venv, | ||
build, | ||
dist, | ||
Makefile | ||
ignore = | ||
E203, | ||
E266, | ||
E501, | ||
W503 |
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 |
---|---|---|
@@ -0,0 +1,69 @@ | ||
name: "Porunga-CI" | ||
|
||
on: | ||
push: | ||
branches: | ||
- main | ||
pull_request: | ||
branches: | ||
- main | ||
|
||
jobs: | ||
lint_build_publish: | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: "Checkout Code" | ||
uses: actions/checkout@v3 | ||
|
||
- name: Set up Python 3.12 | ||
uses: actions/setup-python@v2 | ||
with: | ||
python-version: 3.12 | ||
|
||
- name: Cache Poetry | ||
id: cache-poetry | ||
uses: actions/cache@v2 | ||
with: | ||
path: ~/.cache/pypoetry | ||
key: ${{ runner.os }}-poetry-${{ hashFiles('**/poetry.lock') }} | ||
|
||
- name: "Install Poetry" | ||
run: | | ||
curl -sSL https://install.python-poetry.org | python3 - | ||
echo 'export PATH="$HOME/.local/bin:$PATH"' >> $GITHUB_ENV | ||
- name: Cache dependencies | ||
id: cache-dependencies | ||
if: steps.cache-poetry.outputs.cache-hit != 'true' | ||
uses: actions/cache@v2 | ||
with: | ||
path: ~/.cache/pypoetry/cache | ||
key: ${{ runner.os }}-poetry-${{ hashFiles('**/poetry.lock') }}-cache | ||
restore-keys: | | ||
${{ runner.os }}-poetry- | ||
- name: Install dependencies | ||
if: steps.cache-dependencies.outputs.cache-hit != 'true' | ||
run: | | ||
export PATH="$HOME/.local/bin:$PATH" | ||
poetry install | ||
- name: Run linting | ||
run: | | ||
export PATH="$HOME/.local/bin:$PATH" | ||
poetry run make lint | ||
- name: Build file | ||
run: | | ||
export PATH="$HOME/.local/bin:$PATH" | ||
poetry run make build | ||
- name: Config poetry for PyPi | ||
run: | | ||
poetry config pypi-token.pypi ${{ secrets.PYPI_token }} | ||
- name: Publish | ||
run: | | ||
export PATH="$HOME/.local/bin:$PATH" | ||
poetry run make publish |
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 |
---|---|---|
@@ -0,0 +1,31 @@ | ||
# For Linting | ||
.PHONY: lint | ||
lint: | ||
@echo "Running flake8" | ||
@flake8 ./porunga | ||
|
||
# Clean pyc and pycache | ||
.PHONY: clean | ||
clean: | ||
@echo "Clean pyc" | ||
find . -type f -name "*.pyc" -delete | ||
find . -type d -name "__pycache__" -exec rm -r {} + | ||
|
||
# For building | ||
.PHONY: build | ||
build: | ||
@echo "Building package" | ||
@poetry build | ||
|
||
# For publishing | ||
.PHONY: publish | ||
publish: | ||
@echo "Publishing package" | ||
@poetry publish | ||
# Define a help target to show usage | ||
.PHONY: help | ||
help: | ||
@echo "Makefile targets:" | ||
@echo " lint - Run Python linter" | ||
@echo " clean - Clean up build artifacts" | ||
@echo " help - Show this help message" |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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