File tree Expand file tree Collapse file tree 1 file changed +14
-18
lines changed Expand file tree Collapse file tree 1 file changed +14
-18
lines changed Original file line number Diff line number Diff line change 1
1
# Workflow for running tests on server code
2
- name : Test Server
2
+ name : Run Tests
3
3
4
4
on :
5
5
pull_request :
6
- types :
6
+ types :
7
7
- opened
8
8
- synchronize
9
9
- reopened
10
10
paths :
11
- - ' src/server/**'
12
- - ' src/sandbox/**'
11
+ - " src/server/**"
12
+ - " src/sandbox/**"
13
13
14
14
# Allows running this workflow manually
15
15
workflow_dispatch :
19
19
runs-on : ubuntu-latest
20
20
steps :
21
21
- uses : actions/checkout@v4
22
+ with :
23
+ fetch-depth : 2
22
24
- uses : actions/setup-python@v5
23
25
with :
24
26
python-version : " 3.11"
@@ -35,33 +37,27 @@ jobs:
35
37
run : |
36
38
CHANGED_FILES=$(git diff --name-only ${{ github.event.pull_request.base.sha }} ${{ github.event.pull_request.head.sha }})
37
39
echo "Changed files: $CHANGED_FILES"
38
-
40
+
39
41
if echo "$CHANGED_FILES" | grep -q '^src/sandbox/'; then
40
42
echo "client=true" >> $GITHUB_ENV
41
43
fi
42
-
44
+
43
45
if echo "$CHANGED_FILES" | grep -q '^src/server/'; then
44
46
echo "server=true" >> $GITHUB_ENV
45
47
fi
46
48
47
- - name : Run client tests
48
- if : env.client == 'true' && env.server != 'true'
49
- run : |
50
- cd src/
51
- pytest sandbox
52
-
53
- - name : Run server tests
54
- if : env.server == 'true' && env.client != 'true'
49
+ - name : Run Server Tests
50
+ if : env.server == 'true'
55
51
run : |
56
52
cd src/
57
53
pytest server
58
54
59
- - name : Run all tests
60
- if : env.client == 'true' && env.server == 'true'
55
+ - name : Run Client Tests
56
+ if : env.client == 'true'
61
57
run : |
62
58
cd src/
63
- pytest
59
+ pytest sandbox
64
60
65
61
# Block merging if the job fails
66
62
permissions :
67
- pull-requests : write
63
+ pull-requests : write
You can’t perform that action at this time.
0 commit comments