150 lines
No EOL
4.2 KiB
YAML
150 lines
No EOL
4.2 KiB
YAML
name: Test Deb-Mock Build
|
|
|
|
on:
|
|
push:
|
|
branches: [ main, develop ]
|
|
pull_request:
|
|
branches: [ main ]
|
|
|
|
jobs:
|
|
test:
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
|
- name: Checkout code
|
|
run: |
|
|
# Clone directly to current directory
|
|
git clone https://git.raines.xyz/robojerk/deb-mock.git .
|
|
# Verify all files are copied
|
|
echo "Checking repository contents:"
|
|
ls -la
|
|
echo "Checking for examples directory:"
|
|
find . -name "examples" -type d || echo "examples directory not found"
|
|
echo "Checking examples directory contents:"
|
|
ls -la examples/ || echo "examples directory not found"
|
|
echo "Git status:"
|
|
git status
|
|
echo "Git log:"
|
|
git log --oneline -5
|
|
|
|
- name: Set up Python
|
|
run: |
|
|
sudo apt update
|
|
sudo apt install -y python3.12 python3.12-venv python3-pip
|
|
|
|
- name: Install system dependencies
|
|
run: |
|
|
# Configure APT to use your cache server
|
|
echo 'Acquire::http::Proxy "http://192.168.1.79:3142";' | sudo tee /etc/apt/apt.conf.d/99proxy
|
|
echo 'Acquire::https::Proxy "http://192.168.1.79:3142";' | sudo tee -a /etc/apt/apt.conf.d/99proxy
|
|
|
|
sudo apt update
|
|
sudo apt install -y sbuild schroot debootstrap
|
|
|
|
- name: Create deb-mock directories
|
|
run: |
|
|
sudo mkdir -p /var/lib/deb-mock/chroots /var/cache/deb-mock
|
|
sudo chown -R $USER:$USER /var/lib/deb-mock /var/cache/deb-mock
|
|
|
|
- name: Set up virtual environment
|
|
run: |
|
|
python3 -m venv venv
|
|
source venv/bin/activate
|
|
pip install --upgrade pip setuptools wheel
|
|
|
|
- name: Install dependencies
|
|
run: |
|
|
source venv/bin/activate
|
|
pip install -r requirements.txt
|
|
pip install -r requirements-dev.txt
|
|
|
|
- name: Install deb-mock in development mode
|
|
run: |
|
|
source venv/bin/activate
|
|
pip install -e .
|
|
|
|
- name: Test CLI interface
|
|
run: |
|
|
source venv/bin/activate
|
|
mock --help
|
|
mock --version
|
|
|
|
- name: Test configuration system
|
|
run: |
|
|
source venv/bin/activate
|
|
mock debug-config
|
|
mock list-configs
|
|
mock config
|
|
|
|
- name: Test package management commands
|
|
run: |
|
|
source venv/bin/activate
|
|
mock install-deps --help
|
|
mock install --help
|
|
mock update --help
|
|
mock remove --help
|
|
mock apt --help
|
|
|
|
- name: Test advanced build options
|
|
run: |
|
|
source venv/bin/activate
|
|
mock build --help
|
|
|
|
- name: Test chroot management
|
|
run: |
|
|
source venv/bin/activate
|
|
mock list-chroots
|
|
mock list-configs
|
|
|
|
- name: Test file operations
|
|
run: |
|
|
source venv/bin/activate
|
|
mock copyin --help
|
|
mock copyout --help
|
|
|
|
- name: Test shell access
|
|
run: |
|
|
source venv/bin/activate
|
|
mock shell --help
|
|
|
|
- name: Test cache management
|
|
run: |
|
|
source venv/bin/activate
|
|
mock cache-stats
|
|
mock cleanup-caches --help
|
|
|
|
- name: Test chain building
|
|
run: |
|
|
source venv/bin/activate
|
|
mock chain --help
|
|
|
|
- name: Test custom configuration
|
|
run: |
|
|
source venv/bin/activate
|
|
mock -c test-config.yaml debug-config
|
|
mock -c test-config.yaml config
|
|
|
|
- name: Run unit tests
|
|
run: |
|
|
source venv/bin/activate
|
|
python -m pytest tests/ -v
|
|
|
|
- name: Test package structure
|
|
run: |
|
|
source venv/bin/activate
|
|
python -c "import deb_mock; print('Deb-Mock imported successfully')"
|
|
python -c "from deb_mock.cli import main; print('CLI imported successfully')"
|
|
python -c "from deb_mock.core import DebMock; print('Core imported successfully')"
|
|
|
|
- name: Verify example package
|
|
run: |
|
|
source venv/bin/activate
|
|
echo "Checking examples directory:"
|
|
ls -la examples/ || echo "examples directory not found"
|
|
if [ -f examples/hello_1.0.dsc ]; then
|
|
echo "Example package found:"
|
|
cat examples/hello_1.0.dsc
|
|
else
|
|
echo "Example package not found"
|
|
exit 1
|
|
fi |