-
Notifications
You must be signed in to change notification settings - Fork 2
174 lines (152 loc) · 6.81 KB
/
report-main.yml
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
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
name: Example report - main
on:
workflow_dispatch:
schedule:
- cron: '0 */3 * * *'
concurrency:
group: ${{ github.repository }}-example-report
env:
PER_PAGE: 20
jobs:
get-environment:
name: Get Environment
runs-on: ubuntu-latest
outputs:
per_page: ${{ env.PER_PAGE }}
gitref: ${{ steps.env.outputs.gitref }}
date: ${{ steps.env.outputs.date }}
pixeleagle_project: ${{ steps.env.outputs.pixeleagle_project }}
mobile_percy_project: ${{ steps.env.outputs.mobile_percy_project }}
updated: ${{ steps.version-check.outputs.updated }}
steps:
- name: Checkout Bevy main branch
uses: actions/checkout@v4
with:
repository: 'bevyengine/bevy'
ref: 'main'
- name: Get Environment
id: env
run: |
echo "gitref=`git rev-parse HEAD`" >> $GITHUB_OUTPUT
echo "date=`date +%Y%m%d%H%M`" >> $GITHUB_OUTPUT
echo "pixeleagle_project=B25A040A-A980-4602-B90C-D480AB84076D" >> $GITHUB_OUTPUT
echo "mobile_percy_project=dede4209/Bevy-Mobile-Example" >> $GITHUB_OUTPUT
- uses: actions/checkout@v4
with:
ref: 'results'
path: 'results'
- name: Check if current Bevy version already ran
id: version-check
run: |
gitref=`git rev-parse HEAD`
updated=`if ls results/*-$gitref 1> /dev/null 2>&1; then echo "false"; else echo "true"; fi`
echo "updated=$updated" >> $GITHUB_OUTPUT
native-run:
name: Native
needs: [get-environment]
uses: ./.github/workflows/workflow-native.yml
if: needs.get-environment.outputs.updated == 'true' || github.event_name == 'workflow_dispatch'
with:
gitref: ${{ needs.get-environment.outputs.gitref }}
pixeleagle_project: ${{ needs.get-environment.outputs.pixeleagle_project }}
branch: "main"
repository: "bevyengine/bevy"
per_page: "${{ needs.get-environment.outputs.per_page }}"
secrets: inherit
mobile-run:
name: Mobile
needs: [get-environment]
if: needs.get-environment.outputs.updated == 'true' || github.event_name == 'workflow_dispatch'
uses: ./.github/workflows/workflow-mobile.yml
with:
gitref: ${{ needs.get-environment.outputs.gitref }}
mobile_percy_project: ${{ needs.get-environment.outputs.mobile_percy_project }}
pixeleagle_project: ${{ needs.get-environment.outputs.pixeleagle_project }}
branch: "main"
repository: "bevyengine/bevy"
secrets: inherit
wasm-run:
name: Wasm
needs: [get-environment]
if: needs.get-environment.outputs.updated == 'true' || github.event_name == 'workflow_dispatch'
uses: ./.github/workflows/workflow-wasm.yml
with:
gitref: ${{ needs.get-environment.outputs.gitref }}
pixeleagle_project: ${{ needs.get-environment.outputs.pixeleagle_project }}
branch: "main"
repository: "bevyengine/bevy"
secrets: inherit
update-results:
name: Update Results
runs-on: ubuntu-latest
needs: [get-environment, native-run, mobile-run]
if: always() && (needs.get-environment.outputs.updated == 'true' || github.event_name == 'workflow_dispatch')
permissions:
contents: write
steps:
- uses: actions/checkout@v4
with:
ref: 'results'
path: 'results'
- name: Download all status artifacts
uses: actions/download-artifact@v4
with:
pattern: status-*
- name: Concatenate status
run: |
set -x
mkdir results/${{ needs.get-environment.outputs.date }}-${{ needs.get-environment.outputs.gitref }}
for report in status-Linux-*
do
(cat $report/successes; echo) >> Linux-successes-concat
(cat $report/failures; echo) >> Linux-failures-concat
(cat $report/no_screenshots; echo) >> Linux-no_screenshots-concat
done
# remove empty lines
grep . Linux-successes-concat > results/${{ needs.get-environment.outputs.date }}-${{ needs.get-environment.outputs.gitref }}/Linux-successes || true
grep . Linux-failures-concat > results/${{ needs.get-environment.outputs.date }}-${{ needs.get-environment.outputs.gitref }}/Linux-failures || true
grep . Linux-no_screenshots-concat > results/${{ needs.get-environment.outputs.date }}-${{ needs.get-environment.outputs.gitref }}/Linux-no_screenshots || true
for report in status-macOS-*
do
(cat $report/successes; echo) >> macOS-successes-concat
(cat $report/failures; echo) >> macOS-failures-concat
(cat $report/no_screenshots; echo) >> macOS-no_screenshots-concat
done
# remove empty lines
grep . macOS-successes-concat > results/${{ needs.get-environment.outputs.date }}-${{ needs.get-environment.outputs.gitref }}/macOS-successes || true
grep . macOS-failures-concat > results/${{ needs.get-environment.outputs.date }}-${{ needs.get-environment.outputs.gitref }}/macOS-failures || true
grep . macOS-no_screenshots-concat > results/${{ needs.get-environment.outputs.date }}-${{ needs.get-environment.outputs.gitref }}/macOS-no_screenshots || true
- name: Save Percy results
run: |
curl 'https://percy.io/api/v1/projects/${{ needs.get-environment.outputs.mobile_percy_project }}/builds?filter\[sha\]=${{ needs.get-environment.outputs.gitref }}' | jq '.data[0].attributes' > results/${{ needs.get-environment.outputs.date }}-${{ needs.get-environment.outputs.gitref }}/mobile-percy
- name: Download all Pixel Eagle artifacts
uses: actions/download-artifact@v4
with:
pattern: pixeleagle-*
- name: Save Pixel Eagle results
run: |
mv pixeleagle-Linux/pixeleagle-Linux.json results/${{ needs.get-environment.outputs.date }}-${{ needs.get-environment.outputs.gitref }}/Linux-pixeleagle
mv pixeleagle-macOS/pixeleagle-macOS.json results/${{ needs.get-environment.outputs.date }}-${{ needs.get-environment.outputs.gitref }}/macOS-pixeleagle
- name: Store results in git
run: |
cd results
git config user.name 'Workflow'
git config user.email '<>'
git add .
git commit -m "Update Results"
git push
- name: Upload Aggregated Status
uses: actions/upload-artifact@v4
with:
name: aggregated-status
path: |
results/${{ needs.get-environment.outputs.date }}-${{ needs.get-environment.outputs.gitref }}
update-website:
name: Update Website
needs: [get-environment, update-results]
if: always() && (needs.get-environment.outputs.updated == 'true' || github.event_name == 'workflow_dispatch')
uses: ./.github/workflows/workflow-rebuild-website.yml
permissions:
contents: read
pages: write
id-token: write