82 lines
2.0 KiB
YAML
82 lines
2.0 KiB
YAML
name: CI
|
|
|
|
on:
|
|
push:
|
|
branches: [main, master]
|
|
pull_request:
|
|
branches: [main, master]
|
|
|
|
jobs:
|
|
lint:
|
|
runs-on: ubuntu-latest
|
|
container:
|
|
image: gitea-job-image
|
|
steps:
|
|
- name: Debug workspace
|
|
run: |
|
|
echo "=== Workspace contents ==="
|
|
ls -la /workspace/
|
|
ls -la /workspace/jarianc/ 2>/dev/null || echo "No jarianc dir"
|
|
ls -la /workspace/jarianc/youtube-cli/ 2>/dev/null || echo "No youtube-cli dir"
|
|
echo "=== GITHUB_WORKSPACE ==="
|
|
echo "$GITHUB_WORKSPACE"
|
|
echo "=== GITHUB_SHA ==="
|
|
echo "$GITHUB_SHA"
|
|
ls -la .
|
|
|
|
- name: Install dependencies
|
|
run: |
|
|
python3 -m pip install --upgrade pip
|
|
pip3 install ruff mypy
|
|
pip3 install -e ".[dev]"
|
|
|
|
- name: Run ruff
|
|
run: ruff check .
|
|
|
|
- name: Run mypy
|
|
run: mypy youtube_tui/
|
|
|
|
test:
|
|
runs-on: ubuntu-latest
|
|
container:
|
|
image: gitea-job-image
|
|
steps:
|
|
- name: Install dependencies
|
|
run: |
|
|
python3 -m pip install --upgrade pip
|
|
pip3 install -e ".[dev]"
|
|
pip3 install -r requirements-api.txt
|
|
|
|
- name: Run pytest
|
|
run: python3 -m pytest tests/ web/server/tests/ -v --tb=short
|
|
|
|
docker-build:
|
|
runs-on: ubuntu-latest
|
|
container:
|
|
image: gitea-job-image
|
|
options: --privileged -v /var/run/docker.sock:/var/run/docker.sock
|
|
steps:
|
|
- name: Build Docker image
|
|
run: |
|
|
docker build -t youtube-cli:test --no-cache .
|
|
|
|
security:
|
|
runs-on: ubuntu-latest
|
|
container:
|
|
image: gitea-job-image
|
|
steps:
|
|
- name: Run bandit (Python SAST)
|
|
run: |
|
|
pip3 install bandit
|
|
bandit -r youtube_cli/ youtube_tui/ web/server/ -ll
|
|
|
|
build-result:
|
|
needs: [lint, test, docker-build, security]
|
|
runs-on: ubuntu-latest
|
|
container:
|
|
image: gitea-job-image
|
|
if: always()
|
|
steps:
|
|
- name: Summary
|
|
run: echo "All CI checks completed"
|