-
Notifications
You must be signed in to change notification settings - Fork 19
131 lines (108 loc) · 3.72 KB
/
benchmark.yaml
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
name: benchmark
on:
push:
branches:
- "main"
pull_request:
branches:
- "main"
concurrency: benchmark
jobs:
bench:
runs-on: ubuntu-22.04
permissions:
# deployments permission to deploy GitHub pages website
deployments: write
# contents permission to update benchmark contents in gh-pages branch
contents: write
steps:
- name: Maximize build space
run: |
df -h
sudo rm -rf /usr/share/dotnet
sudo rm -rf /usr/local/lib/android
sudo rm -rf /opt/ghc
sudo rm -rf /opt/hostedtoolcache/CodeQL
sudo docker image prune --all --force
sudo rm -Rf ${JAVA_HOME_8_X64}
sudo rm -Rf ${JAVA_HOME_11_X64}
sudo rm -Rf ${JAVA_HOME_17_X64}
sudo rm -Rf ${RUBY_PATH}
df -h
- uses: actions/checkout@v4
- uses: Swatinem/rust-cache@v2
- name: Setup cargo-binstall
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
curl -L --proto '=https' --tlsv1.2 -sSf https://raw.githubusercontent.com/cargo-bins/cargo-binstall/main/install-from-binstall-release.sh | bash
- name: Install oidc CLI
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
cargo binstall -y --force oidc-cli
- name: Install HTTPie
run: |
python -m pip install --upgrade pip wheel
python -m pip install httpie
- name: Build
run: |
cargo build --bin trustd --release
- name: Run
env:
NO_COLOR: "true"
run:
nohup cargo run --bin trustd --release &> trustd.log &
- name: Wait for the backend to be up
run: |
URL="http://localhost:8080/.well-known/trustify"
TIMEOUT=300 # 5 minutes
INTERVAL=5 # Interval between retries in seconds
START_TIME=$(date +%s)
while true; do
# Check if the endpoint is up
if curl -s --fail "$URL"; then
echo
echo "Endpoint is up!"
exit 0
fi
# Check if timeout has passed
CURRENT_TIME=$(date +%s)
ELAPSED_TIME=$((CURRENT_TIME - START_TIME))
if [ "$ELAPSED_TIME" -ge "$TIMEOUT" ]; then
echo "Timeout reached. Endpoint is still down."
exit 1
fi
echo "Endpoint is down. Retrying in $INTERVAL seconds..."
sleep "$INTERVAL"
done
- name: Setup OIDC
run: |
oidc create confidential trustify --issuer http://localhost:8090/realms/trustify --client-id walker --client-secret R8A6KFeyxJsMDBhjfHbpZTIF0GWt43HP --force # no-secret
- name: Run DS3 ingestion
run: |
.github/scripts/benchmark.sh
- name: Store benchmark result
uses: benchmark-action/github-action-benchmark@v1
with:
tool: 'customSmallerIsBetter'
output-file-path: benchmark.json
fail-on-alert: true
# GitHub API token to make a commit comment
github-token: ${{ secrets.GITHUB_TOKEN }}
# Enable Job Summary for PRs
summary-always: true
# Push and deploy GitHub pages branch automatically
auto-push: ${{ github.event_name != 'pull_request' }}
# Enable alert commit comment
comment-on-alert: true
# Mention @rhysd in the commit comment
# alert-comment-cc-users: '@rhysd'
- name: Upload container logs
uses: actions/upload-artifact@v4
if: always()
with:
name: logs
path: |
trustd.log
if-no-files-found: error