File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ # This workflow will install Python dependencies, run tests with a single version of Python
2+ # For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-python
3+
4+ name : Python application
5+
6+ on :
7+ push :
8+ branches : [ "dev", "main" ]
9+ pull_request :
10+ branches : [ "dev", "main" ]
11+
12+ permissions :
13+ contents : read
14+
15+ jobs :
16+ test :
17+ runs-on : ubuntu-latest
18+
19+ services :
20+ postgres :
21+ image : postgres:18
22+ env :
23+ POSTGRES_DB : coursereview
24+ POSTGRES_USER : admin
25+ POSTGRES_PASSWORD : test
26+ ports :
27+ - 5432:5432
28+ options : >-
29+ --health-cmd pg_isready
30+ --health-interval 10s
31+ --health-timeout 5s
32+ --health-retries 5
33+
34+ steps :
35+ - uses : actions/checkout@v6
36+
37+ - name : Install python
38+ uses : actions/setup-python@v6
39+ with :
40+ python-version-file : " pyproject.toml"
41+
42+ - name : Install uv
43+ uses : astral-sh/setup-uv@v7
44+ with :
45+ enable-cache : true
46+ version : " 0.10.7"
47+
48+ - name : Install the project
49+ run : uv sync --group dev
50+
51+ - name : Test with pytest
52+ env :
53+ DATABASE__URL : postgres://admin:test@localhost:5432/coursereview
54+ SECRET_KEY : 02247f40-a769-4c49-9178-4c038048e7ad
55+ run : |
56+ uv run pytest
You can’t perform that action at this time.
0 commit comments