11
11
workflow_dispatch :
12
12
13
13
jobs :
14
- # Determine if the user is a bot
14
+ # Skip all checks for bot users
15
15
bot-check :
16
16
runs-on : ubuntu-latest
17
17
outputs :
20
20
- name : Check if user is bot
21
21
id : check_bot
22
22
run : |
23
+ echo "Actor: ${{ github.triggering_actor }}"
23
24
if [[ "${{ github.triggering_actor }}" == "codegen-sh[bot]" ]]; then
24
25
echo "is_bot=true" >> $GITHUB_OUTPUT
25
26
echo "Bot user detected: ${{ github.triggering_actor }}"
28
29
echo "Regular user detected: ${{ github.triggering_actor }}"
29
30
fi
30
31
31
- # Access check job - only runs for non-bot users
32
+ # Run unit tests directly for bot users
33
+ bot-unit-tests :
34
+ needs : bot-check
35
+ if : needs.bot-check.outputs.is_bot == 'true'
36
+ runs-on : ubuntu-latest-8
37
+ steps :
38
+ - uses : actions/checkout@v4
39
+ with :
40
+ fetch-depth : 0
41
+ ref : ${{ github.event.pull_request.head.sha }}
42
+
43
+ - name : Setup environment
44
+ uses : ./.github/actions/setup-environment
45
+
46
+ - name : Test with pytest
47
+ timeout-minutes : 5
48
+ run : |
49
+ uv run pytest \
50
+ -n auto \
51
+ --cov src \
52
+ --timeout 15 \
53
+ -o junit_suite_name="${{github.job}}" \
54
+ tests/unit
55
+
56
+ - uses : ./.github/actions/report
57
+ with :
58
+ flag : unit-tests
59
+ codecov_token : ${{ secrets.CODECOV_TOKEN }}
60
+
61
+ # Access check for non-bot users
32
62
access-check :
33
63
needs : bot-check
34
64
if : needs.bot-check.outputs.is_bot != 'true'
@@ -40,13 +70,10 @@ jobs:
40
70
username : ${{ github.triggering_actor }}
41
71
error-if-missing : true
42
72
43
- # Unit tests - runs for both bot and non-bot users with appropriate permissions
73
+ # Unit tests for non-bot users
44
74
unit-tests :
45
- needs : [bot-check]
46
- if : |
47
- always() &&
48
- (needs.bot-check.outputs.is_bot == 'true' ||
49
- (needs.bot-check.outputs.is_bot != 'true' && needs.access-check.result == 'success'))
75
+ needs : [bot-check, access-check]
76
+ if : needs.bot-check.outputs.is_bot != 'true'
50
77
runs-on : ubuntu-latest-8
51
78
steps :
52
79
- uses : actions/checkout@v4
0 commit comments