Skip to content

Commit 0338da7

Browse files
committed
Update to test
1 parent 1c2fe52 commit 0338da7

File tree

1 file changed

+14
-18
lines changed

1 file changed

+14
-18
lines changed

.github/workflows/pytest.yml

Lines changed: 14 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,15 @@
11
# Workflow for running tests on server code
2-
name: Test Server
2+
name: Run Tests
33

44
on:
55
pull_request:
6-
types:
6+
types:
77
- opened
88
- synchronize
99
- reopened
1010
paths:
11-
- 'src/server/**'
12-
- 'src/sandbox/**'
11+
- "src/server/**"
12+
- "src/sandbox/**"
1313

1414
# Allows running this workflow manually
1515
workflow_dispatch:
@@ -19,6 +19,8 @@ jobs:
1919
runs-on: ubuntu-latest
2020
steps:
2121
- uses: actions/checkout@v4
22+
with:
23+
fetch-depth: 2
2224
- uses: actions/setup-python@v5
2325
with:
2426
python-version: "3.11"
@@ -35,33 +37,27 @@ jobs:
3537
run: |
3638
CHANGED_FILES=$(git diff --name-only ${{ github.event.pull_request.base.sha }} ${{ github.event.pull_request.head.sha }})
3739
echo "Changed files: $CHANGED_FILES"
38-
40+
3941
if echo "$CHANGED_FILES" | grep -q '^src/sandbox/'; then
4042
echo "client=true" >> $GITHUB_ENV
4143
fi
42-
44+
4345
if echo "$CHANGED_FILES" | grep -q '^src/server/'; then
4446
echo "server=true" >> $GITHUB_ENV
4547
fi
4648
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'
5551
run: |
5652
cd src/
5753
pytest server
5854
59-
- name: Run all tests
60-
if: env.client == 'true' && env.server == 'true'
55+
- name: Run Client Tests
56+
if: env.client == 'true'
6157
run: |
6258
cd src/
63-
pytest
59+
pytest sandbox
6460
6561
# Block merging if the job fails
6662
permissions:
67-
pull-requests: write
63+
pull-requests: write

0 commit comments

Comments
 (0)