SlideRule Test Report #7
This file contains hidden or 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: SlideRule Test Report | |
| on: | |
| schedule: | |
| - cron: '0 7 * * *' # every night at 2 a.m. EST | |
| jobs: | |
| call-api: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Query SlideRule Test Report | |
| env: | |
| SLIDERULE_GITHUB_TOKEN: ${{ secrets.SESSION_PAT }} | |
| run: | | |
| set -euo pipefail # stop workflow if curl exits non-zero | |
| JWT=$(curl -fsS https://login.slideruleearth.io/auth/github/pat -d "{\"pat\":\"$SLIDERULE_GITHUB_TOKEN\"}" | jq -r '.token') | |
| REPORT=$(curl -fsS -X POST -H "Authorization: Bearer $JWT" https://provisioner.slideruleearth.io/report/tests) | |
| REPORT_EPOCH=$(date -d "$(echo $REPORT | jq -r '.report.date')" +%s) | |
| TODAY_EPOCH=$(date -d "$(date +%F)" +%s) | |
| jq -e '.report.status == true' <<< "$REPORT" > /dev/null # check success | |
| (( REPORT_EPOCH >= TODAY_EPOCH )) # check test ran today |