From 2a6fb88cbd57a5e3556d33d553d2b8d9952f99df Mon Sep 17 00:00:00 2001 From: masoud masoori <50513774+Masoud-Masoori@users.noreply.github.com> Date: Thu, 4 Jun 2026 13:04:40 -0400 Subject: [PATCH] ci: add Python CI workflow (org python-ci template) --- .github/workflows/python-ci.yml | 41 +++++++++++++++++++++++++++++++++ 1 file changed, 41 insertions(+) create mode 100644 .github/workflows/python-ci.yml diff --git a/.github/workflows/python-ci.yml b/.github/workflows/python-ci.yml new file mode 100644 index 0000000..11c7c9c --- /dev/null +++ b/.github/workflows/python-ci.yml @@ -0,0 +1,41 @@ +name: Python CI + +on: + push: + branches: [main, master] + pull_request: + branches: [main, master] + +permissions: + contents: read + +concurrency: + group: python-ci-${{ github.ref }} + cancel-in-progress: true + +jobs: + test: + runs-on: ubuntu-latest + timeout-minutes: 25 + + steps: + - uses: actions/checkout@v6 + + - uses: actions/setup-python@v6 + with: + python-version: "3.11" + cache: pip + + - name: Install dependencies + run: | + python -m pip install --upgrade pip + if [ -f requirements.txt ]; then pip install -r requirements.txt; fi + if [ -f pyproject.toml ]; then pip install -e ".[dev]" || pip install -e . || true; fi + if [ -d tests ]; then pip install pytest; fi + + - name: Compile + run: python -m compileall . + + - name: Test + run: | + if [ -d tests ]; then pytest; else echo "No tests directory; compile check passed."; fi