Skip to content

[c] Test

[c] Test #19

Workflow file for this run

name: Test
on:
push:
branches:
- main
pull_request:
types:
- opened
- synchronize
jobs:
lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Install the latest version of uv
uses: astral-sh/setup-uv@v5
with:
enable-cache: true
python-version: "3.11"
- name: Install tox
run: uv tool install tox --with tox-uv --with tox-gh
- name: Run lint
run: tox -e lint
# test:
# runs-on: ubuntu-latest
# strategy:
# matrix:
# python-version: ["3.11", "3.12", "3.13"]
# fail-fast: false
# services:
# postgres:
# image: postgres
# env:
# POSTGRES_PASSWORD: chanx_test_pass
# POSTGRES_DB: chanx_test_db
# POSTGRES_USER: chanx_test_user
# options: >-
# --health-cmd pg_isready
# --health-interval 10s
# --health-timeout 5s
# --health-retries 5
# ports:
# - 5432:5432
# redis:
# image: redis
# options: >-
# --health-cmd "redis-cli ping"
# --health-interval 10s
# --health-timeout 5s
# --health-retries 5
# ports:
# - 6379:6379
# env:
# POSTGRES_DB: chanx_test_db
# POSTGRES_USER: chanx_test_user
# POSTGRES_PASSWORD: chanx_test_pass
# POSTGRES_HOST: localhost
# POSTGRES_PORT: 5432
# REDIS_HOST: redis://localhost:6379
# TOX_GH_MAJOR_MINOR: ${{ matrix.python-version }}
# steps:
# - uses: actions/checkout@v4
# - name: Install the latest version of uv
# uses: astral-sh/setup-uv@v5
# with:
# enable-cache: true
# python-version: ${{ matrix.python-version }}
# - name: Install tox
# run: uv tool install tox --with tox-uv --with tox-gh
# - name: Run tests
# run: tox
#
coverage:
runs-on: ubuntu-latest
services:
postgres:
image: postgres
env:
POSTGRES_PASSWORD: chanx_test_pass
POSTGRES_DB: chanx_test_db
POSTGRES_USER: chanx_test_user
options: >-
--health-cmd pg_isready
--health-interval 10s
--health-timeout 5s
--health-retries 5
ports:
- 5440:5432
redis:
image: redis
options: >-
--health-cmd "redis-cli ping"
--health-interval 10s
--health-timeout 5s
--health-retries 5
ports:
- 6390:6379
env:
POSTGRES_DB: chanx_test_db
POSTGRES_USER: chanx_test_user
POSTGRES_PASSWORD: chanx_test_pass
POSTGRES_HOST: localhost
POSTGRES_PORT: 5440
REDIS_HOST: redis://localhost:6390
steps:
- uses: actions/checkout@v4
- name: Install the latest version of uv
uses: astral-sh/setup-uv@v5
with:
enable-cache: true
python-version: "3.11"
- name: Install tox
run: uv tool install tox --with tox-uv --with tox-gh
- name: Run coverage
run: tox -e coverage
- name: Upload coverage reports to Codecov
uses: codecov/codecov-action@v5
with:
token: ${{ secrets.CODECOV_TOKEN }}
slug: huynguyengl99/chanx