This commit is contained in:
parent
91b4dccc07
commit
81d85386c5
@ -12,28 +12,15 @@ jobs:
|
|||||||
|
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout code
|
- name: Checkout code
|
||||||
run: |
|
uses: actions/checkout@v4
|
||||||
# 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
|
- name: Set up Python
|
||||||
run: |
|
uses: actions/setup-python@v4
|
||||||
# Check if Python is available
|
with:
|
||||||
python3 --version || python --version
|
python-version: '3.x'
|
||||||
# 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
|
- name: Install dependencies
|
||||||
run: |
|
run: |
|
||||||
source venv/bin/activate
|
|
||||||
python -m pip install --upgrade pip
|
python -m pip install --upgrade pip
|
||||||
# Install package in development mode
|
# Install package in development mode
|
||||||
pip install -e .
|
pip install -e .
|
||||||
@ -45,20 +32,17 @@ jobs:
|
|||||||
|
|
||||||
- name: Lint with flake8
|
- name: Lint with flake8
|
||||||
run: |
|
run: |
|
||||||
source venv/bin/activate
|
|
||||||
# Stop the build if there are Python syntax errors or undefined names
|
# Stop the build if there are Python syntax errors or undefined names
|
||||||
flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics
|
flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics
|
||||||
# Exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide
|
# Exit-zero treats all errors as warnings
|
||||||
flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics
|
flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics
|
||||||
|
|
||||||
- name: Run tests with pytest
|
- name: Run tests with pytest
|
||||||
run: |
|
run: |
|
||||||
source venv/bin/activate
|
|
||||||
# Run tests with coverage
|
# Run tests with coverage
|
||||||
python -m pytest tests/ -v --cov=pyWebLayout --cov-report=term-missing
|
python -m pytest tests/ -v --cov=pyWebLayout --cov-report=term-missing
|
||||||
|
|
||||||
- name: Test package installation
|
- name: Test package installation
|
||||||
run: |
|
run: |
|
||||||
source venv/bin/activate
|
|
||||||
# Test that the package can be imported
|
# Test that the package can be imported
|
||||||
python -c "import pyWebLayout; print('Package imported successfully')"
|
python -c "import pyWebLayout; print('Package imported successfully')"
|
||||||
Loading…
x
Reference in New Issue
Block a user