Skip to content

Commit 6182aad

Browse files
authored
Merge pull request #218 from bahlo/revive
Revive
2 parents 31a782f + 4d8474d commit 6182aad

File tree

15 files changed

+597
-866
lines changed

15 files changed

+597
-866
lines changed

.github/workflows/ci.yml

Lines changed: 24 additions & 55 deletions
Original file line numberDiff line numberDiff line change
@@ -9,63 +9,38 @@ on:
99
pull_request:
1010

1111
jobs:
12-
lint:
13-
name: Lint
14-
runs-on: ubuntu-latest
15-
steps:
16-
- name: Checkout
17-
uses: actions/checkout@v2
18-
- name: Setup
19-
uses: actions/setup-python@v2
20-
with:
21-
python-version: "3.7"
22-
- name: Install and run linters
23-
run: |
24-
pip install pipenv
25-
pipenv install --dev
26-
pipenv run pylint ing_ynab
27-
pipenv run black --check ing_ynab
2812
check:
29-
name: Check setup.py requirements
13+
name: Check
3014
runs-on: ubuntu-latest
3115
steps:
32-
- name: Checkout
33-
uses: actions/checkout@v2
34-
- name: Setup
35-
uses: actions/setup-python@v2
16+
- uses: actions/checkout@v4
17+
- uses: actions/setup-python@v5
3618
with:
37-
python-version: "3.7"
38-
- name: Verify dependencies
39-
run: |
40-
pip install pipenv
41-
pipenv install --dev
42-
pipenv run pipenv-setup check
19+
python-version: "3.12"
20+
- uses: pdm-project/setup-pdm@v3
21+
- run: pdm sync -d
22+
- run: pdm run ruff check
23+
- run: pdm run ruff format --check
4324
test:
4425
name: Test
4526
runs-on: ubuntu-latest
4627
steps:
47-
- name: Checkout
48-
uses: actions/checkout@v2
49-
- name: Setup
50-
uses: actions/setup-python@v2
28+
- uses: actions/checkout@v4
29+
- uses: actions/setup-python@v5
5130
with:
52-
python-version: "3.7"
53-
- name: Install and run pytest
54-
run: |
55-
pip install pipenv
56-
pipenv install --dev
57-
pipenv run python -m pytest
31+
python-version: "3.12"
32+
- uses: pdm-project/setup-pdm@v3
33+
- run: pdm sync -d
34+
- run: pdm run pytest
5835
docker:
5936
name: Docker
6037
runs-on: ubuntu-latest
6138
needs:
62-
- lint
6339
- check
6440
- test
6541
steps:
66-
- name: Checkout
67-
uses: actions/checkout@v2
68-
- name: Login
42+
- uses: actions/checkout@v4
43+
- name: Log into docker
6944
run: docker login docker.pkg.github.com -u bahlo -p "${{ secrets.GITHUB_TOKEN }}"
7045
- name: Build docker container
7146
if: github.ref != 'refs/heads/main' && !startsWith(github.ref, 'refs/tags')
@@ -86,21 +61,15 @@ jobs:
8661
runs-on: ubuntu-latest
8762
if: startsWith(github.ref, 'refs/tags')
8863
needs:
89-
- lint
9064
- check
9165
- test
9266
steps:
93-
- name: Checkout
94-
uses: actions/checkout@v2
95-
- name: Setup
96-
uses: actions/setup-python@v2
97-
with:
98-
python-version: "3.7"
99-
- name: Build module
100-
run: |
101-
pip3 install setuptools wheel
102-
python3 setup.py sdist bdist_wheel
103-
- name: Publish distribution to Test PyPI
104-
uses: pypa/gh-action-pypi-publish@master
67+
- uses: actions/checkout@v4
68+
- uses: actions/setup-python@v5
10569
with:
106-
password: ${{ secrets.PYPI_TOKEN }}
70+
python-version: "3.12"
71+
- uses: pdm-project/setup-pdm@v3
72+
- run: pdm publish
73+
env:
74+
PDM_PUBLISH_USERNAME: "__token__"
75+
PDM_PUBLISH_PASSWORD: "${{ secrets.PYPI_TOKEN }}"

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,3 +4,4 @@ build
44
dist
55
*.egg-info
66
__pycache__
7+
.pdm-python

Dockerfile

Lines changed: 13 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,14 @@
1-
FROM python:3.7
1+
ARG PYTHON_BASE=3.12-slim
2+
FROM python:$PYTHON_BASE AS builder
3+
RUN pip install -U pdm
4+
ENV PDM_CHECK_UPDATE=false
5+
COPY pyproject.toml pdm.lock README.md /project/
6+
COPY src/ /project/src
7+
WORKDIR /project
8+
RUN pdm install --check --prod --no-editable
29

3-
COPY . /app
4-
WORKDIR /app
5-
RUN pip install .
6-
7-
CMD ["ing-ynab"]
10+
FROM python:$PYTHON_BASE
11+
COPY --from=builder /project/.venv/ /project/.venv
12+
ENV PATH="/project/.venv/bin:$PATH"
13+
COPY src /project/src
14+
CMD ["python", "src/__main__.py"]

Pipfile

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

0 commit comments

Comments
 (0)