-
Notifications
You must be signed in to change notification settings - Fork 133
102 lines (82 loc) · 3.04 KB
/
update-site-test.yml
File metadata and controls
102 lines (82 loc) · 3.04 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
name: ESP Eclipse Plug-in Update Site Test
on:
push:
paths:
- 'releng/update-site-tests/**'
- '.github/workflows/update-site-tests.yml'
pull_request:
paths:
- 'releng/update-site-tests/**'
- '.github/workflows/update-site-tests.yml'
schedule:
# Runs every day at 00:00 UTC
- cron: '0 0 * * *'
workflow_dispatch:
workflow_run:
workflows: ["Espressif-IDE Cross-platform Release"]
types:
- completed
permissions:
contents: read
jobs:
update-site-tests:
if: ${{ github.event_name != 'workflow_run' || github.event.workflow_run.conclusion == 'success' }}
runs-on: [self-hosted, eclipse, BrnoUBU0004]
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Print trigger info
run: |
echo "Event: ${{ github.event_name }}"
if [ "${{ github.event_name }}" = "workflow_run" ]; then
echo "Triggered by workflow: ${{ github.event.workflow_run.name }}"
echo "Conclusion: ${{ github.event.workflow_run.conclusion }}"
echo "Head branch: ${{ github.event.workflow_run.head_branch }}"
fi
- name: Make scripts executable
run: |
chmod +x releng/update-site-tests/*.sh
- name: Run update-site test cases
run: |
cd releng/update-site-tests
./run-all-cases.sh
- name: Publish workflow summary
if: always()
shell: bash
run: |
echo "# ESP Eclipse Plug-in Update Site Tests" >> "$GITHUB_STEP_SUMMARY"
echo "" >> "$GITHUB_STEP_SUMMARY"
echo "| Test case | Status |" >> "$GITHUB_STEP_SUMMARY"
echo "|---|---|" >> "$GITHUB_STEP_SUMMARY"
for case_dir in releng/update-site-tests/out/*; do
[ -d "$case_dir" ] || continue
case_name="$(basename "$case_dir")"
runlog="$case_dir/logs/run.log"
if [ ! -f "$runlog" ]; then
echo "| $case_name | ⚠️ No log found |" >> "$GITHUB_STEP_SUMMARY"
continue
fi
if grep -q "STATUS: PASSED" "$runlog"; then
status="✅ Passed"
elif grep -q "STATUS: FAILED" "$runlog"; then
status="❌ Failed"
elif grep -q "STATUS: SKIPPED" "$runlog"; then
reason="$(grep -m1 'SKIP_REASON:' "$runlog" | sed 's/SKIP_REASON: //')"
if [ -n "$reason" ]; then
status="⏭️ Skipped ($reason)"
else
status="⏭️ Skipped"
fi
else
status="⚠️ Unknown"
fi
echo "| $case_name | $status |" >> "$GITHUB_STEP_SUMMARY"
done
echo "" >> "$GITHUB_STEP_SUMMARY"
echo "Full logs are available in workflow artifacts." >> "$GITHUB_STEP_SUMMARY"
- name: Upload Update Site Test Results
if: ${{ always() }}
uses: actions/upload-artifact@v4
with:
name: eclipse-update-site-test-results
path: releng/update-site-tests/out