Skip to content

Commit

Permalink
Merge pull request #1 from urcomputeringpal/history
Browse files Browse the repository at this point in the history
summarize history
  • Loading branch information
jnewland authored May 16, 2023
2 parents 12a5b4d + 2064cce commit af8fa74
Show file tree
Hide file tree
Showing 11 changed files with 3,431 additions and 8,633 deletions.
28 changes: 28 additions & 0 deletions .github/workflows/renovate.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
name: renovate
on:
pull_request:
workflow_dispatch: {}
schedule:
- cron: "0 */6 * * *"
jobs:
renovate:
name: Update
if: github.event_name != 'pull_request'
uses: urcomputeringpal/.github/.github/workflows/renovate.yaml@main
with:
renovate_app_slug: ur-renovate
onboarding: "true"
secrets:
RENOVATE_APP_ID: ${{ secrets.RENOVATE_APP_ID }}
RENOVATE_APP_PEM: ${{ secrets.RENOVATE_APP_PEM }}

validate:
name: Validate
if: github.event_name == 'pull_request'
uses: urcomputeringpal/.github/.github/workflows/renovate.yaml@main
with:
renovate_app_slug: ur-renovate
dry_run_branch: ${{ github.event.pull_request.head.ref }}
secrets:
RENOVATE_APP_ID: ${{ secrets.RENOVATE_APP_ID }}
RENOVATE_APP_PEM: ${{ secrets.RENOVATE_APP_PEM }}
38 changes: 25 additions & 13 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -1,17 +1,29 @@
name: test
on:
pull_request:
pull_request:
push:
branches:
- main
schedule:
- cron: "0 * * * *"

jobs:
test:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@8e5e7e5ab8b370d6c329ec480221332ada57f0ab
- uses: ./
id: function1
with:
function: function1
- shell: bash
run: |
[ "${{ steps.function1.outputs.result }}" == "string" ]
prepare:
runs-on: ubuntu-latest
steps:
- run: sleep 5
workflow-run-history:
name: workflow run history
needs: prepare
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@8e5e7e5ab8b370d6c329ec480221332ada57f0ab
- uses: ./
id: summarizeHistory
timeout-minutes: 2
test:
needs: workflow-run-history
runs-on: ubuntu-latest
steps:
- run: echo true
13 changes: 13 additions & 0 deletions .github/workflows/update-majorver.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
name: Update Major Version Tag

on:
push:
tags:
- "v*"

jobs:
update-majorver:
name: Update Major Version Tag
runs-on: ubuntu-latest
steps:
- uses: nowactions/update-majorver@f2014bbbba95b635e990ce512c5653bd0f4753fb # v1.1.2
1 change: 1 addition & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
dist
21 changes: 21 additions & 0 deletions .prettierrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
{
"tabWidth": 4,
"printWidth": 120,
"semi": true,
"jsxBracketSameLine": true,
"arrowParens": "avoid",
"bracketSpacing": true,
"cursorOffset": -1,
"endOfLine": "lf",
"htmlWhitespaceSensitivity": "css",
"insertPragma": false,
"jsxSingleQuote": false,
"proseWrap": "preserve",
"quoteProps": "as-needed",
"rangeStart": 0,
"requirePragma": false,
"singleQuote": false,
"trailingComma": "es5",
"useTabs": false,
"vueIndentScriptAndStyle": false
}
48 changes: 47 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1 +1,47 @@
# github-script-ts-action-template
# workflow-run-history

Adds a Markdown Step Summary explaining the historical performance and success rate of a workflow over the previous month.

### Not yet implemented

- Compare performance / success rate against default branch
- Custom date rages

## Example

<h1>Workflow Run History over the last month (20 total runs)</h1>
<h1>Success rate: 75% (15 successes out of 20 runs)</h1>
<h1>15 successful runs</h1>
<table><tr><th>Percentile</th><th>Success duration in seconds</th></tr><tr><td>99th</td><td>25</td></tr><tr><td>90th</td><td>35</td></tr><tr><td>50th</td><td>41</td></tr></table>
<h1>5 failing runs</h1>
<table><tr><th>Percentile</th><th>Success duration in seconds</th></tr><tr><td>99th</td><td>29</td></tr><tr><td>90th</td><td>29</td></tr><tr><td>50th</td><td>39</td></tr></table>
<h1>Run status breakdown</h1>
<table><tr><th>Status</th><th>Percent of total</th></tr><tr><td>success</td><td>75%</td></tr><tr><td>failure</td><td>25%</td></tr></table>
}

## Usage

```yaml
name: test
on:
pull_request:
push:
branches:
- main
schedule:
- cron: "0 * * * *"

jobs:
test:
runs-on: ubuntu-latest
steps:
- run: sleep 5
performance:
needs: test
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
- uses: urcomputeringpal/workflow-run-history@v0
timeout-minutes: 2
```
49 changes: 20 additions & 29 deletions action.yml
Original file line number Diff line number Diff line change
@@ -1,33 +1,24 @@
name: Typescript Action template
description: Easy Typescript Actions
inputs:
function:
description: sample input
default: function1

outputs:
result:
description: sample output
value: ${{ steps.function.outputs.result }}
name: Summarize Workflow History
description: Performance, success rate, etc

runs:
using: "composite"
steps:
- id: path
shell: bash
run: |
cd ${{ github.action_path }}
echo "action_path=$(pwd)" >> "$GITHUB_OUTPUT"
using: "composite"
steps:
- id: path
shell: bash
run: |
cd ${{ github.action_path }}
echo "action_path=$(pwd)" >> "$GITHUB_OUTPUT"
- name: Setup TypeScript scripts
id: github-script-ts
uses: urcomputeringpal/github-script-ts@v0
with:
path: ${{ steps.path.outputs.action_path }}
- name: Setup TypeScript scripts
id: github-script-ts
uses: urcomputeringpal/github-script-ts@v0
with:
path: ${{ steps.path.outputs.action_path }}

- name: ${{ inputs.function }}
id: function
uses: urcomputeringpal/github-script-ts@v0
with:
path: ${{ steps.path.outputs.action_path }}
function: ${{ inputs.function }}
- name: summarizeHistory
id: function
uses: urcomputeringpal/github-script-ts@v0
with:
path: ${{ steps.path.outputs.action_path }}
function: summarizeHistory
Loading

0 comments on commit af8fa74

Please sign in to comment.