Skip to content

Commit 316e3ff

Browse files
authored
fix readme (#1)
* fix readme * fix readme * Update preview-deployment.yml * Update backend-app.yml * Update frontend-app.yml * Update preview-deployment.yml * Update backend-app.yml * Update frontend-app.yml * Update backend-app.yml * Update frontend-app.yml * Update backend-app.yml * Update frontend-app.yml * change uv installation method * ci.yml * Update preview-deployment.yml * changes to ci.yml * debug ci * change .env sample * Update backend-app.yml * Update backend-app.yml * Update frontend-app.yml * Update backend-app.yml * Update backend-app.yml * Update frontend-app.yml * Update backend-app.yml * Update frontend-app.yml * Update backend-app.yml * Update frontend-app.yml
1 parent 06d8a2b commit 316e3ff

19 files changed

Lines changed: 116 additions & 60 deletions

.env.sample

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1 @@
1-
# set API TOKEN so that the cli is authorized to use the public api
2-
CS_TOKEN=
3-
TEAM_ID=
1+
export TEAM_ID=$(cs list workspaces | grep $WORKSPACE_ID | awk '{print $2}')

.github/workflows/backend-app.yml

Lines changed: 9 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
1-
name: Python server tests
1+
name: Python backend server tests
22

33
on:
44
pull_request:
55
types: [opened, synchronize, reopened, ready_for_review, draft]
66
paths:
7-
- 'server/**'
7+
- 'backend/**'
88
- '.github/workflows/backend-app.yml'
99

1010
permissions:
@@ -15,9 +15,6 @@ jobs:
1515
pytest:
1616
runs-on: ubuntu-latest
1717

18-
env:
19-
UV_CACHE_DIR: ${{ github.workspace }}/backend/.uv_cache
20-
2118
permissions:
2219
contents: read
2320
pull-requests: write
@@ -29,18 +26,15 @@ jobs:
2926
- name: Install uv package manager
3027
uses: astral-sh/setup-uv@v6
3128
with:
32-
enable-cache: true
33-
cache-dependency-glob: backend/uv.lock
3429
activate-environment: true
3530
working-directory: backend
36-
cache-local-path: ${{ github.workspace }}/backend/.uv_cache
3731

3832
- name: Install dependencies using uv
3933
run: |
40-
cd server && uv sync
34+
cd backend && uv sync
4135
shell: bash
4236

43-
- name: Run Bandit security check on server code
37+
- name: Run Bandit security check on backend code
4438
id: bandit_check
4539
run: |
4640
echo "Running Bandit security check..."
@@ -61,7 +55,7 @@ jobs:
6155
COMMENT_BODY_FILE="bandit-comment-body.md"
6256
echo "COMMENT_BODY_FILE=${COMMENT_BODY_FILE}" >> $GITHUB_ENV
6357
64-
echo "### 🛡️ Bandit Security Scan Results" > $COMMENT_BODY_FILE
58+
echo "### 🛡️ Bandit Backend Security Scan Results" > $COMMENT_BODY_FILE
6559
echo "" >> $COMMENT_BODY_FILE
6660
echo "" >> $COMMENT_BODY_FILE
6761
echo "" >> $COMMENT_BODY_FILE
@@ -81,7 +75,7 @@ jobs:
8175
with:
8276
issue-number: ${{ github.event.pull_request.number }}
8377
comment-author: 'github-actions[bot]'
84-
body-includes: Bandit Security Scan Results
78+
body-includes: Bandit Backend Security Scan Results
8579

8680
- name: Post Bandit results as PR comment
8781
if: github.event_name == 'pull_request' && always()
@@ -104,11 +98,12 @@ jobs:
10498
if: github.event_name == 'pull_request' && always()
10599
uses: MishaKav/pytest-coverage-comment@main
106100
with:
101+
unique-id-for-comment: backend-coverage-report
107102
pytest-xml-coverage-path: backend/coverage.xml
108103
pytest-coverage-path: backend/pytest-coverage.txt
109104
junitxml-path: backend/junit/test-results.xml
110-
title: Pytest Coverage Report
111-
junitxml-title: Test Execution Summary
105+
title: Pytest Coverage Report - Backend
106+
junitxml-title: Test Execution Summary - Backend
112107

113108
- name: Minimize uv cache
114109
run: uv cache prune --ci

.github/workflows/frontend-app.yml

Lines changed: 12 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
1-
name: Python server tests
1+
name: Python frontend server tests
22

33
on:
44
pull_request:
55
types: [opened, synchronize, reopened, ready_for_review, draft]
66
paths:
7-
- 'server/**'
8-
- '.github/workflows/python-app.yml'
7+
- 'frontend/**'
8+
- '.github/workflows/frontend-app.yml'
99

1010
permissions:
1111
contents: write
@@ -15,9 +15,6 @@ jobs:
1515
pytest:
1616
runs-on: ubuntu-latest
1717

18-
env:
19-
UV_CACHE_DIR: ${{ github.workspace }}/frontend/.uv_cache
20-
2118
permissions:
2219
contents: read
2320
pull-requests: write
@@ -34,7 +31,7 @@ jobs:
3431

3532
- name: Install dependencies using uv
3633
run: |
37-
cd server && uv sync
34+
cd frontend && uv sync
3835
shell: bash
3936

4037
- name: Run Bandit security check on server code
@@ -58,7 +55,7 @@ jobs:
5855
COMMENT_BODY_FILE="bandit-comment-body.md"
5956
echo "COMMENT_BODY_FILE=${COMMENT_BODY_FILE}" >> $GITHUB_ENV
6057
61-
echo "### 🛡️ Bandit Security Scan Results" > $COMMENT_BODY_FILE
58+
echo "### 🛡️ Bandit Frontend Security Scan Results" > $COMMENT_BODY_FILE
6259
echo "" >> $COMMENT_BODY_FILE
6360
echo "" >> $COMMENT_BODY_FILE
6461
echo "" >> $COMMENT_BODY_FILE
@@ -78,7 +75,7 @@ jobs:
7875
with:
7976
issue-number: ${{ github.event.pull_request.number }}
8077
comment-author: 'github-actions[bot]'
81-
body-includes: Bandit Security Scan Results
78+
body-includes: Bandit Frontend Security Scan Results
8279

8380
- name: Post Bandit results as PR comment
8481
if: github.event_name == 'pull_request' && always()
@@ -101,11 +98,12 @@ jobs:
10198
if: github.event_name == 'pull_request' && always()
10299
uses: MishaKav/pytest-coverage-comment@main
103100
with:
104-
pytest-xml-coverage-path: server/coverage.xml
105-
pytest-coverage-path: server/pytest-coverage.txt
106-
junitxml-path: server/junit/test-results.xml
107-
title: Pytest Coverage Report
108-
junitxml-title: Test Execution Summary
101+
unique-id-for-comment: frontend-coverage-report
102+
pytest-xml-coverage-path: frontend/coverage.xml
103+
pytest-coverage-path: frontend/pytest-coverage.txt
104+
junitxml-path: frontend/junit/test-results.xml
105+
title: Pytest Coverage Report - Frontend
106+
junitxml-title: Test Execution Summary - Frontend
109107

110108
- name: Minimize uv cache
111109
run: uv cache prune --ci

.github/workflows/preview-deployment.yml

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,6 @@ permissions:
1212
pull-requests: read
1313
deployments: write
1414

15-
env:
16-
ON_DEMAND='true'
17-
WORKSPACE_PLAN='Boost'
18-
1915
jobs:
2016
deploy:
2117
concurrency: codesphere
@@ -32,5 +28,8 @@ jobs:
3228
email: ${{ secrets.CODESPHERE_EMAIL }}
3329
password: ${{ secrets.CODESPHERE_PASSWORD }}
3430
team: ${{ secrets.CODESPHERE_TEAM }}
35-
plan: $WORKSPACE_PLAN
36-
onDemand: $ON_DEMAND
31+
plan: 'Boost'
32+
onDemand: 'true'
33+
env: |
34+
TEAM_ID=${{ secrets.CODESPHERE_TEAM_ID }}
35+
CS_TOKEN=${{ secrets.CODESPHERE_TOKEN }}

.gitignore

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
11
.env
2+
env
3+
env.fish
24

35
.github/*
6+
7+
uv
8+
uvx

README.md

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1 @@
1-
# python-demo
2-
# python-demo
1+
# python-demo test

backend/.gitignore

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,7 @@ coverage.xml
33
pytest-coverage.txt
44
.coverage
55

6-
__pycache__/*
6+
__pycache__/*
7+
tests/__pycache__/*
8+
9+
bandit-results.txt

backend/pyproject.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ dependencies = [
99
"numpy>=2.3.0",
1010
"pandas>=2.3.0",
1111
"pytest-cov>=6.1.1",
12+
"pytest-profiling>=1.8.1",
1213
]
1314

1415
[dependency-groups]
-7.93 KB
Binary file not shown.

backend/tests/conftest.py

Whitespace-only changes.

0 commit comments

Comments
 (0)