Run #139
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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: | |
- 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 |