add Gitea Actions CI workflow
This commit is contained in:
parent
372defe30b
commit
d580d6b804
81
.gitea/workflows/ci.yml
Normal file
81
.gitea/workflows/ci.yml
Normal file
@ -0,0 +1,81 @@
|
||||
name: CI
|
||||
|
||||
on:
|
||||
push:
|
||||
branches: [main, master]
|
||||
pull_request:
|
||||
branches: [main, master]
|
||||
|
||||
jobs:
|
||||
lint:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: gitea/checkout@v2
|
||||
|
||||
- name: Set up Python
|
||||
uses: gitea/setup-python@v2
|
||||
with:
|
||||
python-version: "3.11"
|
||||
|
||||
- name: Install dependencies
|
||||
run: |
|
||||
python -m pip install --upgrade pip
|
||||
pip install ruff mypy
|
||||
pip install -e ".[dev]"
|
||||
|
||||
- name: Run ruff
|
||||
run: ruff check .
|
||||
|
||||
- name: Run mypy
|
||||
run: mypy youtube_tui/
|
||||
|
||||
test:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: gitea/checkout@v2
|
||||
|
||||
- name: Set up Python
|
||||
uses: gitea/setup-python@v2
|
||||
with:
|
||||
python-version: "3.11"
|
||||
|
||||
- name: Install dependencies
|
||||
run: |
|
||||
python -m pip install --upgrade pip
|
||||
pip install -e ".[dev]"
|
||||
pip install -r requirements-api.txt
|
||||
|
||||
- name: Run pytest
|
||||
run: python -m pytest tests/ web/server/tests/ -v --tb=short
|
||||
|
||||
docker-build:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: gitea/checkout@v2
|
||||
|
||||
- name: Build Docker image
|
||||
run: |
|
||||
docker build -t youtube-cli:test --no-cache .
|
||||
|
||||
security:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: gitea/checkout@v2
|
||||
|
||||
- name: Set up Python
|
||||
uses: gitea/setup-python@v2
|
||||
with:
|
||||
python-version: "3.11"
|
||||
|
||||
- name: Run bandit (Python SAST)
|
||||
run: |
|
||||
pip install bandit
|
||||
bandit -r youtube_cli/ youtube_tui/ web/server/ -ll
|
||||
|
||||
build-result:
|
||||
needs: [lint, test, docker-build, security]
|
||||
runs-on: ubuntu-latest
|
||||
if: always()
|
||||
steps:
|
||||
- name: Summary
|
||||
run: echo "All CI checks completed"
|
||||
Loading…
x
Reference in New Issue
Block a user