mirror of
https://github.com/Retropex/docker-bitcoind.git
synced 2025-05-29 05:22:36 +02:00
Post a comment on each performance check completing
(Or at least try to 😬)
This commit is contained in:
parent
7546a830ab
commit
19c7010f9d
82
.github/workflows/qemu-perf.yml
vendored
82
.github/workflows/qemu-perf.yml
vendored
@ -4,6 +4,10 @@ on:
|
||||
schedule:
|
||||
- cron: '2 1 * * *'
|
||||
|
||||
push:
|
||||
branches:
|
||||
- 'perf'
|
||||
|
||||
jobs:
|
||||
build:
|
||||
name: Build
|
||||
@ -31,6 +35,9 @@ jobs:
|
||||
steps:
|
||||
- uses: actions/checkout@v1.0.0
|
||||
|
||||
- name: Log start time
|
||||
run: touch /tmp/start
|
||||
|
||||
- name: Register self-compiled qemu
|
||||
run: docker run --rm --privileged meedamian/simple-qemu:${{matrix.qemu}}-${{matrix.arch}} -p yes
|
||||
|
||||
@ -59,3 +66,78 @@ jobs:
|
||||
docker run --rm --entrypoint=uname bitcoind -a
|
||||
docker run --rm bitcoind --version
|
||||
|
||||
- name: Calculate execution time
|
||||
run: |
|
||||
START=$(date -r /tmp/start +%s)
|
||||
NOW=$(date +%s)
|
||||
|
||||
DIFF=$(( NOW - START ))
|
||||
|
||||
SEC=1
|
||||
MIN=$(( 60 * SEC ))
|
||||
HOUR=$(( 60 * MIN ))
|
||||
DAY=$(( 24 * HOUR ))
|
||||
|
||||
secs=$(( DIFF % 60 ))
|
||||
mins=$(( $(( DIFF / MIN )) % 60 ))
|
||||
hours=$(( $(( DIFF / HOUR )) % 24 ))
|
||||
days=$(( DIFF / DAY ))
|
||||
|
||||
OUT=""
|
||||
if [[ "${days}" -ne "0" ]]; then
|
||||
# Days-long jobs shouldn't happen, but 🤷🏻♂️
|
||||
OUT="${days}d "
|
||||
fi
|
||||
|
||||
OUT="${OUT}${hours}h:${mins}m:${secs}s"
|
||||
|
||||
mkdir -p stat
|
||||
|
||||
echo "${OUT}" > stat/${{matrix.qemu}}-${{matrix.arch}}
|
||||
|
||||
- name: Save execution time as an artifact
|
||||
uses: actions/upload-artifact@v1.0.0
|
||||
with:
|
||||
name: stats
|
||||
path: stat/
|
||||
|
||||
comment:
|
||||
name: Report result
|
||||
needs: build
|
||||
runs-on: ubuntu-18.04
|
||||
steps:
|
||||
- name: Download perf stats
|
||||
uses: actions/download-artifact@v1.0.0
|
||||
with:
|
||||
name: stats
|
||||
|
||||
- name: Aggregate results
|
||||
run: |
|
||||
touch ./all-stats
|
||||
|
||||
echo "| version | arm32v7 | arm64" >> ./all-stats
|
||||
echo "|:-------:|--------:|-----:" >> ./all-stats
|
||||
|
||||
for ver in $(ls ./stats/* | awk -F/ '{print $NF}' | cut -d- -f1 | uniq); do
|
||||
line="| **${ver}**"
|
||||
|
||||
line="${line} | $(cat ./stats/${ver}-arm32v7 | tr -d '\n')"
|
||||
line="${line} | $(cat ./stats/${ver}-arm64 | tr -d '\n')"
|
||||
|
||||
echo "${line}" >> ./all-stats
|
||||
done
|
||||
|
||||
cat ./all-stats
|
||||
|
||||
echo ::set-env name=RESULTS::"$(cat ./all-stats | sed -z 's/\n/\\n/g')"
|
||||
|
||||
- uses: actions/github-script@0.4.0
|
||||
with:
|
||||
github-token: ${{secrets.GITHUB_TOKEN}}
|
||||
script: |
|
||||
github.issues.createComment({
|
||||
owner: 'lncm',
|
||||
repo: 'docker-bitcoind',
|
||||
issue_number: 9,
|
||||
body: `Today's results:\n\n${process.env.RESULTS.replace(/\\n/g, '\n')}`
|
||||
})
|
||||
|
Loading…
Reference in New Issue
Block a user