Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
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
30 changes: 21 additions & 9 deletions .github/workflows/badges.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -36,50 +36,62 @@ jobs:

# Use the output from the `dora` step
- name: Get the output rate
run: echo "The deploy rate was ${{ steps.dora.outputs.deploy-rate }}" # Use the output from the `dora` step
run: echo "The deploy rate was ${STEPS_DORA_OUTPUTS_DEPLOY_RATE}" # Use the output from the `dora` step
env:
STEPS_DORA_OUTPUTS_DEPLOY_RATE: ${{ steps.dora.outputs.deploy-rate }}
- name: Get the lead time
run: echo "The lead time was ${{ steps.dora.outputs.lead-time }}" # Use the output from the `dora` step
run: echo "The lead time was ${STEPS_DORA_OUTPUTS_LEAD_TIME}" # Use the output from the `dora` step
env:
STEPS_DORA_OUTPUTS_LEAD_TIME: ${{ steps.dora.outputs.lead-time }}
- name: Get the change failure rate
run: echo "The change failure rate was ${{
steps.dora.outputs.change-failure-rate }}"
run: echo "The change failure rate was ${STEPS_DORA_OUTPUTS_CHANGE_FAILURE_RATE}"
env:
STEPS_DORA_OUTPUTS_CHANGE_FAILURE_RATE: ${{ steps.dora.outputs.change-failure-rate }}
- name: Get the mean time to restore
run: echo "The mean time to restore was ${{ steps.dora.outputs.mttr }}"
run: echo "The mean time to restore was ${STEPS_DORA_OUTPUTS_MTTR}"
env:
STEPS_DORA_OUTPUTS_MTTR: ${{ steps.dora.outputs.mttr }}

- name: Generate DORA badges
run: |
mkdir -p badges

# Deploy Rate badge (higher is better: green >= 7, yellow >= 4, orange >= 1)
RATE="${{ steps.dora.outputs.deploy-rate }}"
RATE="${STEPS_DORA_OUTPUTS_DEPLOY_RATE}"
if [ "$(echo "$RATE >= 7" | bc -l)" -eq 1 ]; then COLOR="brightgreen";
elif [ "$(echo "$RATE >= 4" | bc -l)" -eq 1 ]; then COLOR="yellowgreen";
elif [ "$(echo "$RATE >= 1" | bc -l)" -eq 1 ]; then COLOR="yellow";
else COLOR="red"; fi
curl -s "https://img.shields.io/badge/Deploy%20Rate-${RATE}-${COLOR}" > badges/deploy-rate.svg

# Lead Time badge (lower is better: green <= 3, yellow <= 5, orange <= 7)
LT="${{ steps.dora.outputs.lead-time }}"
LT="${STEPS_DORA_OUTPUTS_LEAD_TIME}"
if [ "$(echo "$LT <= 3" | bc -l)" -eq 1 ]; then COLOR="brightgreen";
elif [ "$(echo "$LT <= 5" | bc -l)" -eq 1 ]; then COLOR="yellowgreen";
elif [ "$(echo "$LT <= 7" | bc -l)" -eq 1 ]; then COLOR="yellow";
else COLOR="red"; fi
curl -s "https://img.shields.io/badge/Lead%20Time-${LT}-${COLOR}" > badges/lead-time.svg

# Change Failure Rate badge (lower is better: green <= 1, yellow <= 8, orange <= 15)
CFR="${{ steps.dora.outputs.change-failure-rate }}"
CFR="${STEPS_DORA_OUTPUTS_CHANGE_FAILURE_RATE}"
if [ "$(echo "$CFR <= 1" | bc -l)" -eq 1 ]; then COLOR="brightgreen";
elif [ "$(echo "$CFR <= 8" | bc -l)" -eq 1 ]; then COLOR="yellowgreen";
elif [ "$(echo "$CFR <= 15" | bc -l)" -eq 1 ]; then COLOR="yellow";
else COLOR="red"; fi
curl -s "https://img.shields.io/badge/Change%20Failure%20Rate-${CFR}%25-${COLOR}" > badges/change-failure-rate.svg

