Skip to content

Commit cac2ff8

Browse files
ci: set-up test and lint actions
1 parent 44032f4 commit cac2ff8

File tree

3 files changed

+83
-2
lines changed

3 files changed

+83
-2
lines changed

.github/workflows/release.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ jobs:
2727
ref: ${{ github.event.after }}
2828

2929
# Set up Python
30-
- uses: actions/setup-python@v1
30+
- uses: actions/setup-python@v2
3131
if: ${{ steps.release.outputs.release_created == 'true' }}
3232
with:
3333
python-version: 3.11
@@ -50,7 +50,7 @@ jobs:
5050

5151
# Install dependencies
5252
- if: ${{ steps.release.outputs.release_created == 'true' && steps.cache-dependencies.outputs.cache-hit != 'true' }}
53-
run: poetry install --without test,dev
53+
run: poetry install
5454

5555
# Configure basic credentials for PyPI
5656
- run: poetry config pypi-token.pypi "${{ secrets.PYPI_PASSWORD }}"

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

Lines changed: 79 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,79 @@
1+
name: Run Pytest
2+
3+
on:
4+
pull_request:
5+
branches:
6+
- master
7+
8+
jobs:
9+
test:
10+
runs-on: ubuntu-latest
11+
steps:
12+
- uses: actions/checkout@v4
13+
- uses: actions/setup-python@v2
14+
with:
15+
python-version: 3.11
16+
17+
- uses: snok/install-poetry@v1
18+
with:
19+
virtualenvs-create: true
20+
virtualenvs-in-project: true
21+
22+
- id: cache-dependencies
23+
uses: actions/cache@v3
24+
with:
25+
path: .venv
26+
key: venv-${{ runner.os }}-${{ hashFiles('**/poetry.lock') }}
27+
28+
- if: ${{ steps.cache-dependencies.outputs.cache-hit != 'true' }}
29+
run: poetry install
30+
31+
- run: poetry run poe test jtd_codebuild/tests
32+
33+
lint:
34+
runs-on: ubuntu-latest
35+
steps:
36+
- uses: actions/checkout@v4
37+
- uses: actions/setup-python@v2
38+
with:
39+
python-version: 3.11
40+
41+
- uses: snok/install-poetry@v1
42+
with:
43+
virtualenvs-create: true
44+
virtualenvs-in-project: true
45+
46+
- id: cache-dependencies
47+
uses: actions/cache@v3
48+
with:
49+
path: .venv
50+
key: venv-${{ runner.os }}-${{ hashFiles('**/poetry.lock') }}
51+
52+
- if: ${{ steps.cache-dependencies.outputs.cache-hit != 'true' }}
53+
run: poetry install
54+
55+
- run: poetry run poe lint
56+
57+
check-format:
58+
runs-on: ubuntu-latest
59+
steps:
60+
- uses: actions/checkout@v4
61+
- uses: actions/setup-python@v2
62+
with:
63+
python-version: 3.11
64+
65+
- uses: snok/install-poetry@v1
66+
with:
67+
virtualenvs-create: true
68+
virtualenvs-in-project: true
69+
70+
- id: cache-dependencies
71+
uses: actions/cache@v3
72+
with:
73+
path: .venv
74+
key: venv-${{ runner.os }}-${{ hashFiles('**/poetry.lock') }}
75+
76+
- if: ${{ steps.cache-dependencies.outputs.cache-hit != 'true' }}
77+
run: poetry install
78+
79+
- run: poetry run poe check-format

pyproject.toml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,8 @@ jtd-codebuild = "jtd_codebuild.__main__:cli"
2828

2929
[tool.poe.tasks]
3030
test = "python -m pytest"
31+
lint = "flake8 jtd_codebuild"
32+
check-format = "black jtd_codebuild --check"
3133

3234
[tool.black]
3335
line-length = 88

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy