diff --git a/.gitea/workflows/ci.yml b/.gitea/workflows/ci.yml index 36302e2..d91adeb 100644 --- a/.gitea/workflows/ci.yml +++ b/.gitea/workflows/ci.yml @@ -1 +1,52 @@ -checking \ No newline at end of file +name: CI + +on: + push: + branches: [ main, master ] + pull_request: + branches: [ main, master ] + +jobs: + test: + runs-on: ubuntu-latest + strategy: + matrix: + python-version: ['3.9', '3.10', '3.11'] + 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] + - name: Lint with flake8 + run: | + pip install flake8 + flake8 src/ tests/ --max-line-length=100 --ignore=E501,W503 + - name: Run tests + run: | + pip install pytest pytest-cov + pytest tests/ -v --tb=short + + build: + runs-on: ubuntu-latest + needs: test + steps: + - uses: actions/checkout@v4 + - name: Set up Python + uses: actions/setup-python@v5 + with: + python-version: '3.11' + - name: Install dependencies + run: | + python -m pip install --upgrade pip + pip install build + python -m build + - name: Verify build + run: | + pip install dist/*.whl + pip install requests ghapi + python -c "import code_pattern_search_cli; print('Build successful')"