# Mean Time to Restore badge (lower is better: green <= 1, yellow <= 2, orange <= 3)
MTTR="${{ steps.dora.outputs.mttr }}"
MTTR="${STEPS_DORA_OUTPUTS_MTTR}"
if [ "$(echo "$MTTR <= 1" | bc -l)" -eq 1 ]; then COLOR="brightgreen";
elif [ "$(echo "$MTTR <= 2" | bc -l)" -eq 1 ]; then COLOR="yellowgreen";
elif [ "$(echo "$MTTR <= 3" | bc -l)" -eq 1 ]; then COLOR="yellow";
else COLOR="red"; fi
curl -s "https://img.shields.io/badge/Mean%20Time%20to%20Restore-${MTTR}-${COLOR}" > badges/mean-time-to-restore.svg
env:
STEPS_DORA_OUTPUTS_DEPLOY_RATE: ${{ steps.dora.outputs.deploy-rate }}
STEPS_DORA_OUTPUTS_LEAD_TIME: ${{ steps.dora.outputs.lead-time }}
STEPS_DORA_OUTPUTS_CHANGE_FAILURE_RATE: ${{ steps.dora.outputs.change-failure-rate }}
STEPS_DORA_OUTPUTS_MTTR: ${{ steps.dora.outputs.mttr }}

- name: Commit badges
env:
Expand Down
4 changes: 3 additions & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -69,4 +69,6 @@ jobs:

- name: Print Output
id: output
run: echo "${{ steps.dora.outputs.deploy-rate }}"
run: echo "${STEPS_DORA_OUTPUTS_DEPLOY_RATE}"
env:
STEPS_DORA_OUTPUTS_DEPLOY_RATE: ${{ steps.dora.outputs.deploy-rate }}
45 changes: 32 additions & 13 deletions .github/workflows/dora.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -34,14 +34,21 @@ jobs:

# Use the output from the `dora` step
- name: Get the output rate
run: echo "The deploy rate was ${{ steps.dora.outputs.deploy-rate }}" # Use the output from the `dora` step
run: echo "The deploy rate was ${STEPS_DORA_OUTPUTS_DEPLOY_RATE}" # Use the output from the `dora` step
env:
STEPS_DORA_OUTPUTS_DEPLOY_RATE: ${{ steps.dora.outputs.deploy-rate }}
- name: Get the lead time
run: echo "The lead time was ${{ steps.dora.outputs.lead-time }}" # Use the output from the `dora` step
run: echo "The lead time was ${STEPS_DORA_OUTPUTS_LEAD_TIME}" # Use the output from the `dora` step
env:
STEPS_DORA_OUTPUTS_LEAD_TIME: ${{ steps.dora.outputs.lead-time }}
- name: Get the change failure rate
run: echo "The change failure rate was ${{
steps.dora.outputs.change-failure-rate }}"
run: echo "The change failure rate was ${STEPS_DORA_OUTPUTS_CHANGE_FAILURE_RATE}"
env:
STEPS_DORA_OUTPUTS_CHANGE_FAILURE_RATE: ${{ steps.dora.outputs.change-failure-rate }}
- name: Get the mean time to restore
run: echo "The mean time to restore was ${{ steps.dora.outputs.mttr }}"
run: echo "The mean time to restore was ${STEPS_DORA_OUTPUTS_MTTR}"
env:
STEPS_DORA_OUTPUTS_MTTR: ${{ steps.dora.outputs.mttr }}

- name: Get current date
id: date
Expand All @@ -59,13 +66,16 @@ jobs:

