diff --git a/.gitea/workflows/ci.yml b/.gitea/workflows/ci.yml index 0f997b4..0bfb915 100644 --- a/.gitea/workflows/ci.yml +++ b/.gitea/workflows/ci.yml @@ -12,15 +12,28 @@ jobs: steps: - name: Checkout code - uses: actions/checkout@v4 - + run: | + # Manual checkout since we're on a host runner without Node.js + if [ -d ".git" ]; then + git pull origin ${{ github.ref_name }} + else + git clone ${{ github.server_url }}/${{ github.repository }} . + git checkout ${{ github.sha }} + fi + - name: Set up Python - uses: actions/setup-python@v4 - with: - python-version: '3.x' # or specify version like '3.9', '3.10', etc. + run: | + # Check if Python is available + python3 --version || python --version + # Create a virtual environment for isolation + python3 -m venv venv || python -m venv venv + source venv/bin/activate + echo "VIRTUAL_ENV=$VIRTUAL_ENV" >> $GITHUB_ENV + echo "$VIRTUAL_ENV/bin" >> $GITHUB_PATH - name: Install dependencies run: | + source venv/bin/activate python -m pip install --upgrade pip # Install package in development mode pip install -e . @@ -32,6 +45,7 @@ jobs: - name: Lint with flake8 run: | + source venv/bin/activate # Stop the build if there are Python syntax errors or undefined names flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics # Exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide @@ -39,10 +53,12 @@ jobs: - name: Run tests with pytest run: | + source venv/bin/activate # Run tests with coverage python -m pytest tests/ -v --cov=pyWebLayout --cov-report=term-missing - name: Test package installation run: | + source venv/bin/activate # Test that the package can be imported - python -c "import pyWebLayout; print('Package imported successfully')" + python -c "import pyWebLayout; print('Package imported successfully')" \ No newline at end of file