@@ -18,19 +18,22 @@ jobs:
1818 GITHUB_CONTEXT : ${{ toJson(github) }}
1919 run : echo "$GITHUB_CONTEXT"
2020 - uses : actions/checkout@v4
21- - name : Install the latest version of uv and set the python version to 3.13t
21+ - name : Install the latest version of uv and set the python version
2222 uses : astral-sh/setup-uv@v5
2323 with :
2424 enable-cache : true
2525 python-version : 3.11
26- - name : Lint
27- run : uv run bash scripts/lint.sh
26+ - name : Install tox with uv
27+ run : uv tool install tox --with tox-uv
28+ - name : Run lint with tox
29+ run : tox -e lint
2830
2931 test :
3032 runs-on : ubuntu-latest
3133 strategy :
3234 matrix :
3335 python-version : ["3.11", "3.12", "3.13"]
36+ django-version : ["5"]
3437 fail-fast : false
3538 services :
3639 postgres :
@@ -73,14 +76,61 @@ jobs:
7376 with :
7477 enable-cache : true
7578 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
79+ - name : Install tox with uv
80+ run : uv tool install tox --with tox-uv
81+ - name : Run tests with tox
82+ run : tox -e py${{ matrix.python-version }}-django${{ matrix.django-version }}
83+
84+ coverage :
85+ runs-on : ubuntu-latest
86+ services :
87+ postgres :
88+ image : postgres
89+ env :
90+ POSTGRES_PASSWORD : chanx_test_pass
91+ POSTGRES_DB : chanx_test_db
92+ POSTGRES_USER : chanx_test_user
93+ options : >-
94+ --health-cmd pg_isready
95+ --health-interval 10s
96+ --health-timeout 5s
97+ --health-retries 5
98+ ports :
99+ - 5432:5432
100+ redis :
101+ image : redis
102+ options : >-
103+ --health-cmd "redis-cli ping"
104+ --health-interval 10s
105+ --health-timeout 5s
106+ --health-retries 5
107+ ports :
108+ - 6379:6379
109+ env :
110+ POSTGRES_DB : chanx_test_db
111+ POSTGRES_USER : chanx_test_user
112+ POSTGRES_PASSWORD : chanx_test_pass
113+ POSTGRES_HOST : localhost
114+ POSTGRES_PORT : 5432
115+ REDIS_HOST : redis://localhost:6379
116+ steps :
117+ - name : Dump GitHub context
79118 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
119+ GITHUB_CONTEXT : ${{ toJson(github) }}
120+ run : echo "$GITHUB_CONTEXT"
121+ - uses : actions/checkout@v4
122+ - name : Install the latest version of uv and set the python version
123+ uses : astral-sh/setup-uv@v5
124+ with :
125+ enable-cache : true
126+ python-version : " 3.11"
127+ - name : Install tox with uv
128+ run : uv tool install tox --with tox-uv
129+ - name : Run coverage with tox
130+ run : tox -e coverage
131+ - name : Upload coverage reports to Codecov
132+ uses : codecov/codecov-action@v4
84133 with :
85- name : coverage
86- path : coverage
134+ token : ${{ secrets.CODECOV_TOKEN }}
135+ file : ./coverage.xml
136+ fail_ci_if_error : false
0 commit comments