Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Revive #218

Merged
merged 7 commits into from
Jul 31, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
79 changes: 24 additions & 55 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,63 +9,38 @@ on:
pull_request:

jobs:
lint:
name: Lint
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Setup
uses: actions/setup-python@v2
with:
python-version: "3.7"
- name: Install and run linters
run: |
pip install pipenv
pipenv install --dev
pipenv run pylint ing_ynab
pipenv run black --check ing_ynab
check:
name: Check setup.py requirements
name: Check
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Setup
uses: actions/setup-python@v2
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: "3.7"
- name: Verify dependencies
run: |
pip install pipenv
pipenv install --dev
pipenv run pipenv-setup check
python-version: "3.12"
- uses: pdm-project/setup-pdm@v3
- run: pdm sync -d
- run: pdm run ruff check
- run: pdm run ruff format --check
test:
name: Test
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Setup
uses: actions/setup-python@v2
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: "3.7"
- name: Install and run pytest
run: |
pip install pipenv
pipenv install --dev
pipenv run python -m pytest
python-version: "3.12"
- uses: pdm-project/setup-pdm@v3
- run: pdm sync -d
- run: pdm run pytest
docker:
name: Docker
runs-on: ubuntu-latest
needs:
- lint
- check
- test
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Login
- uses: actions/checkout@v4
- name: Log into docker
run: docker login docker.pkg.github.com -u bahlo -p "${{ secrets.GITHUB_TOKEN }}"
- name: Build docker container
if: github.ref != 'refs/heads/main' && !startsWith(github.ref, 'refs/tags')
Expand All @@ -86,21 +61,15 @@ jobs:
runs-on: ubuntu-latest
if: startsWith(github.ref, 'refs/tags')
needs:
- lint
- check
- test
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Setup
uses: actions/setup-python@v2
with:
python-version: "3.7"
- name: Build module
run: |
pip3 install setuptools wheel
python3 setup.py sdist bdist_wheel
- name: Publish distribution to Test PyPI
uses: pypa/gh-action-pypi-publish@master
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
password: ${{ secrets.PYPI_TOKEN }}
python-version: "3.12"
- uses: pdm-project/setup-pdm@v3
- run: pdm publish
env:
PDM_PUBLISH_USERNAME: "__token__"
PDM_PUBLISH_PASSWORD: "${{ secrets.PYPI_TOKEN }}"
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,4 @@ build
dist
*.egg-info
__pycache__
.pdm-python
19 changes: 13 additions & 6 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,7 +1,14 @@
FROM python:3.7
ARG PYTHON_BASE=3.12-slim
FROM python:$PYTHON_BASE AS builder
RUN pip install -U pdm
ENV PDM_CHECK_UPDATE=false
COPY pyproject.toml pdm.lock README.md /project/
COPY src/ /project/src
WORKDIR /project
RUN pdm install --check --prod --no-editable

COPY . /app
WORKDIR /app
RUN pip install .

CMD ["ing-ynab"]
FROM python:$PYTHON_BASE
COPY --from=builder /project/.venv/ /project/.venv
ENV PATH="/project/.venv/bin:$PATH"
COPY src /project/src
CMD ["python", "src/__main__.py"]
22 changes: 0 additions & 22 deletions Pipfile

This file was deleted.

Loading
Loading