Reports #1308
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: Reports | |
on: | |
workflow_dispatch: {} | |
schedule: | |
- cron: '0 6 * * *' | |
push: | |
branches: | |
- main | |
concurrency: | |
group: ${{ github.workflow }} | |
cancel-in-progress: true | |
jobs: | |
run: | |
runs-on: ubuntu-latest | |
env: | |
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }} | |
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }} | |
AWS_REGION: ${{ secrets.AWS_REGION }} | |
TRINO_VERSION: 445 | |
TRINO_GIT_VERSION: "0.74" | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Install dependencies | |
run: | | |
sudo apt update | |
sudo pip install ansi2html | |
curl -fLOsS https://github.com/nineinchnick/trino-git/releases/download/v$TRINO_GIT_VERSION/trino-git-$TRINO_GIT_VERSION.zip | |
unzip trino-git-$TRINO_GIT_VERSION.zip | |
- name: Start Trino | |
run: | | |
CONTAINER_ID=$(docker run \ | |
-v $(pwd)/trino-git-$TRINO_GIT_VERSION:/usr/lib/trino/plugin/git \ | |
-v $(pwd)/catalog/git.properties:/etc/trino/catalog/git.properties \ | |
-v $(pwd)/catalog/trinocicd.properties:/etc/trino/catalog/trinocicd.properties \ | |
-v $(pwd)/hive-cache:/opt/hive-cache \ | |
-e AWS_ACCESS_KEY_ID \ | |
-e AWS_SECRET_ACCESS_KEY \ | |
-e AWS_REGION \ | |
-p 8080:8080 \ | |
--name trino \ | |
-d \ | |
trinodb/trino:$TRINO_VERSION) | |
SERVER_IP=$(docker inspect --format '{{range.NetworkSettings.Networks}}{{.IPAddress}}{{end}}' "$CONTAINER_ID") | |
echo "CONTAINER_ID=$CONTAINER_ID" >> $GITHUB_ENV | |
echo "SERVER_IP=$SERVER_IP" >> $GITHUB_ENV | |
until docker logs trino 2>&1 | grep --quiet --fixed-strings --max-count=1 "SERVER STARTED"; do sleep 1 ; done | |
- name: Execute queries | |
run: | | |
./bin/reports.sh reports/ci-cd/index.md "Trino CI/CD Reports" sql/ci-cd/{health,success-ratio-per-day,runs-queue-time-per-day,runs-duration-per-day,runs-job-cumulative-duration-per-day,jobs-duration}.sql | |
./bin/reports.sh reports/flaky/index.md "Trino Flaky Tests" sql/flaky/{jobs,jobs-week,tests,classes}.sql | |
./bin/reports.sh reports/pr/index.md "Trino PR Reports" sql/pr/{idents,burndown,authors-per-month,changes-per-month,prs-per-author,reviewers-per-pr,reviews-per-author-assoc,top-reviewers,top-authors,top-mergers,sith-lords,mergers-authors,reviewers-top-authors,time-to-merge,time-to-merge-per-size,avg-time-to-merge,time-to-first-review,avg-time-to-first-review,reviewer-responsiveness,author-responsiveness,open-pr-age,awaiting-review,inactivity-on-prs,abandoned-prs,running-prs,stale-prs}.sql | |
- name: Commit report | |
run: | | |
# pull in case someone pushed commits during reports generation, which can take a while | |
# if there are conflicts, this will fail | |
git pull --ff-only | |
git config user.name 'GitHub Automation' | |
git config user.email '' | |
git add --all reports/ | |
git commit -m "Automated report" | |
git push | |
- name: Dump Trino logs | |
if: always() | |
run: | | |
docker logs trino |