Nightly Blueprint Check #349
This file contains 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: Nightly Blueprint Check | |
run-name: Nightly Blueprint Check | |
env: | |
GIT_ORG: 'QualiTorque' | |
GIT_REPO: 'Torque-Samples' | |
SPACE_NAME: 'Samples' | |
SPACE_BP_REPO_NAME: 'Torque-Samples' | |
on: | |
# runs Daily at 6:40ish Israel time (3:40 am UTC) | |
schedule: | |
- cron: '40 3 * * *' | |
workflow_dispatch: | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Sync Github | |
id: sync-git | |
run: | | |
echo "Forcing Github Sync" | |
curl -s --request POST \ | |
--url https://portal.qtorque.io/api/spaces/$SPACE_NAME/repositories/$SPACE_BP_REPO_NAME/update \ | |
--header "Authorization: Bearer ${{ secrets.TORQUE_TOKEN }}" \ | |
--header 'Content-Type: application/json' | |
- name: Get Files | |
id: get-files | |
uses: actions/checkout@v4 | |
with: | |
fetch-depth: 2 | |
sparse-checkout: | | |
blueprints | |
- name: Launch Checks | |
id: launch-checks | |
run: | | |
start_bp_check() { | |
echo "Launching BP named: $iter_cleaned" | |
curl -X POST https://api.github.com/repos/$GIT_ORG/$GIT_REPO/dispatches \ | |
-H 'Accept: application/vnd.github.everest-preview+json' \ | |
-u ${{ secrets.GIT_PAT }} \ | |
--data '{"event_type": "nightly", "client_payload": { "bp_name": "'"$iter_cleaned"'" }}' | |
} | |
all_bps="$(ls blueprints | grep ".*.yaml" | sed ':a;N;$!ba;s/\n/,/g')" | |
if [ -z "$all_bps" ] || [ $all_bps == '[]' ] || [ $all_bps == 'null' ]; then | |
echo "No blueprints found" | |
exit 0 | |
fi | |
echo "Blueprints Found: $all_bps" | |
IFS=',' read -ra ADDR <<< "$all_bps" | |
for i in "${ADDR[@]}"; do | |
# process "$i" | |
iter_cleaned=$(echo $i | sed -e 's/\(.*\).yaml/\1/') | |
start_bp_check | |
# dont overwhelm the api | |
sleep 2s | |
done | |
echo "Done" |