Skip to content

Update actions/setup-python action to v5 #273

Update actions/setup-python action to v5

Update actions/setup-python action to v5 #273

Workflow file for this run

name: CI
on: [push]
jobs:
python-tests:
runs-on: ubuntu-latest
services:
# Label used to access the service container
db:
# Docker Hub image
image: postgres:16
# Set health checks to wait until postgres has started
options: >-
--health-cmd pg_isready
--health-interval 10s
--health-timeout 5s
--health-retries 5
env:
POSTGRES_USER: postgres
POSTGRES_PASSWORD: postgres # pragma: allowlist secret
POSTGRES_DB: postgres
ports:
- 5432:5432
redis:
image: redis:5.0.14
ports:
- 6379:6379
steps:
- uses: actions/checkout@v3
- name: update apt
run: sudo apt-get update -y
- name: Apt install
run: cat Aptfile | sudo xargs apt-get install
- name: Install poetry
uses: snok/install-poetry@v1
with:
version: 1.5.1
virtualenvs-create: true
virtualenvs-in-project: true
- uses: actions/setup-python@v5
with:
python-version: "3.12.1"
cache: "poetry"
- name: Validate lockfile
run: poetry lock --check
- name: Install dependencies
run: poetry install --no-interaction
- name: Lint
run: poetry run ruff --extend-ignore=D1 $(git ls-files '*.py')
- name: Tests
run: |
export MEDIA_ROOT="$(mktemp -d)"
./scripts/test/python_tests.sh
env:
DATABASE_URL: postgres://postgres:postgres@localhost:5432/postgres # pragma: allowlist secret
CELERY_TASK_ALWAYS_EAGER: "True"
CELERY_BROKER_URL: redis://localhost:6379/4
CELERY_RESULT_BACKEND: redis://localhost:6379/4
MITOL_UE_COOKIE_NAME: "mitolue"
MITOL_UE_COOKIE_DOMAIN: "odl.local"
MITOL_UE_BASE_URL: "http://localhost:8073"
MITOL_UE_HOSTNAME: "ue.odl.local"
MITOL_UE_JWT_SECRET: ""
MITOL_UE_USE_S3: "False"
MITOL_UE_DB_DISABLE_SSL: "True"
- name: Upload coverage to CodeCov
uses: codecov/[email protected]
with:
file: ./coverage.xml