2727
2828env :
2929 PYTHON_VERSION_DEFAULT : " 3.10"
30- POETRY_VERSION : " 1.8.3 "
30+ POETRY_VERSION : " 2.4.1 "
3131 REPORTS_DIR : CI_reports
3232
3333jobs :
@@ -39,22 +39,15 @@ jobs:
3939 - name : Checkout
4040 uses : actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
4141
42+ - name : Install Poetry
43+ run : pipx install poetry==${{ env.POETRY_VERSION }}
44+
4245 - name : Set up Python
4346 uses : actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6.2.0
4447 with :
4548 python-version : ${{ env.PYTHON_VERSION_DEFAULT }}
4649 architecture : ' x64'
47-
48- - name : Install poetry
49- uses : Gr1N/setup-poetry@48b0f77c8c1b1b19cb962f0f00dff7b4be8f81ec # v9
50- with :
51- poetry-version : ${{ env.POETRY_VERSION }}
52-
53- - name : Cache poetry virtualenv
54- uses : actions/cache@27d5ce7f107fe9357f9df03efb73ab90386fccae # v5.0.5
55- with :
56- path : ~/.cache/pypoetry/virtualenvs
57- key : ${{ runner.os }}-poetry-lint-${{ hashFiles('poetry.lock') }}
50+ cache : ' poetry'
5851
5952 - name : Install dependencies
6053 run : poetry install --no-ansi
@@ -71,28 +64,21 @@ jobs:
7164 include :
7265 - python-version : " 3.10"
7366 tox-env : mypy-locked
74- - python-version : " 3.8 "
67+ - python-version : " 3.10 "
7568 tox-env : mypy-lowest
7669 steps :
7770 - name : Checkout
7871 uses : actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
7972
73+ - name : Install Poetry
74+ run : pipx install poetry==${{ env.POETRY_VERSION }}
75+
8076 - name : Set up Python
8177 uses : actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6.2.0
8278 with :
8379 python-version : ${{ matrix.python-version }}
8480 architecture : ' x64'
85-
86- - name : Install poetry
87- uses : Gr1N/setup-poetry@48b0f77c8c1b1b19cb962f0f00dff7b4be8f81ec # v9
88- with :
89- poetry-version : ${{ env.POETRY_VERSION }}
90-
91- - name : Cache poetry virtualenv
92- uses : actions/cache@27d5ce7f107fe9357f9df03efb73ab90386fccae # v5.0.5
93- with :
94- path : ~/.cache/pypoetry/virtualenvs
95- key : ${{ runner.os }}-poetry-${{ matrix.python-version }}-${{ hashFiles('poetry.lock') }}
81+ cache : ' poetry'
9682
9783 - name : Install dependencies
9884 run : poetry install --no-ansi
@@ -101,19 +87,21 @@ jobs:
10187 run : poetry run tox -e ${{ matrix.tox-env }}
10288
10389 build-and-test :
104- name : Build & Test (Python ${{ matrix.python-version }}, ${{ matrix.deps }})
105- runs-on : ubuntu-latest
90+ name : Build & Test (Python ${{ matrix.python-version }}, ${{ matrix.deps }}, ${{ matrix.os }} )
91+ runs-on : ${{ matrix.os }}
10692 env :
10793 REPORTS_ARTIFACT : tests-reports
10894 strategy :
10995 fail-fast : false
11096 matrix :
97+ os :
98+ - ubuntu-latest
99+ - windows-latest
111100 python-version :
101+ - " 3.13"
112102 - " 3.12"
113103 - " 3.11"
114104 - " 3.10"
115- - " 3.9"
116- - " 3.8"
117105 deps :
118106 - locked
119107 - lowest
@@ -125,22 +113,15 @@ jobs:
125113 - name : Create reports directory
126114 run : mkdir ${{ env.REPORTS_DIR }}
127115
116+ - name : Install Poetry
117+ run : pipx install poetry==${{ env.POETRY_VERSION }}
118+
128119 - name : Set up Python
129120 uses : actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6.2.0
130121 with :
131122 python-version : ${{ matrix.python-version }}
132123 architecture : ' x64'
133-
134- - name : Install poetry
135- uses : Gr1N/setup-poetry@48b0f77c8c1b1b19cb962f0f00dff7b4be8f81ec # v9
136- with :
137- poetry-version : ${{ env.POETRY_VERSION }}
138-
139- - name : Cache poetry virtualenv
140- uses : actions/cache@27d5ce7f107fe9357f9df03efb73ab90386fccae # v5.0.5
141- with :
142- path : ~/.cache/pypoetry/virtualenvs
143- key : ${{ runner.os }}-poetry-${{ matrix.python-version }}-${{ matrix.deps }}-${{ hashFiles('poetry.lock') }}
124+ cache : ' poetry'
144125
145126 - name : Install dependencies
146127 run : poetry install --no-ansi
@@ -149,6 +130,7 @@ jobs:
149130 run : poetry build
150131
151132 - name : Run tests
133+ shell : bash
152134 run : |
153135 PY_VER=$(echo "${{ matrix.python-version }}" | tr -d '.')
154136 poetry run tox -e py${PY_VER}-${{ matrix.deps }}
@@ -163,12 +145,41 @@ jobs:
163145 if : ${{ ! cancelled() }}
164146 uses : actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
165147 with :
166- name : ${{ env.REPORTS_ARTIFACT }}-${{ matrix.python-version }}-${{ matrix.deps }}
148+ name : ${{ env.REPORTS_ARTIFACT }}-${{ matrix.os }}-${{ matrix. python-version }}-${{ matrix.deps }}
167149 path : ${{ env.REPORTS_DIR }}
168150 if-no-files-found : error
169151
152+ integration-guide :
153+ name : Integration Test - Sonatype Guide
154+ runs-on : ubuntu-latest
155+ needs : build-and-test
156+ # Secrets are unavailable on PRs from forks; skip rather than fail
157+ if : ${{ github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name == github.repository }}
158+ steps :
159+ - name : Checkout
160+ uses : actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
161+
162+ - name : Install Poetry
163+ run : pipx install poetry==${{ env.POETRY_VERSION }}
164+
165+ - name : Set up Python
166+ uses : actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6.2.0
167+ with :
168+ python-version : ${{ env.PYTHON_VERSION_DEFAULT }}
169+ architecture : ' x64'
170+ cache : ' poetry'
171+
172+ - name : Install dependencies
173+ run : poetry install --no-ansi
174+
175+ - name : Run Sonatype Guide scan
176+ env :
177+ SONATYPE_GUIDE_USERNAME : ${{ secrets.OSSI_USERNAME }}
178+ SONATYPE_GUIDE_TOKEN : ${{ secrets.SONATYPE_GUIDE_TOKEN }}
179+ run : poetry run jake -w guide
180+
170181 sonatype-lifecycle :
171- name : Sonatype Lifecycle (Build Stage)
182+ name : Sonatype Lifecycle Policy Evaluation
172183 runs-on : ubuntu-latest
173184 steps :
174185 - name : Checkout
@@ -181,5 +192,5 @@ jobs:
181192 username : ${{ secrets.SONATYPE_LIFECYCLE_USERNAME }}
182193 password : ${{ secrets.SONATYPE_LIFECYCLE_PASSWORD }}
183194 application-id : jake
184- stage : build
195+ stage : ${{ github.ref == 'refs/heads/main' && ' build' || 'develop' }}
185196 scan-targets : ' .'
0 commit comments