Skip to content

Update duckdb-version to 1.1.2 from 0.9.2 #36

Update duckdb-version to 1.1.2 from 0.9.2

Update duckdb-version to 1.1.2 from 0.9.2 #36

Workflow file for this run

name: Test deployed with '/run tests' comment
permissions:
contents: write
statuses: write
actions: read
on:
issue_comment:
types:
- created
pull_request:
types:
- opened
jobs:
trigger-jenkins-job:
runs-on: ubuntu-latest
if: github.event.issue.pull_request && contains(github.event.comment.body, '/run tests')
steps:
- name: Get PR details
uses: xt0rted/pull-request-comment-branch@v1
id: comment-branch
- name: Set commit status as pending
uses: myrotvorets/set-commit-status-action@master
with:
sha: ${{ steps.comment-branch.outputs.head_sha }}
token: ${{ secrets.GITHUB_TOKEN }}
status: pending
- name: Github API Request
id: request
uses: octokit/[email protected]
with:
route: ${{ github.event.issue.pull_request.url }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Trigger Jenkins Job
run: |
JENKINS_JOB_URL="${{ secrets.JENKINS_SERVER_URL }}/job/Port-Pipeline/buildWithParameters?token=jenkinstest"
RESPONSE=$(curl -k -X POST -s -i -u "${{ secrets.JENKINS_USER }}:${{ secrets.JENKINS_API_TOKEN }}" "${JENKINS_JOB_URL}" -F PORT_GITHUB_REPO="${{ fromJson(steps.request.outputs.data).head.repo.clone_url }}" -F PORT_DESCRIPTION="Github CI Test of ${{ fromJson(steps.request.outputs.data).head.repo.full_name }}" -F PORT_BRANCH="${{ fromJson(steps.request.outputs.data).head.ref }}" -F NO_PROMOTE="TRUE")
# Extract the build URL from the response headers
BUILD_URL=$(echo "$RESPONSE" | grep -oP "Location: \K(.*)" | tr -d '\r')
# Extract the build number from the BUILD_URL
BUILD_NUMBER=$(basename "$BUILD_URL" | tr -d '/')
# Poll the Jenkins queue API to check if the job has started
while [ "$(curl -k -s "${{ secrets.JENKINS_SERVER_URL }}/queue/item/${BUILD_NUMBER}/api/json" -u "${{ secrets.JENKINS_USER }}:${{ secrets.JENKINS_API_TOKEN }}" | jq -r '.executable.number')" == "null" ]; do
echo "Job is waiting in the queue..."
sleep 10
done
# Retrieve the build URL once the job has started
BUILD_NUMBER=$(curl -k -s "${{ secrets.JENKINS_SERVER_URL }}/queue/item/${BUILD_NUMBER}/api/json" -u "${{ secrets.JENKINS_USER }}:${{ secrets.JENKINS_API_TOKEN }}" | jq -r '.executable.number')
# Poll the Jenkins API to check if the build has completed
while [ "$(curl -k -s "${{ secrets.JENKINS_SERVER_URL }}/job/Port-Pipeline/${BUILD_NUMBER}/api/json" -u "${{ secrets.JENKINS_USER }}:${{ secrets.JENKINS_API_TOKEN }}" | jq -r '.building')" == "true" ]; do
echo "Build in progress..."
sleep 10
done
# Retrieve the console output of the Jenkins job
CONSOLE_OUTPUT=$(curl -k -s "${{ secrets.JENKINS_SERVER_URL }}/job/Port-Pipeline/${BUILD_NUMBER}/consoleText" -u "${{ secrets.JENKINS_USER }}:${{ secrets.JENKINS_API_TOKEN }}")
echo "$CONSOLE_OUTPUT"
if [ "$(curl -k -s "${{ secrets.JENKINS_SERVER_URL }}/job/Port-Pipeline/${BUILD_NUMBER}/api/json" -u "${{ secrets.JENKINS_USER }}:${{ secrets.JENKINS_API_TOKEN }}" | jq -r '.result')" != "SUCCESS" ]; then
echo "Job failed..."
exit 1
fi
exit 0
- name: Set final commit status
uses: myrotvorets/set-commit-status-action@master
if: always()
with:
sha: ${{ steps.comment-branch.outputs.head_sha }}
token: ${{ secrets.GITHUB_TOKEN }}
status: ${{ job.status }}