- name: Update deploy rate history
run: |
DATE="${{ steps.date.outputs.date }}"
RATE="${{ steps.dora.outputs.deploy-rate }}"
DATE="${STEPS_DATE_OUTPUTS_DATE}"
RATE="${STEPS_DORA_OUTPUTS_DEPLOY_RATE}"
if jq -e "[.[]| select(.date == \"$DATE\")] | length > 0" tmp/deploy-rate.json > /dev/null 2>&1; then
jq "(.[] | select(.date == \"$DATE\") ).rate |= \"$RATE\"" tmp/deploy-rate.json > data/deploy-rate.json
else
jq ".[. | length] |= . + {\"date\":\"$DATE\", \"rate\":\"$RATE\", \"target\":\"7\"}" tmp/deploy-rate.json > data/deploy-rate.json
fi
env:
STEPS_DATE_OUTPUTS_DATE: ${{ steps.date.outputs.date }}
STEPS_DORA_OUTPUTS_DEPLOY_RATE: ${{ steps.dora.outputs.deploy-rate }}

# Store Lead Time history
- name: Load lead time history
Expand All @@ -74,13 +84,16 @@ jobs:

- name: Update lead time history
run: |
DATE="${{ steps.date.outputs.date }}"
RATE="${{ steps.dora.outputs.lead-time }}"
DATE="${STEPS_DATE_OUTPUTS_DATE}"
RATE="${STEPS_DORA_OUTPUTS_LEAD_TIME}"
if jq -e "[.[]| select(.date == \"$DATE\")] | length > 0" tmp/lead-time.json > /dev/null 2>&1; then
jq "(.[] | select(.date == \"$DATE\") ).rate |= \"$RATE\"" tmp/lead-time.json > data/lead-time.json
else
jq ".[. | length] |= . + {\"date\":\"$DATE\", \"rate\":\"$RATE\", \"target\":\"7\"}" tmp/lead-time.json > data/lead-time.json
fi
env:
STEPS_DATE_OUTPUTS_DATE: ${{ steps.date.outputs.date }}
STEPS_DORA_OUTPUTS_LEAD_TIME: ${{ steps.dora.outputs.lead-time }}

# Store Change Failure Rate history
- name: Load change failure rate history
Expand All @@ -89,13 +102,16 @@ jobs:

- name: Update change failure rate history
run: |
DATE="${{ steps.date.outputs.date }}"
RATE="${{ steps.dora.outputs.change-failure-rate }}"
DATE="${STEPS_DATE_OUTPUTS_DATE}"
RATE="${STEPS_DORA_OUTPUTS_CHANGE_FAILURE_RATE}"
if jq -e "[.[]| select(.date == \"$DATE\")] | length > 0" tmp/change-failure-rate.json > /dev/null 2>&1; then
jq "(.[] | select(.date == \"$DATE\") ).rate |= \"$RATE\"" tmp/change-failure-rate.json > data/change-failure-rate.json
else
jq ".[. | length] |= . + {\"date\":\"$DATE\", \"rate\":\"$RATE\", \"target\":\"15\"}" tmp/change-failure-rate.json > data/change-failure-rate.json
fi
env:
STEPS_DATE_OUTPUTS_DATE: ${{ steps.date.outputs.date }}
STEPS_DORA_OUTPUTS_CHANGE_FAILURE_RATE: ${{ steps.dora.outputs.change-failure-rate }}

# Store Mean Time to Restore history
- name: Load MTTR history
Expand All @@ -104,13 +120,16 @@ jobs:

- name: Update MTTR history
run: |
DATE="${{ steps.date.outputs.date }}"
RATE="${{ steps.dora.outputs.mttr }}"
DATE="${STEPS_DATE_OUTPUTS_DATE}"
RATE="${STEPS_DORA_OUTPUTS_MTTR}"
if jq -e "[.[]| select(.date == \"$DATE\")] | length > 0" tmp/mttr.json > /dev/null 2>&1; then
jq "(.[] | select(.date == \"$DATE\") ).rate |= \"$RATE\"" tmp/mttr.json > data/mttr.json
else
jq ".[. | length] |= . + {\"date\":\"$DATE\", \"rate\":\"$RATE\", \"target\":\"1\"}" tmp/mttr.json > data/mttr.json
fi
env:
STEPS_DATE_OUTPUTS_DATE: ${{ steps.date.outputs.date }}
STEPS_DORA_OUTPUTS_MTTR: ${{ steps.dora.outputs.mttr }}

