Skip to content

Commit 3d35433

Browse files
committed
fix: updated github actions for python rewrite
1 parent 26934ef commit 3d35433

File tree

2 files changed

+62
-1
lines changed

2 files changed

+62
-1
lines changed

.github/workflows/build-docker.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,4 +28,4 @@ jobs:
2828
uses: docker/build-push-action@v6
2929
with:
3030
push: true
31-
tags: dreadnode/nerve:latest
31+
tags: evilsocket/nerve:latest

.github/workflows/ci.yml

Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
name: CI
2+
3+
on:
4+
pull_request:
5+
branches: [main]
6+
push:
7+
branches: [main]
8+
9+
jobs:
10+
validate:
11+
name: Validate
12+
strategy:
13+
fail-fast: false
14+
matrix:
15+
python-version: ["3.9", "3.10", "3.11", "3.12"]
16+
runs-on: ubuntu-latest
17+
steps:
18+
- name: Checkout code
19+
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683
20+
21+
- name: Setup Python ${{ matrix.python-version }}
22+
uses: actions/setup-python@0b93645e9fea7318ecaed2b359559ac225c90a2b
23+
with:
24+
python-version: ${{ matrix.python-version }}
25+
26+
- name: Install Poetry
27+
uses: abatilo/actions-poetry@e78f54a89cb052fff327414dd9ff010b5d2b4dbd
28+
29+
- name: Configure Poetry
30+
run: |
31+
poetry config virtualenvs.create true --local
32+
poetry config virtualenvs.in-project true --local
33+
34+
- name: Cache dependencies
35+
uses: actions/cache@6849a6489940f00c2f30c0fb92c6274307ccb58a
36+
with:
37+
path: ./.venv
38+
key: venv-${{ runner.os }}-py${{ matrix.python-version }}-${{ hashFiles('poetry.lock') }}
39+
restore-keys: |
40+
venv-${{ runner.os }}-py${{ matrix.python-version }}-
41+
42+
- name: Install package
43+
run: poetry install --all-extras
44+
45+
- name: Validate version
46+
run: |
47+
POETRY_VERSION=$(poetry version -s)
48+
INIT_VERSION=$(python -c "import nerve; print(nerve.__version__)")
49+
if [ "$POETRY_VERSION" != "$INIT_VERSION" ]; then
50+
echo "Version mismatch: pyproject.toml ($POETRY_VERSION) != __init__.py ($INIT_VERSION)"
51+
exit 1
52+
fi
53+
54+
- name: Lint
55+
run: poetry run ruff check --output-format=github nerve
56+
57+
- name: Type check
58+
run: poetry run mypy --no-error-summary nerve
59+
60+
- name: Test
61+
run: poetry run pytest nerve

0 commit comments

Comments
 (0)