Skip to content

Commit c60e7f2

Browse files
committed
feat(ci): Use pypi/hatch install action
1 parent 85835a6 commit c60e7f2

File tree

1 file changed

+24
-20
lines changed

1 file changed

+24
-20
lines changed

.github/workflows/lint-and-test.yml

Lines changed: 24 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -7,39 +7,46 @@ on:
77
branches: [main]
88

99
jobs:
10+
lint-docs:
11+
runs-on: ubuntu-latest
12+
steps:
13+
- uses: actions/checkout@v4
14+
- name: Set up Python 3.12
15+
uses: actions/setup-python@v5
16+
with:
17+
python-version: "3.12"
18+
- name: Install hatch
19+
uses: pypa/hatch@install
20+
- name: Lint documentation
21+
run: hatch run docs:check
22+
1023
lint-code:
1124
runs-on: ubuntu-latest
1225
name: Lint code
1326
steps:
1427
- uses: actions/checkout@v4
15-
- name: Set up Python
28+
- name: Set up Python 3.12
1629
uses: actions/setup-python@v5
1730
with:
1831
python-version: "3.12"
19-
- name: Install dependencies
20-
run: |
21-
pip install hatch
22-
pip install hatch-vcs
23-
pip install hatch-fancy-pypi-readme
32+
- name: Install hatch
33+
uses: pypa/hatch@install
2434
- name: Lint code
25-
run: hatch run lint:style
35+
run: hatch fmt --check
2636

2737
lint-typing:
2838
runs-on: ubuntu-latest
2939
name: Lint type annotations
3040
steps:
3141
- uses: actions/checkout@v4
32-
- name: Set up Python
42+
- name: Set up Python 3.12
3343
uses: actions/setup-python@v5
3444
with:
3545
python-version: "3.12"
36-
- name: Install dependencies
37-
run: |
38-
pip install hatch
39-
pip install hatch-vcs
40-
pip install hatch-fancy-pypi-readme
46+
- name: Install hatch
47+
uses: pypa/hatch@install
4148
- name: Lint typing
42-
run: hatch run lint:typing
49+
run: hatch run types:check
4350

4451
test:
4552
runs-on: ubuntu-latest
@@ -53,13 +60,10 @@ jobs:
5360
uses: actions/setup-python@v5
5461
with:
5562
python-version: ${{ matrix.python-version }}
56-
- name: Install dependencies
57-
run: |
58-
pip install hatch
59-
pip install hatch-vcs
60-
pip install hatch-fancy-pypi-readme
63+
- name: Install hatch
64+
uses: pypa/hatch@install
6165
- name: Test
62-
run: hatch run cov-test
66+
run: hatch test --cover --python ${{ matrix.python-version }}
6367
- uses: codecov/codecov-action@v4
6468
with:
6569
token: ${{ secrets.CODECOV_TOKEN }}

0 commit comments

Comments
 (0)