-
Notifications
You must be signed in to change notification settings - Fork 757
126 lines (114 loc) · 5.19 KB
/
hwsapibot.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
name: hwsapibot
on:
workflow_call:
env:
INSTALL_PACKAGES: make gcc zlib1g-dev libpcre3-dev git libmariadbclient-dev-compat doxygen perl libxml-simple-perl libxml-parser-perl bc curl
BUILDSTATS_API_KEY: ${{ secrets.BUILDSTATS_API_KEY }}
GPG_SIGNING_KEY: ${{ secrets.GPG_SIGNING_KEY }}
jobs:
hwsapi:
runs-on: ubuntu-latest
concurrency:
group: hwsapibot
cancel-in-progress: true
steps:
- uses: actions/checkout@v4
- name: info
run: |
uname -a
- name: install packages
run: |
./tools/ci/retry.sh sudo apt-get update
./tools/ci/retry.sh sudo apt-get install -y -qq $INSTALL_PACKAGES
- name: configure
run: |
start_time=$(date +%s.%3N)
echo "start_time=$start_time" >> $GITHUB_ENV
git config --local user.name hwsapibot
git config --local user.email [email protected]
echo -n "$GPG_SIGNING_KEY" | base64 --decode | gpg --import
git config --local user.signingkey A667DC2F80D63FEF
./configure --enable-debug --disable-lto
make clean
- name: hpmhooking
run: |
start_this=$(date +%s.%3N)
make hooks
end_this=$(date +%s.%3N)
elapsed_hooks=$(echo "scale=0; ($end_this - $start_this) * 1000 / 1" | bc)
echo "elapsed_hooks=$elapsed_hooks" >> $GITHUB_ENV
git commit -am 'Update HPM hooks' --signoff --gpg-sign || echo "Nothing to commit"
- name: build
run: |
start_this=$(date +%s.%3N)
make sql -j3
end_this=$(date +%s.%3N)
elapsed_build=$(echo "scale=0; ($end_this - $start_this) * 1000 / 1" | bc)
echo "elapsed_build=$elapsed_build" >> $GITHUB_ENV
- name: itemdb2sql
run: |
./configure --enable-debug --disable-lto --disable-renewal
make clean
start_this=$(date +%s.%3N)
make map_sql plugin.db2sql -j3
./map-server --load-plugin db2sql --itemdb2sql
end_this=$(date +%s.%3N)
elapsed_itemdb=$(echo "scale=0; ($end_this - $start_this) * 1000 / 1" | bc)
./configure --enable-debug --disable-lto --enable-renewal
make clean
start_this=$(date +%s.%3N)
make map_sql plugin.db2sql -j3
./map-server --load-plugin db2sql --itemdb2sql
end_this=$(date +%s.%3N)
elapsed_itemdb=$(echo "scale=0; $elapsed_itemdb + ($end_this - $start_this) * 1000 / 1" | bc)
echo "elapsed_itemdb=$elapsed_itemdb" >> $GITHUB_ENV
git commit -am 'Update item_db SQL data' --signoff --gpg-sign || echo "Nothing to commit"
- name: mobdb2sql
run: |
./configure --enable-debug --disable-lto --disable-renewal
make clean
start_this=$(date +%s.%3N)
make map_sql plugin.db2sql -j3
./map-server --load-plugin db2sql --mobdb2sql
end_this=$(date +%s.%3N)
elapsed_mobdb=$(echo "scale=0; ($end_this - $start_this) * 1000 / 1" | bc)
./configure --enable-debug --disable-lto --enable-renewal
make clean
start_this=$(date +%s.%3N)
make map_sql plugin.db2sql -j3
./map-server --load-plugin db2sql --mobdb2sql
end_this=$(date +%s.%3N)
elapsed_mobdb=$(echo "scale=0; $elapsed_mobdb + ($end_this - $start_this) * 1000 / 1" | bc)
echo "elapsed_mobdb=$elapsed_mobdb" >> $GITHUB_ENV
git commit -am 'Update mob_db SQL data' --signoff --gpg-sign || echo "Nothing to commit"
- name: constdb2doc
run: |
./configure --enable-debug --disable-lto --disable-renewal
make clean
start_this=$(date +%s.%3N)
make map_sql plugin.constdb2doc -j3
./map-server --load-plugin constdb2doc --constdb2doc
end_this=$(date +%s.%3N)
elapsed_constdb=$(echo "scale=0; ($end_this - $start_this) * 1000 / 1" | bc)
./configure --enable-debug --disable-lto --enable-renewal
make clean
start_this=$(date +%s.%3N)
make map_sql plugin.constdb2doc -j3
./map-server --load-plugin constdb2doc --constdb2doc
end_this=$(date +%s.%3N)
elapsed_constdb=$(echo "scale=0; $elapsed_constdb + ($end_this - $start_this) * 1000 / 1" | bc)
echo "elapsed_constdb=$elapsed_constdb" >> $GITHUB_ENV
git commit -am 'Update constants documentation' --signoff --gpg-sign || echo "Nothing to commit"
- name: push
run: |
start_this=$(date +%s.%3N)
end_time=$(date +%s.%3N)
elapsed_total=$(echo "scale=0; ($end_time - $start_time) * 1000 / 1" | bc)
echo "elapsed_total=$elapsed_total" >> $GITHUB_ENV
git push -u origin "HEAD:${GITHUB_REF##*/}"
git_hash=$(git rev-parse --short "$GITHUB_SHA")
echo "Commit $git_hash completed in";
json="{\"commit\":\"$git_hash\""
for i in hooks build itemdb mobdb constdb total; do fieldname="elapsed_${i}"; echo " [$i] ${!fieldname}"; json="$json,\"$i\":\"${!fieldname}\""; done
json="$json}"
curl -X POST https://herc.ws/hwsapi/publishstats -H 'Content-Type: application/json' -H "x-api-key: $BUILDSTATS_API_KEY" -d "$json"