@@ -25,50 +25,47 @@ jobs:
2525 - run : echo "🔎 The name of your branch is ${{ github.ref }} and your repository is ${{ github.repository }}."
2626 - name : Check out repository code
2727 uses : actions/checkout@v3
28- - name : Set up Python ${{ matrix.python-version }}
29- uses : actions /setup-python@v4
28+ - name : Install Task
29+ uses : arduino /setup-task@v2
3030 with :
31- python- version : ${{ matrix.python-version }}
32- - name : Cache deps install
33- id : cache-deps
34- uses : actions/cache@v3
31+ version : 3.x
32+ repo-token : ${{ secrets.GITHUB_TOKEN }}
33+ - name : Install the latest version of uv
34+ uses : astral-sh/setup-uv@v5
3535 with :
36- path : |
37- ${{ env.POETRY_HOME }}
38- ${{ env.POETRY_CACHE }}
39- key : cachepoetry-${{ hashFiles('poetry.lock', '.github/workflows/**') }}-${{ matrix.python-version }}
40- - name : Install poetry
41- if : steps.cache-deps.outputs.cache-hit != 'true'
42- run : |
43- python3 -m venv $POETRY_HOME
44- $POETRY_HOME/bin/pip install poetry==$POETRY_VERSION
45- - name : Fix github path
46- run : |
47- echo "$POETRY_HOME/bin" >> "$GITHUB_PATH"
48- - name : Configure poetry
49- run : |
50- poetry config virtualenvs.create true
51- poetry config virtualenvs.in-project false
52- poetry config cache-dir $POETRY_CACHE
53- poetry config virtualenvs.path $POETRY_CACHE/venv
54- - name : Install requirements
55- if : steps.cache-deps.outputs.cache-hit != 'true'
36+ version : " latest"
37+ python-version : ${{ matrix.python-version }}
38+ - name : Install
5639 run : |
57- poetry install
40+ task install
5841 - name : Run lint
5942 run : |
60- poetry run make FIX=0 lint
61- - name : Run tests / coverage
43+ if [ "${{ matrix.python-version }}" = "3.8" ]; then
44+ # As we have mypy issues with 3.8 => let's skip
45+ export LINT_MYPY=0
46+ fi
47+ task lint
48+ env :
49+ FIX : 0
50+ - name : Run tests
6251 run : |
63- poetry run make test
52+ task test
6453 - name : Run doc
6554 if : matrix.python-version == '3.12'
6655 run : |
67- poetry run make doc
56+ task doc
6857 - name : Check modified files
6958 if : matrix.python-version == '3.12'
7059 run : |
71- git diff --exit-code
60+ task no-dirty
61+ - name : Clean
62+ if : matrix.python-version == '3.12'
63+ run : |
64+ task clean
65+ - name : Check modified files (after clean)
66+ if : matrix.python-version == '3.12'
67+ run : |
68+ task no-dirty
7269
7370 publish_pypi :
7471 runs-on : ubuntu-latest
@@ -77,53 +74,53 @@ jobs:
7774 steps :
7875 - name : Check out repository code
7976 uses : actions/checkout@v3
80- - name : Set up Python 3.8
81- uses : actions /setup-python@v4
77+ - name : Install Task
78+ uses : arduino /setup-task@v2
8279 with :
83- python-version : 3.8
84- - name : Install poetry
85- run : |
86- python3 -m venv $POETRY_HOME
87- $POETRY_HOME/bin/pip install poetry==$POETRY_VERSION
88- - name : Fix github path
89- run : |
90- echo "$POETRY_HOME/bin" >> "$GITHUB_PATH"
91- - name : Install requirements
80+ version : 3.x
81+ repo-token : ${{ secrets.GITHUB_TOKEN }}
82+ - name : Install the latest version of uv
83+ uses : astral-sh/setup-uv@v5
84+ with :
85+ version : " latest"
86+ python-version : 3.12
87+ - name : Install
9288 run : |
93- poetry install
89+ task install
9490 - name : Override BASEURL in README.md
9591 env :
9692 BASEURL : https://github.com/fabien-marty/jinja-tree/blob/main/
9793 run : |
98- poetry run jinja-tree .
94+ task doc
9995 - name : Publish on Pypi
10096 run : |
101- poetry config pypi-token.pypi "${{ secrets.PYPI_TOKEN }}"
10297 VERSION=$(echo "${{ github.event.release.tag_name }}" | sed -e 's/^v//')
103- poetry version "${VERSION}"
104- poetry build
105- poetry publish
98+ echo "VERSION: $VERSION"
99+ uvx --from=toml-cli toml set --toml-path=pyproject.toml project.version "$VERSION"
100+ task publish
101+ env :
102+ UV_PUBLISH_TOKEN : ${{ secrets.PYPI_TOKEN }}
106103
107104 test_docker :
108105 runs-on : ubuntu-latest
109106 needs : lint_and_test
110107 if : github.event_name != 'release'
111- env :
112- REGISTRY : ghcr.io
113- IMAGE_NAME : ${{ github.repository }}
114- permissions :
115- contents : read
116- packages : write
108+ # env:
109+ # REGISTRY: ghcr.io
110+ # IMAGE_NAME: ${{ github.repository }}
111+ # permissions:
112+ # contents: read
113+ # packages: write
117114 steps :
118115 - name : Check out repository code
119116 uses : actions/checkout@v4
120- - name : Build docker
121- run : |
122- make docker
117+ - name : Build and push Docker image
118+ uses : docker/build-push-action@v5
119+ with :
120+ push : false
123121
124122 publish_docker :
125123 runs-on : ubuntu-latest
126- needs : publish_pypi
127124 if : github.event_name == 'release' && github.event.action == 'created'
128125 env :
129126 REGISTRY : ghcr.io
@@ -148,7 +145,6 @@ jobs:
148145 - name : Build and push Docker image
149146 uses : docker/build-push-action@v5
150147 with :
151- context : docker
152148 push : true
153149 tags : ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:latest
154150 labels : ${{ steps.meta.outputs.labels }}
0 commit comments