-
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.
- Loading branch information
0 parents
commit 96112ba
Showing
31 changed files
with
1,369 additions
and
0 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,22 @@ | ||
FROM python:3.12.2-alpine3.19 | ||
|
||
RUN apk add --no-cache \ | ||
poetry=1.7.1-r0 | ||
|
||
RUN addgroup -S app && adduser -S app -G app | ||
RUN mkdir /app \ | ||
&& chown app:app /app | ||
|
||
USER app | ||
|
||
WORKDIR /app | ||
|
||
COPY --chown=app:app poetry.lock pyproject.toml /app/ | ||
RUN poetry install | ||
|
||
COPY --chown=app:app src /app/src | ||
COPY --chown=app:app tests /app/tests | ||
|
||
ENTRYPOINT [ "poetry", "run", "pytest" ] | ||
|
||
HEALTHCHECK NONE |
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,8 @@ | ||
root = true | ||
|
||
[*] | ||
indent_style = space | ||
end_of_line = lf | ||
charset = utf-8 | ||
trim_trailing_whitespace = false | ||
insert_final_newline = true |
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 @@ | ||
* @tyutyutyu |
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,33 @@ | ||
name: Merge main back to develop | ||
|
||
on: | ||
pull_request: | ||
branches: | ||
- main | ||
types: | ||
- closed | ||
|
||
jobs: | ||
merge-main-back-to-develop: | ||
if: github.event.pull_request.merged && github.event.action == 'closed' | ||
runs-on: ubuntu-latest | ||
|
||
permissions: | ||
contents: write | ||
|
||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v4 | ||
|
||
- name: Set Git config | ||
run: | | ||
git config --local user.email "36857+actions@users.noreply.github.com" | ||
git config --local user.name "Github Actions" | ||
- name: Merge main back to dev | ||
run: | | ||
git fetch --unshallow | ||
git checkout develop | ||
git pull | ||
git merge --no-ff main -m "Auto-merge main back to dev" | ||
git push |
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,62 @@ | ||
name: Publish PyPI | ||
|
||
on: | ||
push: | ||
branches: | ||
- main | ||
|
||
jobs: | ||
release-prod: | ||
name: Publish PyPI | ||
runs-on: ubuntu-latest | ||
|
||
environment: | ||
name: release-prod | ||
url: https://pypi.org/p/msps | ||
|
||
permissions: | ||
contents: write | ||
id-token: write | ||
|
||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v4 | ||
|
||
- name: Install poetry | ||
run: pipx install poetry | ||
|
||
- name: Set up Python | ||
uses: actions/setup-python@v5 | ||
with: | ||
python-version: "3.10" | ||
cache: poetry | ||
|
||
- name: Install packages | ||
run: poetry install | ||
|
||
- name: Build | ||
run: poetry build | ||
|
||
- name: Publish distribution 📦 to PyPI | ||
uses: pypa/gh-action-pypi-publish@release/v1 | ||
|
||
- name: Sign the dists with Sigstore | ||
uses: sigstore/gh-action-sigstore-python@v2.1.1 | ||
with: | ||
inputs: >- | ||
./dist/*.tar.gz | ||
./dist/*.whl | ||
- name: Get version | ||
run: echo "VERSION=$(poetry --short version)" >> $GITHUB_ENV | ||
|
||
- name: Create GitHub Release | ||
env: | ||
GITHUB_TOKEN: ${{ github.token }} | ||
run: >- | ||
gh release create | ||
"${VERSION}" | ||
dist/** | ||
--repo '${{ github.repository }}' | ||
--generate-notes | ||
--title "${VERSION}" |
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,44 @@ | ||
name: Publish to TestPyPI | ||
|
||
on: | ||
workflow_dispatch: | ||
|
||
jobs: | ||
release-test: | ||
name: Publish to TestPyPI | ||
runs-on: ubuntu-latest | ||
|
||
environment: | ||
name: release-test | ||
url: https://test.pypi.org/p/msps | ||
|
||
permissions: | ||
contents: write | ||
id-token: write | ||
|
||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v4 | ||
|
||
- name: Install poetry | ||
run: pipx install poetry | ||
|
||
- name: Set up Python | ||
uses: actions/setup-python@v5 | ||
with: | ||
python-version: "3.8" | ||
cache: poetry | ||
|
||
- name: Install packages | ||
run: poetry install | ||
|
||
- name: Bump version | ||
run: poetry version "$(poetry version --short)${GITHUB_RUN_NUMBER}" | ||
|
||
- name: Build | ||
run: poetry build | ||
|
||
- name: Publish to TestPyPI | ||
uses: pypa/gh-action-pypi-publish@release/v1 | ||
with: | ||
repository-url: https://test.pypi.org/legacy/ |
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,40 @@ | ||
name: Test | ||
|
||
on: | ||
push: | ||
branches-ignore: | ||
- main | ||
|
||
jobs: | ||
test: | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
python_version: ["3.10", "3.11", "3.12"] | ||
|
||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: Update python | ||
uses: actions/setup-python@v5 | ||
with: | ||
python-version: ${{ matrix.python_version }} | ||
architecture: x64 | ||
|
||
- name: Install Poetry | ||
run: curl -sSL curl -sSL https://install.python-poetry.org | python3 - | ||
|
||
- name: Set env | ||
run: echo "PATH=${PATH}:$HOME/.poetry/bin" >> $GITHUB_ENV | ||
|
||
- name: Checkout branch | ||
uses: actions/checkout@v4 | ||
|
||
- name: Install packages via Poetry | ||
run: poetry install | ||
|
||
- name: Check type annotations | ||
run: poetry run mypy | ||
|
||
- name: Check code style | ||
run: poetry run pylint msps |
Oops, something went wrong.