Skip to content

Reports

Reports #1415

Workflow file for this run

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: 459
TRINO_GIT_VERSION: "0.85"
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: |
mkdir -p $(pwd)/hive-cache && chmod go+w $(pwd)/hive-cache
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
i=0
until docker inspect "${CONTAINER_ID}" --format "{{json .State.Health.Status }}" | grep -q '"healthy"'; do
if [[ $((i++)) -ge 10 ]]; then
echo "🚨 Too many retries waiting for Trino to start"
exit 1
fi
sleep 10
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/tests/index.md "Trino Tests Reports" sql/tests/{jobs,annotations}.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