@@ -42,40 +42,28 @@ defaults:
4242
4343jobs :
4444 code-quality :
45- name : ${{ matrix.toxenv }}
45+ name : Code Quality
4646
4747 runs-on : ubuntu-latest
4848 timeout-minutes : 10
4949
5050 strategy :
5151 fail-fast : false
52- matrix :
53- toxenv : [linter]
54-
55- env :
56- TOXENV : ${{ matrix.toxenv }}
57- PYTEST_ADDOPTS : " -v --color=yes"
5852
5953 steps :
6054 - name : Check out the repository
61- uses : actions/checkout@v3
62- with :
63- persist-credentials : false
55+ uses : actions/checkout@v4
6456
6557 - name : Set up Python
66- uses : actions/setup-python@v4.3.0
58+ uses : actions/setup-python@v5
6759 with :
6860 python-version : " 3.9"
6961
70- - name : Install python dependencies
71- run : |
72- python -m pip install --user --upgrade pip
73- python -m pip --version
74- python -m pip install tox
75- tox --version
62+ - name : Install Hatch
63+ uses : pypa/hatch@install
7664
77- - name : Run tox
78- run : tox
65+ - name : Run Code Quality
66+ run : hatch -v run code-quality
7967
8068 unit :
8169 name : unit test / python ${{ matrix.python-version }}
@@ -88,131 +76,39 @@ jobs:
8876 matrix :
8977 python-version : ["3.9", "3.10", "3.11", "3.12"]
9078
91- env :
92- TOXENV : " unit"
93- PYTEST_ADDOPTS : " -v --color=yes --csv unit_results.csv"
94-
9579 steps :
9680 - name : Check out the repository
97- uses : actions/checkout@v3
98- with :
99- persist-credentials : false
81+ uses : actions/checkout@v4
10082
10183 - name : Set up Python ${{ matrix.python-version }}
102- uses : actions/setup-python@v4.3.0
84+ uses : actions/setup-python@v5
10385 with :
10486 python-version : ${{ matrix.python-version }}
10587
106- - name : Install python dependencies
107- run : |
108- python -m pip install --user --upgrade pip
109- python -m pip --version
110- python -m pip install tox
111- tox --version
112- - name : Run tox
113- run : tox
114-
115- - name : Get current date
116- if : always()
117- id : date
118- run : echo "::set-output name=date::$(date +'%Y-%m-%dT%H_%M_%S')" # no colons allowed for artifacts
119-
120- - uses : actions/upload-artifact@v4
121- if : always()
122- with :
123- name : unit_results_${{ matrix.python-version }}-${{ steps.date.outputs.date }}.csv
124- path : unit_results.csv
88+ - name : Install Hatch
89+ uses : pypa/hatch@install
12590
126- build :
127- name : build packages
91+ - name : Run Unit Tests
92+ run : hatch run -v +py=${{ matrix.python-version }} test:unit
12893
94+ build :
95+ name : Build and Verify Packages
12996 runs-on : ubuntu-latest
13097
131- outputs :
132- is_alpha : ${{ steps.check-is-alpha.outputs.is_alpha }}
133-
13498 steps :
13599 - name : Check out the repository
136- uses : actions/checkout@v3
100+ uses : actions/checkout@v4
137101
138102 - name : Set up Python
139- uses : actions/setup-python@v4.3.0
103+ uses : actions/setup-python@v5
140104 with :
141105 python-version : " 3.9"
142106
143- - name : Install python dependencies
144- run : |
145- python -m pip install --user --upgrade pip
146- python -m pip install --upgrade setuptools wheel twine check-wheel-contents
147- python -m pip --version
148- - name : Build distributions
149- run : ./scripts/build-dist.sh
150-
151- - name : Show distributions
152- run : ls -lh dist/
153-
154- - name : Check distribution descriptions
155- run : |
156- twine check dist/*
157- - name : Check wheel contents
158- run : |
159- check-wheel-contents dist/*.whl --ignore W007,W008
160-
161- - name : Check if this is an alpha version
162- id : check-is-alpha
163- run : |
164- export is_alpha=0
165- if [[ "$(ls -lh dist/)" == *"a1"* ]]; then export is_alpha=1; fi
166- echo "::set-output name=is_alpha::$is_alpha"
167-
168- - uses : actions/upload-artifact@v3
169- with :
170- name : dist
171- path : dist/
172-
173- test-build :
174- name : verify packages / python ${{ matrix.python-version }} / ${{ matrix.os }}
175-
176- if : needs.build.outputs.is_alpha == 0
107+ - name : Install Hatch
108+ uses : pypa/hatch@install
177109
178- needs : build
179-
180- runs-on : ${{ matrix.os }}
181-
182- strategy :
183- fail-fast : false
184- matrix :
185- os : [ubuntu-latest, macos-latest, windows-latest]
186- python-version : ["3.9", "3.10", "3.11", "3.12"]
187-
188- steps :
189- - name : Set up Python ${{ matrix.python-version }}
190- 191- with :
192- python-version : ${{ matrix.python-version }}
110+ - name : Build distributions
111+ run : hatch -v build
193112
194- - name : Install python dependencies
195- run : |
196- python -m pip install --user --upgrade pip
197- python -m pip install --upgrade wheel
198- python -m pip --version
199- - uses : actions/download-artifact@v3
200- with :
201- name : dist
202- path : dist/
203-
204- - name : Show distributions
205- run : ls -lh dist/
206-
207- - name : Install wheel distributions
208- run : |
209- find ./dist/*.whl -maxdepth 1 -type f | xargs python -m pip install --force-reinstall --find-links=dist/
210- - name : Check wheel distributions
211- run : |
212- dbt --version
213- - name : Install source distributions
214- run : |
215- find ./dist/*.gz -maxdepth 1 -type f | xargs python -m pip install --force-reinstall --find-links=dist/
216- - name : Check source distributions
217- run : |
218- dbt --version
113+ - name : Verify distributions
114+ run : hatch run verify:check-all
0 commit comments