-
Notifications
You must be signed in to change notification settings - Fork 2
132 lines (106 loc) · 3.52 KB
/
run.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
132
name: Run
on:
workflow_dispatch:
schedule:
- cron: "0 1 * * *"
concurrency:
group: "run"
cancel-in-progress: false
jobs:
run:
runs-on: ubuntu-24.04
permissions:
contents: write # to be able to push changes
packages: read
pages: write # for publishing the report
id-token: write # for publishing the report
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
with:
path: run
- name: Provide baseline
working-directory: run
run: |
mkdir baseline
cp publish/baseline.json baseline/
- name: Build Containers
working-directory: run
run: |
docker compose -f compose.yaml build
- name: Run
working-directory: run
run: |
docker compose -f compose.yaml run loadtests
- if: always()
working-directory: run
run: |
docker compose -f compose.yaml logs -t > containers.log
- name: Cleanup
working-directory: run
if: always()
run: |
docker compose -f compose.yaml down
- name: Upload report
uses: actions/upload-artifact@v4
if: success()
with:
name: report
path: |
run/report/report.html
run/report/report.json
if-no-files-found: error
- if: failure()
working-directory: run
run: |
echo "## Report" >> $GITHUB_STEP_SUMMARY
echo "" >> $GITHUB_STEP_SUMMARY
echo "Load test failed. No report generated" >> $GITHUB_STEP_SUMMARY
- name: Upload container logs
uses: actions/upload-artifact@v4
if: always()
with:
name: logs
path: |
run/containers.log
if-no-files-found: error
- name: Record test results
env:
SOURCE: https://x-access-token:${{ secrets.GITHUB_TOKEN }}@github.com/${{ github.repository }}.git
run: |
git clone "$SOURCE" repo
DATE=$(date +"%Y-%m-%dT%H-%M-%S")
cp run/report/report.html repo/publish/reports/report-${DATE}.html
cp run/report/report.json repo/publish/reports/report-${DATE}.json
cp run/report/report.json repo/publish/baseline.json
pushd repo/publish/reports
ls -la
tree -H 'reports' --charset utf-8 -I index.html -L 1 --sort ctime -r -P "*.html" -D -o ../index.html --houtro ""
popd
cd repo
git config --global user.name 'github-actions[bot]'
git config --global user.email 'github-actions[bot]@users.noreply.github.com'
git add -A -- publish
git commit -m "Automatic update ($GITHUB_RUN_ID/$GITHUB_RUN_NUMBER)"
git push
- name: Setup Pages
uses: actions/configure-pages@v5
- name: Upload artifact
uses: actions/upload-pages-artifact@v3
with:
path: repo/publish
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v4