@@ -13,18 +13,16 @@ jobs:
1313 lint :
1414 runs-on : ubuntu-latest
1515 steps :
16- - name : Dump GitHub context
17- env :
18- GITHUB_CONTEXT : ${{ toJson(github) }}
19- run : echo "$GITHUB_CONTEXT"
2016 - uses : actions/checkout@v4
21- - name : Install the latest version of uv and set the python version to 3.13t
17+ - name : Install the latest version of uv
2218 uses : astral-sh/setup-uv@v5
2319 with :
24- enable-cache : true
25- python-version : 3.11
26- - name : Lint
27- run : uv run bash scripts/lint.sh
20+ enable-cache : true
21+ python-version : " 3.11"
22+ - name : Install tox
23+ run : uv tool install tox --with tox-uv --with tox-gh
24+ - name : Run lint
25+ run : tox -e lint
2826
2927 test :
3028 runs-on : ubuntu-latest
@@ -62,25 +60,64 @@ jobs:
6260 POSTGRES_HOST : localhost
6361 POSTGRES_PORT : 5432
6462 REDIS_HOST : redis://localhost:6379
63+ TOX_GH_MAJOR_MINOR : ${{ matrix.python-version }}
6564 steps :
66- - name : Dump GitHub context
67- env :
68- GITHUB_CONTEXT : ${{ toJson(github) }}
69- run : echo "$GITHUB_CONTEXT"
7065 - uses : actions/checkout@v4
71- - name : Install the latest version of uv and set the python version
66+ - name : Install the latest version of uv
7267 uses : astral-sh/setup-uv@v5
7368 with :
7469 enable-cache : true
7570 python-version : ${{ matrix.python-version }}
76- - run : mkdir coverage
77- - name : Test
78- run : uv run --group test --all-extras coverage run -m pytest sandbox
71+ - name : Install tox
72+ run : uv tool install tox --with tox-uv --with tox-gh
73+ - name : Run tests
74+ run : tox
75+
76+ coverage :
77+ runs-on : ubuntu-latest
78+ services :
79+ postgres :
80+ image : postgres
7981 env :
80- COVERAGE_FILE : coverage/.coverage.${{ runner.os }}-py${{ matrix.python-version }}
81- CONTEXT : ${{ runner.os }}-py${{ matrix.python-version }}
82- - name : Store coverage files
83- uses : actions/upload-artifact@v4
82+ POSTGRES_PASSWORD : chanx_test_pass
83+ POSTGRES_DB : chanx_test_db
84+ POSTGRES_USER : chanx_test_user
85+ options : >-
86+ --health-cmd pg_isready
87+ --health-interval 10s
88+ --health-timeout 5s
89+ --health-retries 5
90+ ports :
91+ - 5440:5432
92+ redis :
93+ image : redis
94+ options : >-
95+ --health-cmd "redis-cli ping"
96+ --health-interval 10s
97+ --health-timeout 5s
98+ --health-retries 5
99+ ports :
100+ - 6390:6379
101+ env :
102+ POSTGRES_DB : chanx_test_db
103+ POSTGRES_USER : chanx_test_user
104+ POSTGRES_PASSWORD : chanx_test_pass
105+ POSTGRES_HOST : localhost
106+ POSTGRES_PORT : 5440
107+ REDIS_HOST : redis://localhost:6390
108+ steps :
109+ - uses : actions/checkout@v4
110+ - name : Install the latest version of uv
111+ uses : astral-sh/setup-uv@v5
112+ with :
113+ enable-cache : true
114+ python-version : " 3.11"
115+ - name : Install tox
116+ run : uv tool install tox --with tox-uv --with tox-gh
117+ - name : Run coverage
118+ run : tox -e coverage
119+ - name : Upload coverage reports to Codecov
120+ uses : codecov/codecov-action@v5
84121 with :
85- name : coverage
86- path : coverage
122+ token : ${{ secrets.CODECOV_TOKEN }}
123+ slug : huynguyengl99/chanx
0 commit comments