buildchecker: run history upload on a cron (#31823)

This commit is contained in:
Robert Lin 2022-02-25 11:25:10 -08:00 committed by GitHub
parent 1dbafd58d1
commit 313c2498cb
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 43 additions and 0 deletions

View File

@ -0,0 +1,25 @@
# See dev/buildchecker/README.md
name: buildchecker
on:
schedule:
- cron: '0 1 * * *'
workflow_dispatch:
jobs:
run:
runs-on: ubuntu-latest
# secrets for this workflow are configured in the 'autobuildsherrif' environment.
# 'autobuildsherrif' was the original name of the 'buildchecker' tool - GitHub does
# not provide a simple way to do a rename, so we leave it as is for now.
environment: autobuildsherrif
steps:
- uses: actions/checkout@v2
- uses: actions/setup-go@v2
with: { go-version: '1.17' }
- run: ./dev/buildchecker/run-day-history.sh
env:
BUILDKITE_TOKEN: ${{ secrets.AUTOBUILDSHERRIF_BUILDKITE_TOKEN }}
HONEYCOMB_TOKEN: ${{ secrets.AUTOBUILDSHERRIF_HONEYCOMB_TOKEN }}

View File

@ -0,0 +1,18 @@
#! /usr/bin/env bash
# Make this script independent of where it's called
cd "$(dirname "${BASH_SOURCE[0]}")"/../..
set -eu
created_from=$(date -d "yesterday" '+%Y-%m-%d')
created_to=$(date '+%Y-%m-%d')
echo "--- Running 'buildchecker history' from $created_from to $created_to"
go run ./dev/buildchecker/ \
-buildkite.token="$BUILDKITE_TOKEN" \
-created.from="$created_from" \
-created.to="$created_to" \
-honeycomb.dataset="buildkite-history" \
-honeycomb.token="$HONEYCOMB_TOKEN" \
history