Skip to content

refactor: remove unused max_retries parameter and update task imports #30

refactor: remove unused max_retries parameter and update task imports

refactor: remove unused max_retries parameter and update task imports #30

Workflow file for this run

name: CI
on:
push:
branches: [main, develop]
pull_request:
branches: [main, develop]
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
env:
PYTHON_VERSION: "3.12"
UV_VERSION: "latest"
jobs:
lint:
name: Lint
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
- name: Install uv
uses: astral-sh/setup-uv@v4
with:
version: ${{ env.UV_VERSION }}
- name: Set up Python
run: uv python install ${{ env.PYTHON_VERSION }}
- name: Install dependencies
run: uv sync --frozen
- name: Ruff check
run: uv run ruff check .
- name: Ruff format check
run: uv run ruff format --check .
test:
name: Test
runs-on: ubuntu-latest
needs: lint
services:
redis:
image: redis:8-alpine
ports:
- 6379:6379
options: >-
--health-cmd "redis-cli ping"
--health-interval 10s
--health-timeout 5s
--health-retries 5
steps:
- uses: actions/checkout@v6
- name: Install uv
uses: astral-sh/setup-uv@v4
with:
version: ${{ env.UV_VERSION }}
- name: Set up Python
run: uv python install ${{ env.PYTHON_VERSION }}
- name: Install dependencies
run: uv sync --frozen
- name: Run tests with coverage
env:
REDIS_HOST: localhost
REDIS_PORT: 6379
REDIS_DB: 0
run: |
uv run pytest \
--cov=app \
--cov-report=term-missing \
--cov-report=xml:coverage.xml \
-v
- name: Upload coverage
if: always()
uses: actions/upload-artifact@v4
with:
name: coverage-report
path: coverage.xml
docker-build:
name: Docker Build
runs-on: ubuntu-latest
needs: test
steps:
- uses: actions/checkout@v6
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Build dev image
uses: docker/build-push-action@v6
with:
context: .
file: docker/Dockerfile
target: dev
push: false
tags: langcore:dev-${{ github.sha }}
cache-from: type=gha
cache-to: type=gha,mode=max
- name: Build production image
uses: docker/build-push-action@v6
with:
context: .
file: docker/Dockerfile
target: production
push: false
tags: langcore:prod-${{ github.sha }}
cache-from: type=gha
cache-to: type=gha,mode=max