From d567e87f21f675661e6dfec4f9130c0d982de548 Mon Sep 17 00:00:00 2001 From: SIVALANAGASHANKARNIVAS Date: Wed, 26 Nov 2025 23:01:52 +0530 Subject: [PATCH] ci: Add GitHub Actions CI workflow This CI configuration sets up workflows for testing and linting Python code on multiple operating systems and Python versions. --- .github/workflows/ci.yml | 63 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 63 insertions(+) create mode 100644 .github/workflows/ci.yml diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 0000000..f1af9e0 --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,63 @@ +name: CI + +on: + push: + branches: [ master, main ] + pull_request: + branches: [ master, main ] + +jobs: + test: + runs-on: ${{ matrix.os }} + strategy: + fail-fast: false + matrix: + os: [ubuntu-latest, macos-latest] + python-version: ['3.8', '3.9', '3.10', '3.11', '3.12'] + + steps: + - uses: actions/checkout@v4 + + - name: Set up Python ${{ matrix.python-version }} + uses: actions/setup-python@v5 + with: + python-version: ${{ matrix.python-version }} + + - name: Install dependencies + run: | + python -m pip install --upgrade pip + pip install -e .[dev] + pip install pytest pytest-cov coverage + + - name: Run tests with coverage + run: | + pytest tests/ -v --cov=clu --cov-report=xml --cov-report=term-missing + + - name: Upload coverage to Codecov + uses: codecov/codecov-action@v4 + with: + file: ./coverage.xml + fail_ci_if_error: false + verbose: true + env: + CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} + + lint: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + + - name: Set up Python + uses: actions/setup-python@v5 + with: + python-version: '3.11' + + - name: Install linting tools + run: | + python -m pip install --upgrade pip + pip install flake8 pylint + + - name: Lint with flake8 + run: | + flake8 clu/ --count --select=E9,F63,F7,F82 --show-source --statistics + flake8 clu/ --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics