mirror of
https://github.com/dolthub/dolt.git
synced 2026-04-22 19:43:51 -05:00
/.github/{scripts,workflows}: update scripts to work with regressions job maybe
This commit is contained in:
@@ -28,6 +28,17 @@ if [ ! -z "$FROM_VERSION" ] && [ -z "$TO_VERSION" ]; then
|
||||
TO_VERSION="$FROM_VERSION"
|
||||
fi
|
||||
|
||||
is_regressions=""
|
||||
if [ -n "$FROM_VERSION" ] && [ -n "$TO_VERSION" ]; then
|
||||
if [ -z "$PR_NUMBER" ]; then
|
||||
echo "Must set PR_NUMBER for regressions run"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
echo "Starting regressions run from: $FROM_VERSION to: $TO_VERSION"
|
||||
is_regressions="true"
|
||||
fi
|
||||
|
||||
if [ -z "$ACTOR" ]; then
|
||||
echo "Must set ACTOR"
|
||||
exit 1
|
||||
@@ -49,7 +60,12 @@ sleep 0.$[ ( $RANDOM % 10 ) + 1 ]s
|
||||
|
||||
timesuffix=`date +%s%N`
|
||||
|
||||
jobname="$actorShort-$timesuffix"
|
||||
jobname=""
|
||||
if [ -z "$is_regressions" ]; then
|
||||
jobname="$lowered-$PR_NUMBER"
|
||||
else
|
||||
jobname="$actorShort-$timesuffix"
|
||||
fi
|
||||
|
||||
timeprefix=$(date +%Y/%m/%d)
|
||||
|
||||
@@ -70,6 +86,12 @@ source \
|
||||
"$format" \
|
||||
"$NOMS_BIN_FORMAT" > job.json
|
||||
|
||||
# delete existing job with same name if this is a regressions job
|
||||
if [ -z "$is_regressions" ]; then
|
||||
out=$(KUBECONFIG="$KUBECONFIG" kubectl delete job/"$jobname" -n sql-correctness || true)
|
||||
echo "Delete regressions job if exists: $out"
|
||||
fi
|
||||
|
||||
out=$(KUBECONFIG="$KUBECONFIG" kubectl apply -f job.json || true)
|
||||
|
||||
if [ "$out" != "job.batch/$jobname created" ]; then
|
||||
|
||||
@@ -39,6 +39,7 @@ jobs:
|
||||
- name: Create SQL Correctness K8s Job
|
||||
run: ./.github/scripts/sql-correctness/run-correctness.sh
|
||||
env:
|
||||
FROM_VERSION: ${{ github.event.client_payload.from_version }}
|
||||
TO_VERSION: ${{ github.event.client_payload.to_version }}
|
||||
MODE: ${{ github.event.client_payload.mode }}
|
||||
ACTOR: ${{ github.event.client_payload.actor }}
|
||||
|
||||
@@ -25,7 +25,8 @@ jobs:
|
||||
- name: Set variables
|
||||
id: set-vars
|
||||
run: |
|
||||
echo "to_version=$TO_VERSION" >> $GITHUB_OUTPUT
|
||||
short_to=${TO_VERSION:0:8}
|
||||
echo "to_version=$short_to" >> $GITHUB_OUTPUT
|
||||
echo "actor=$ACTOR" >> $GITHUB_OUTPUT
|
||||
env:
|
||||
TO_VERSION: ${{ github.sha }}
|
||||
@@ -43,13 +44,13 @@ jobs:
|
||||
FROM_VERSION: ${{ needs.set-version-actor.outputs.from_version }}
|
||||
TO_VERSION: ${{ needs.set-version-actor.outputs.to_version }}
|
||||
|
||||
# regressions:
|
||||
# runs-on: ubuntu-22.04
|
||||
# needs: set-version-actor
|
||||
# name: Trigger SQL Regressions K8s Workflow
|
||||
# steps:
|
||||
# - uses: peter-evans/repository-dispatch@v2.0.0
|
||||
# with:
|
||||
# token: ${{ secrets.REPO_ACCESS_TOKEN }}
|
||||
# event-type: sql-correctness
|
||||
# client-payload: '{"from_version": "${{ needs.set-version-actor.outputs.from_version }}", "to_version": "${{ needs.set-version-actor.outputs.to_version }}", "mode": "release", "actor": "${{ needs.set-version-actor.outputs.actor }}", "actor_email": "${{ needs.set-version-actor.outputs.actor_email }}", "template_script": "./.github/scripts/sql-correctness/get-dolt-regressions-job-json.sh"}'
|
||||
regressions:
|
||||
runs-on: ubuntu-22.04
|
||||
needs: set-version-actor
|
||||
name: Trigger SQL Regressions K8s Workflow
|
||||
steps:
|
||||
- uses: peter-evans/repository-dispatch@v2.0.0
|
||||
with:
|
||||
token: ${{ secrets.REPO_ACCESS_TOKEN }}
|
||||
event-type: sql-correctness
|
||||
client-payload: '{"from_version": "${{ needs.set-version-actor.outputs.from_version }}", "to_version": "${{ needs.set-version-actor.outputs.to_version }}", "mode": "release", "actor": "${{ needs.set-version-actor.outputs.actor }}", "actor_email": "${{ needs.set-version-actor.outputs.actor_email }}", "template_script": "./.github/scripts/sql-correctness/get-dolt-regressions-job-json.sh"}'
|
||||
|
||||
Reference in New Issue
Block a user