Fix CI for Gitea act_runner: python3 and local docker build.
CI / lint-and-test (pull_request) Failing after 7s
CI / security-scan (pull_request) Failing after 6s
CI / dependency-scan (pull_request) Successful in 13s
CI / docker-build-test (pull_request) Successful in 45s
CI / workflow-summary (pull_request) Successful in 4s
CI / lint-and-test (pull_request) Failing after 7s
CI / security-scan (pull_request) Failing after 6s
CI / dependency-scan (pull_request) Successful in 13s
CI / docker-build-test (pull_request) Successful in 45s
CI / workflow-summary (pull_request) Successful in 4s
Use python3 instead of unavailable python3.11 packages, drop apt step that failed on runner image, and replace buildx with docker build so the test step can run the built image.
This commit is contained in:
+12
-27
@@ -28,15 +28,10 @@ jobs:
|
||||
- name: Check out code
|
||||
uses: actions/checkout@v4
|
||||
|
||||
- name: Install system dependencies
|
||||
run: |
|
||||
sudo apt-get update
|
||||
sudo apt-get install -y postgresql-client python3.11 python3.11-venv python3-pip
|
||||
|
||||
- name: Install Python dependencies
|
||||
run: |
|
||||
pip install --upgrade pip
|
||||
pip install -e ".[dev]"
|
||||
python3 -m pip install --upgrade pip
|
||||
python3 -m pip install -e ".[dev]"
|
||||
|
||||
- name: Run linters
|
||||
run: |
|
||||
@@ -56,7 +51,7 @@ jobs:
|
||||
SMTP_PASSWORD: ${{ secrets.SMTP_PASSWORD || 'dummy' }}
|
||||
FROM_EMAIL: ${{ secrets.FROM_EMAIL || 'test@example.com' }}
|
||||
run: |
|
||||
pytest tests/ -v --cov=src/pote --cov-report=term --cov-report=xml
|
||||
python3 -m pytest tests/ -v --cov=src/pote --cov-report=term --cov-report=xml
|
||||
|
||||
- name: Test scripts
|
||||
env:
|
||||
@@ -75,19 +70,19 @@ jobs:
|
||||
|
||||
- name: Install dependencies
|
||||
run: |
|
||||
python3.11 -m pip install --upgrade pip
|
||||
python3.11 -m pip install safety bandit
|
||||
python3 -m pip install --upgrade pip
|
||||
python3 -m pip install safety bandit
|
||||
|
||||
- name: Run safety check
|
||||
run: |
|
||||
python3.11 -m pip install -e .
|
||||
python3.11 -m safety check --json || true
|
||||
python3 -m pip install -e .
|
||||
python3 -m safety check --json || true
|
||||
continue-on-error: true
|
||||
|
||||
- name: Run bandit security scan
|
||||
run: |
|
||||
python3.11 -m bandit -r src/ -f json -o bandit-report.json || true
|
||||
python3.11 -m bandit -r src/ -f screen
|
||||
python3 -m bandit -r src/ -f json -o bandit-report.json || true
|
||||
python3 -m bandit -r src/ -f screen
|
||||
continue-on-error: true
|
||||
|
||||
dependency-scan:
|
||||
@@ -111,20 +106,10 @@ jobs:
|
||||
- name: Check out code
|
||||
uses: actions/checkout@v4
|
||||
|
||||
- name: Set up Docker Buildx
|
||||
uses: docker/setup-buildx-action@v3
|
||||
|
||||
- name: Build Docker image
|
||||
uses: docker/build-push-action@v5
|
||||
with:
|
||||
context: .
|
||||
push: false
|
||||
tags: pote:test
|
||||
cache-from: type=gha
|
||||
cache-to: type=gha,mode=max
|
||||
|
||||
- name: Test Docker image
|
||||
- name: Build and test Docker image
|
||||
run: |
|
||||
# Plain docker build — buildx images are not visible to act_runner's docker run
|
||||
docker build -t pote:test .
|
||||
docker run --rm pote:test python -c "import pote; print('POTE import successful')"
|
||||
|
||||
workflow-summary:
|
||||
|
||||
Reference in New Issue
Block a user