Skip to content

Commit

Permalink
ci: update synthetic devl udi schema generator
Browse files Browse the repository at this point in the history
  • Loading branch information
rinshadka authored Jan 9, 2025
1 parent b48ed77 commit 17ceabe
Showing 1 changed file with 13 additions and 35 deletions.
48 changes: 13 additions & 35 deletions .github/workflows/udi-devl-rds.yml
Original file line number Diff line number Diff line change
@@ -1,42 +1,19 @@
name: Synthetic Devl UDI schema generator

on:
workflow_dispatch: # Manual trigger

workflow_dispatch:
inputs:
tag:
description: 'Polyglot Prime Tag Version'
required: true
jobs:
check-mat-refresh-action-status:
runs-on: ubuntu-latest
outputs:
action-running: ${{ steps.check-action.outputs.action-running }}

steps:
- name: Check if another workflow is running
id: check-action
run: |
# Replace with the actual workflow ID or filename (e.g., main.yml)
WORKFLOW_ID="udi-devl-mat-refresh-data-only.yml"
REPO_OWNER="${{ github.repository_owner }}"
REPO_NAME="${{ github.event.repository.name }}"
# Get the running workflow runs for the same repo and the specific workflow
RUNNING=$(curl -s -H "Authorization: Bearer ${{ secrets.GITHUB_TOKEN }}" \
"https://api.github.com/repos/$REPO_OWNER/$REPO_NAME/actions/workflows/$WORKFLOW_ID/runs?status=in_progress&per_page=1" \
| jq '.workflow_runs | length')
if [ "$RUNNING" -gt 0 ]; then
echo "Action is already running"
echo "::set-output name=action-running::true"
else
echo "No action is running"
echo "::set-output name=action-running::false"
fi
schema-generation:
runs-on: devl-techbd-sql
needs: check-mat-refresh-action-status
if: needs.check-mat-refresh-action-status.outputs.action-running == 'false'
env:
SQL_AIDE_TAG: v0.14.9
steps:
- name: Running schema generation since UDI Mat Refresh (data-only) is not running
run: echo "Running schema generation since UDI Mat Refresh (data-only) is not running."
- name: Running schema generation
run: echo "Running schema generation"

- name: Checkout repository
uses: actions/checkout@v4
Expand All @@ -54,7 +31,7 @@ jobs:
- name: Clone SQL Aide repository
run: |
git clone https://github.com/netspective-labs/sql-aide.git
git clone --branch ${{ env.SQL_AIDE_TAG }} https://github.com/netspective-labs/sql-aide.git
- name: Navigate to SQL Aide and Generate ISLM SQL
run: |
Expand All @@ -74,7 +51,8 @@ jobs:
cat "$log_file"
- name: Clone Polyglot Prime repository
run: git clone https://github.com/tech-by-design/polyglot-prime.git
run: |
git clone -b ${{ inputs.tag }} https://github.com/tech-by-design/polyglot-prime.git
- name: Navigate to UDI Prime and Generate SQL
run: |
Expand Down Expand Up @@ -106,4 +84,4 @@ jobs:
run: |
cd polyglot-prime/udi-prime
log_file=$(ls -t ./udictl-test-*.log | head -n 1)
cat "$log_file"
cat "$log_file"

0 comments on commit 17ceabe

Please sign in to comment.