From 41b1445cc3405881925d97c78983588aac7c8095 Mon Sep 17 00:00:00 2001 From: nikteliy Date: Sun, 22 Feb 2026 13:36:15 +0600 Subject: [PATCH] Add github action --- .github/workflows/ci.yml | 20 ++++++++++++++++++++ .github/workflows/pre-commit.yml | 28 ---------------------------- pyproject.toml | 1 + 3 files changed, 21 insertions(+), 28 deletions(-) create mode 100644 .github/workflows/ci.yml delete mode 100644 .github/workflows/pre-commit.yml diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 0000000..4ced482 --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,20 @@ +name: CI +on: + push: + branches: [main] + pull_request: + branches: [main] +jobs: + pre-commit: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - uses: pre-commit/action@v3.0.1 + test: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - uses: astral-sh/setup-uv@v4 + - run: uv sync --group test + - run: uv pip install -e . + - run: uv run pytest tests/ --ignore=tests/real_plc_s1200/ diff --git a/.github/workflows/pre-commit.yml b/.github/workflows/pre-commit.yml deleted file mode 100644 index 9121530..0000000 --- a/.github/workflows/pre-commit.yml +++ /dev/null @@ -1,28 +0,0 @@ -name: Run pre-commit hook -on: - push: - branches: [master] - pull_request: - branches: [master] -jobs: - pre-commit: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v4 - - uses: pre-commit/action@v3 - tests: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v4 - - name: Set up Python - uses: actions/setup-python@v5 - with: - python-version: '3.12' - - name: Install dependencies - run: | - python -m pip install --upgrade pip - pip install -r requirements.txt - - name: Test with pytest - run: | - pip install .[test] - pytest --cov=. diff --git a/pyproject.toml b/pyproject.toml index cef9988..2a94569 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -2,6 +2,7 @@ name="python-s7comm" version="0.0.1" requires-python = ">=3.12" +license = "MIT" [dependency-groups] test = [