-
Notifications
You must be signed in to change notification settings - Fork 3
110 lines (102 loc) · 3.3 KB
/
e2e.yml
File metadata and controls
110 lines (102 loc) · 3.3 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
name: Nightly E2E Tests
on:
schedule:
- cron: '0 3 * * *' # Run nightly at 03:00 UTC
workflow_dispatch: {}
push:
paths:
- '.github/workflows/e2e.yml'
permissions:
contents: write
issues: write
pull-requests: write
actions: write
jobs:
clean:
runs-on: ubuntu-latest
name: "Clean test resources"
steps:
- name: Checkout
uses: actions/checkout@v4
- name: GitHub CLI - show auth status
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
gh auth status
- name: Run cleanup script
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
chmod +x ./clean.sh
./clean.sh
- name: Upload cleanup log artifact
if: always()
uses: actions/upload-artifact@v4
with:
name: cleanup-log
path: cleanup-*.log
e2e:
runs-on: ubuntu-latest
needs: clean
strategy:
matrix:
test-suite:
- name: "workflow-dispatch"
option: "--workflow-dispatch-only"
description: "Direct workflow triggers"
- name: "issue-triggered"
option: "--issue-triggered-only"
description: "Tests via issue creation"
- name: "command-triggered"
option: "--command-triggered-only"
description: "Tests via comments"
fail-fast: false
if: ${{ !(github.event_name == 'schedule' && (matrix.test-suite.name == 'issue-triggered' || matrix.test-suite.name == 'command-triggered')) }}
name: "E2E Tests: ${{ matrix.test-suite.description }}"
steps:
- name: Checkout
uses: actions/checkout@v4
with:
submodules: 'recursive'
fetch-depth: 0
- name: Set up Node.js
uses: actions/setup-node@v5
- name: Set up Go
uses: actions/setup-go@v5
- name: GitHub CLI - show auth status
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
gh auth status
- name: List files for debugging
run: |
ls -la
pwd
- name: Run e2e tests and publish output to job summary
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
timeout-minutes: 60
run: |
set -o pipefail
chmod +x ./e2e.sh
# Run the e2e script, tee output to both stdout and log, capture exit code
set +e
./e2e.sh ${{ matrix.test-suite.option }} 2>&1 | tee e2e-output.log
rc=${PIPESTATUS[0]}
set -e
echo "\n## E2E test run output (${{ matrix.test-suite.description }})" >> "$GITHUB_STEP_SUMMARY"
echo '``````bash' >> "$GITHUB_STEP_SUMMARY"
sed -n '1,50000p' e2e-output.log >> "$GITHUB_STEP_SUMMARY" || true
echo '``````' >> "$GITHUB_STEP_SUMMARY"
echo "Detailed log attached as artifact: e2e-output-${{ matrix.test-suite.name }}.log"
# Fail the job if the script exited non-zero so GH shows failure status
if [[ $rc -ne 0 ]]; then
echo "E2E script failed with exit code $rc"
exit $rc
fi
- name: Upload e2e log artifact
if: always()
uses: actions/upload-artifact@v4
with:
name: e2e-output-${{ matrix.test-suite.name }}-log
path: e2e-output.log