- name: Commit DORA history data
env:
Expand Down
18 changes: 10 additions & 8 deletions .github/workflows/release-please.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,15 +27,17 @@ jobs:
if: ${{ steps.release.outputs.release_created }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
STEPS_RELEASE_OUTPUTS_MAJOR: ${{ steps.release.outputs.major }}
STEPS_RELEASE_OUTPUTS_MINOR: ${{ steps.release.outputs.minor }}
run: |
git config user.name github-actions[bot]
git config user.email 41898282+github-actions[bot]@users.noreply.github.com
git remote set-url origin "https://x-access-token:${GITHUB_TOKEN}@github.com/${GITHUB_REPOSITORY}.git"
git tag -d v${{ steps.release.outputs.major }} || true
git tag -d v${{ steps.release.outputs.major }}.${{ steps.release.outputs.minor }} || true
git push origin :v${{ steps.release.outputs.major }} || true
git push origin :v${{ steps.release.outputs.major }}.${{ steps.release.outputs.minor }} || true
git tag -a v${{ steps.release.outputs.major }} -m "Release v${{ steps.release.outputs.major }}"
git tag -a v${{ steps.release.outputs.major }}.${{ steps.release.outputs.minor }} -m "Release v${{ steps.release.outputs.major }}.${{ steps.release.outputs.minor }}"
git push origin v${{ steps.release.outputs.major }}
git push origin v${{ steps.release.outputs.major }}.${{ steps.release.outputs.minor }}
git tag -d v${STEPS_RELEASE_OUTPUTS_MAJOR} || true
git tag -d v${STEPS_RELEASE_OUTPUTS_MAJOR}.${STEPS_RELEASE_OUTPUTS_MINOR} || true
git push origin :v${STEPS_RELEASE_OUTPUTS_MAJOR} || true
git push origin :v${STEPS_RELEASE_OUTPUTS_MAJOR}.${STEPS_RELEASE_OUTPUTS_MINOR} || true
git tag -a v${STEPS_RELEASE_OUTPUTS_MAJOR} -m "Release v${STEPS_RELEASE_OUTPUTS_MAJOR}"
git tag -a v${STEPS_RELEASE_OUTPUTS_MAJOR}.${STEPS_RELEASE_OUTPUTS_MINOR} -m "Release v${STEPS_RELEASE_OUTPUTS_MAJOR}.${STEPS_RELEASE_OUTPUTS_MINOR}"
git push origin v${STEPS_RELEASE_OUTPUTS_MAJOR}
git push origin v${STEPS_RELEASE_OUTPUTS_MAJOR}.${STEPS_RELEASE_OUTPUTS_MINOR}
10 changes: 5 additions & 5 deletions .github/workflows/stryker.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ jobs:
- name: Create the Badge for Stryker Score
if: github.ref == 'refs/heads/main'
run: |
SCORE=${{ env.stryker-score }}
SCORE=${STRYKER_SCORE}
if [ "$SCORE" -ge 90 ]; then COLOR="brightgreen";
elif [ "$SCORE" -ge 80 ]; then COLOR="green";
elif [ "$SCORE" -ge 70 ]; then COLOR="yellowgreen";
Expand Down Expand Up @@ -143,12 +143,12 @@ jobs:
git checkout gh-pages

# Create a directory for this PR and move the report there
mkdir -p reports/pr-${{env.PR_NUMBER}}
mv reports/mutation/mutation.html reports/pr-${{env.PR_NUMBER}}/mutation-report.html
mkdir -p reports/pr-${PR_NUMBER}
mv reports/mutation/mutation.html reports/pr-${PR_NUMBER}/mutation-report.html

# Commit and push the changes
git add -f reports/pr-${{env.PR_NUMBER}}/mutation-report.html
git commit -m "Deploy mutation report for PR #${{env.PR_NUMBER}}"
git add -f reports/pr-${PR_NUMBER}/mutation-report.html
git commit -m "Deploy mutation report for PR #${PR_NUMBER}"
git push origin gh-pages

- name: Output the URL
Expand Down
29 changes: 20 additions & 9 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -52,18 +52,25 @@ jobs:

- name: Check the output coverage
run: |
echo "Coverage Percentage - ${{ steps.coverageComment.outputs.coverage }}"
echo "Coverage Color - ${{ steps.coverageComment.outputs.color }}"
echo "Summary HTML - ${{ steps.coverageComment.outputs.summaryHtml }}"
echo "Coverage Percentage - ${STEPS_COVERAGECOMMENT_OUTPUTS_COVERAGE}"
echo "Coverage Color - ${STEPS_COVERAGECOMMENT_OUTPUTS_COLOR}"
echo "Summary HTML - ${STEPS_COVERAGECOMMENT_OUTPUTS_SUMMARYHTML}"
mv coverage/coverage-summary.json .
env:
STEPS_COVERAGECOMMENT_OUTPUTS_COVERAGE: ${{ steps.coverageComment.outputs.coverage }}
STEPS_COVERAGECOMMENT_OUTPUTS_COLOR: ${{ steps.coverageComment.outputs.color }}
STEPS_COVERAGECOMMENT_OUTPUTS_SUMMARYHTML: ${{ steps.coverageComment.outputs.summaryHtml }}

- name: Create coverage badge
if: steps.branch-name.outputs.current_branch == 'main'
run: |
COVERAGE=${{ steps.coverageComment.outputs.coverage }}
COLOR=${{ steps.coverageComment.outputs.color }}
COVERAGE=${STEPS_COVERAGECOMMENT_OUTPUTS_COVERAGE}
COLOR=${STEPS_COVERAGECOMMENT_OUTPUTS_COLOR}
mkdir -p badges
curl -s "https://img.shields.io/badge/Test%20Coverage-${COVERAGE}%25-${COLOR}" > badges/coverage.svg
env:
STEPS_COVERAGECOMMENT_OUTPUTS_COVERAGE: ${{ steps.coverageComment.outputs.coverage }}
STEPS_COVERAGECOMMENT_OUTPUTS_COLOR: ${{ steps.coverageComment.outputs.color }}

- name: Commit coverage badge and summary
if: steps.branch-name.outputs.current_branch == 'main'
Expand Down Expand Up @@ -123,10 +130,14 @@ jobs:
# Use the output from the `dora` step
- name: Get the output rate
run: |
printf "The deploy rate was %s" "${{ steps.dora.outputs.deploy-rate }}"
printf "The log was:\n%s" "${{ steps.dora.outputs.deploy-rate-log }}"
printf "%s" "${{ steps.dora.outputs.deploy-rate-log }}" > deploy-rate-log.txt
echo "The lead time was ${{ steps.dora.outputs.lead-time }}"
printf "The deploy rate was %s" "${STEPS_DORA_OUTPUTS_DEPLOY_RATE}"
printf "The log was:\n%s" "${STEPS_DORA_OUTPUTS_DEPLOY_RATE_LOG}"
printf "%s" "${STEPS_DORA_OUTPUTS_DEPLOY_RATE_LOG}" > deploy-rate-log.txt
echo "The lead time was ${STEPS_DORA_OUTPUTS_LEAD_TIME}"
env:
STEPS_DORA_OUTPUTS_DEPLOY_RATE: ${{ steps.dora.outputs.deploy-rate }}
STEPS_DORA_OUTPUTS_DEPLOY_RATE_LOG: ${{ steps.dora.outputs.deploy-rate-log }}
STEPS_DORA_OUTPUTS_LEAD_TIME: ${{ steps.dora.outputs.lead-time }}

- uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7
with:
Expand Down
2 changes: 1 addition & 1 deletion badges/coverage.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
19 changes: 19 additions & 0 deletions dist/index.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion dist/index.js.map

Large diffs are not rendered by default.

Loading
Loading