Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Robust CI Reset to Ready #202

Closed
wants to merge 42 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
42 commits
Select commit Hold shift + click to select a range
9aa3cc8
trying status of CI as a workflow action
Oct 18, 2023
92f2306
added PR number as input
Oct 18, 2023
8c4b2f0
Update orion_status.yaml
TerrenceMcGuinness-NOAA Oct 18, 2023
74aa734
take out PR on on
Oct 18, 2023
dcffb3c
take out PR on on
Oct 18, 2023
9b8d071
take out PR on on do loops
Oct 18, 2023
de4fd80
take out PR on on do loops syntax until
Oct 18, 2023
3623231
take out PR on on do loops syntax until singleton
Oct 18, 2023
218a084
take out PR on on do loops syntax until set faulse
Oct 18, 2023
83d5c79
take out PR on on do loops syntax until direct
Oct 18, 2023
de55f1a
take out PR on on do loops needed noop
Oct 18, 2023
5b3e6cc
take out PR jobs with no steps
Oct 18, 2023
022dd28
take out PR jobs need steps
Oct 18, 2023
c9c8ae2
take out PR jobs need steps
Oct 18, 2023
74a5b5a
added reusable workflow for getting lables for each job
Oct 19, 2023
9e306ef
fixed uses path
Oct 19, 2023
1430ab3
added dependances for main jobs and name in getlabels
Oct 19, 2023
56b0734
change order in needs
Oct 19, 2023
863f0f5
Merge branch 'NOAA-EMC:develop' into workflow_actions
TerrenceMcGuinness-NOAA Oct 20, 2023
7e14adb
took out poll
Oct 21, 2023
0615fad
took out secrets required line
Oct 21, 2023
a9145c7
took out secrets required line
Oct 21, 2023
9b8d608
added {{}} on inputs.pr_number
Oct 21, 2023
ac1b51c
fixed other pr_number assiginments
Oct 21, 2023
404a454
EOF error working
Oct 21, 2023
381832a
EOF error working II
Oct 21, 2023
3f6bd46
ambiguous redrirect to GITHUB_OUTPUT
Oct 21, 2023
ab5d110
tryig to get needs output from get_Ready
Oct 21, 2023
35c4877
still not getting outputs
Oct 21, 2023
725e525
quotes on GITHUB_OUTPUT
Oct 21, 2023
461297d
trying crazy Sys IO
Oct 21, 2023
9bdf6f5
addeing yml file
Oct 21, 2023
3e7a559
remove yml file
Oct 21, 2023
b656614
added () on DONE
Oct 21, 2023
ed3429e
adding env back to GITHUB_OUPUT
Oct 21, 2023
00e92e2
added read write permissions to reuse
Oct 21, 2023
7cda450
fixed logic in status workflow for on set
Oct 21, 2023
522e4e3
noop on getlables
Oct 21, 2023
752210c
issue with orion status
Oct 21, 2023
56b6a5f
misspelled yaml as yml
Oct 21, 2023
5449a99
Merge branch 'NOAA-EMC:develop' into workflow_actions
TerrenceMcGuinness-NOAA Oct 24, 2023
02429e6
Merge branch 'NOAA-EMC:develop' into workflow_actions
TerrenceMcGuinness-NOAA Oct 30, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
60 changes: 60 additions & 0 deletions .github/workflows/getlabels.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
name: Get Labels

on:
workflow_call:
outputs:
state:
description: "The return state of Stage (true/false)"
value: ${{ jobs.getlabels.outputs.state }}
inputs:
pr_number:
required: true
type: string
max_runtime:
required: false
type: string
stage:
required: true
type: string
permissions:
contents: read
packages: write

jobs:

getlabels:
runs-on: ubuntu-latest
outputs:
state: ${{ steps.id.outputs.state }}
steps:
- name: Get Label Steps
id: id
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
OWNER: ${{ github.repository_owner }}
REPO_NAME: ${{ github.event.repository.name }}
PULL_REQUEST_NUMBER: ${{ inputs.pr_number }}
STAGE: ${{ inputs.stage }}
MAX_TIME: ${{ inputs.max_runtime }}
run: |
DONE=false
count=0
until false
do
echo "gh api repos/$OWNER/$REPO_NAME/pulls/$PULL_REQUEST_NUMBER --jq '.labels.[].name'"
LABELS1="$(gh api repos/$OWNER/$REPO_NAME/pulls/$PULL_REQUEST_NUMBER --jq '.labels.[].name')"
LABELS=$(echo "$LABELS1" | tr '\n' ' ')
check_label="CI-Orion-${STAGE}"
if [[ "${LABELS}" == *"${check_label}"* ]]; then
DONE=true
break
fi
sleep 10m
count=$((count+10))
if [[ ${count} -gt ${MAX_TIME} ]]; then
DONE=false
break
fi
done
echo "state=${DONE}"
echo "state=${DONE}" >> $GITHUB_OUTPUT
75 changes: 75 additions & 0 deletions .github/workflows/orion_status.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
name: OrionStatus

on:
workflow_dispatch:
inputs:
pr_number:
description: PR number
type: string
max_runtime:
description: Maximum time out time for running experment
type: string

jobs:

get_Ready:
uses: ./.github/workflows/getlabels.yaml
with:
pr_number: ${{ inputs.pr_number }}
max_runtime: 20
stage: "Ready"
secrets: inherit

Ready:
runs-on: ubuntu-latest
needs: get_Ready
steps:
- run: |
if [[ "${{ needs.get_Ready.outputs.state }}" == "false" ]]; then
echo "Ready Timmed out"
exit 1
elif [[ "${{ needs.get_Ready.outputs.state }}" == "true" ]]; then
echo "Ready Set"
fi

get_Building:
uses: ./.github/workflows/getlabels.yaml
needs: Ready
with:
pr_number: ${{ inputs.pr_number }}
max_runtime: 40
stage: "Building"
secrets: inherit

Building:
runs-on: ubuntu-latest
needs: get_Building
steps:
- run: |
if [[ "${{ needs.get_Building.outputs.state }}" == "false" ]]; then
echo "Building Timmed out"
exit 1
elif [[ "${{ needs.get_Building.outputs.state }}" == "true" ]]; then
echo "Building Set"
fi

get_Running:
uses: ./.github/workflows/getlabels.yaml
needs: Building
with:
pr_number: ${{ inputs.pr_number }}
max_runtime: 60
stage: "Running"
secrets: inherit

Running:
runs-on: ubuntu-latest
needs: get_Running
steps:
- run: |
if [[ "${{ needs.get_Running.outputs.state }}" == "false" ]]; then
echo "Running Timmed out"
exit 1
elif [[ "${{ needs.get_Running.outputs.state }}" == "true" ]]; then
echo "Running Set"
fi