Skip to content
This repository has been archived by the owner on Oct 11, 2024. It is now read-only.

Commit

Permalink
Merge pull request #9 from neuralmagic/gha-init
Browse files Browse the repository at this point in the history
initial GHA
  • Loading branch information
andy-neuma authored Feb 13, 2024
2 parents 6075c74 + 360cfbe commit 2f1cea9
Show file tree
Hide file tree
Showing 3 changed files with 85 additions and 0 deletions.
25 changes: 25 additions & 0 deletions .github/actions/workflow-info/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
name: workflow info
description: 'give a brief summary of workflow parameters'
inputs:
label:
description: "requested runner label (specifies instance)"
required: true
timeout:
description: "time limit for run in minutes "
required: true
gitref:
description: "git commit hash or branch name"
required: true
runs:
using: composite
steps:
- run: |
echo "workflow started ..."
echo "label: '${{ inputs.label }}'"
echo "github actor: '${{ github.actor }}'"
echo "repository: '${{ github.repository }}'"
echo "gitref: '${{ inputs.gitref }}'"
echo "branch name: '${{ github.ref_name }}'"
echo "user on instance: $(whoami)"
echo "workflow timeout: ${{ inputs.timeout }} (min)"
shell: bash
6 changes: 6 additions & 0 deletions .github/pull_request_template.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
SUMMARY:
"please provide a brief summary"

TEST PLAN:
"please outline how the changes were tested"

54 changes: 54 additions & 0 deletions .github/workflows/nm_debug.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
name: nm debug instance
on:
workflow_dispatch:
inputs:
label:
description: "requested runner label (specifies instance)"
type: string
required: true
timeout:
description: "approximate number of minutes to keep instance up (should be at least 20)."
type: string
required: true
gitref:
description: "git commit hash or branch name"
type: string
required: true

jobs:

DEBUG:

runs-on: ${{ inputs.label }}
timeout-minutes: ${{ fromJSON(inputs.timeout) }}

steps:

- name: checkout repository code
uses: actions/checkout@v4
with:
fetch-depth: 0
ref: ${{ inputs.gitref }}
submodules: recursive

- name: workflow info
uses: ./.github/actions/workflow-info/
with:
gitref: ${{ inputs.gitref }}
label: ${{ inputs.label }}
timeout: ${{ inputs.timeout }}

#######################################################
- name: announce pause
run: |
M=${{ inputs.timeout }}
R=$((M - 15))
S=$((R * 60))
echo "pausing for, ${R} minutes"
- name: pause workflow
run: |
M=${{ inputs.timeout }}
R=$((M - 15))
S=$((R * 60))
sleep $S

0 comments on commit 2f1cea9

Please sign in to comment.