Skip to content

Commit

Permalink
Using bowlby to simplify artifact service (#940)
Browse files Browse the repository at this point in the history
* Using bowlby to simplify artifact service

* added healthcheck action

* Added static report job
  • Loading branch information
therealryan authored Sep 25, 2024
1 parent 467b533 commit c60770b
Show file tree
Hide file tree
Showing 5 changed files with 112 additions and 82 deletions.
25 changes: 25 additions & 0 deletions .github/workflows/bowlby_health.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
# This workflow hits an endpoint of our bowlby instance and fails if we don't get a success response
# This confirms that
# * The OCI instance is still running
# * The https cert is still good
# * The github api token is still good

name: health

on:
workflow_dispatch:
schedule:
- cron: '0 8 * * *'

jobs:
main:
runs-on: ubuntu-latest
steps:

- name: Check the deployed service URL
uses: jtalk/url-health-check-action@v4
with:
url: https://bowlby.flowty.dev/flow/latest/Mastercard/flow/test.yml
max-attempts: 3
retry-delay: 5s
retry-all: true
33 changes: 8 additions & 25 deletions .github/workflows/mutation.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,39 +37,22 @@ jobs:

- name: Save aggregated mutation report
uses: actions/upload-artifact@50769540e7f4bd5e21e526ee35c689e35e0d6874 # v4.4.0
id: upload_aggregated
with:
name: mutation_report
path: aggregator/target/pit-reports

- name: Emit aggregated artifact link
run: echo " * [aggregated report](https://bowlby.flowty.dev/flow/artifacts/Mastercard/flow/${{ steps.upload_aggregated.outputs.artifact-id }}/index.html)" >> $GITHUB_STEP_SUMMARY

- name: Save project mutation reports
uses: actions/upload-artifact@50769540e7f4bd5e21e526ee35c689e35e0d6874 # v4.4.0
id: upload_project
if: ${{ failure() }}
with:
name: project_mutation_reports
path: '**/target/pit-reports'

publish:
permissions:
contents: write # for stefanzweifel/git-auto-commit-action to push code in repo
needs: build
runs-on: ubuntu-latest
continue-on-error: true
concurrency: pages_branch
steps:
- name: Checkout
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
with:
ref: pages

- name: Download
uses: actions/download-artifact@fa0a91b85d4f404e444e00e005971372dc801d16 # v4.1.8
with:
path: mutation/ingest

- name: Ingest
run: perl regen_index.pl $GITHUB_HEAD_REF >> $GITHUB_STEP_SUMMARY

- name: Commit
uses: stefanzweifel/git-auto-commit-action@8621497c8c39c72f3e2a999a26b4ca1b5058a842 # v5.0.1
with:
branch: pages
- name: Emit project artifact link
if: ${{ failure() }}
run: echo " * [project reports](https://bowlby.flowty.dev/flow/artifacts/Mastercard/flow/${{ steps.upload_project.outputs.artifact-id }})" >> $GITHUB_STEP_SUMMARY
25 changes: 0 additions & 25 deletions .github/workflows/reindex.yml

This file was deleted.

73 changes: 73 additions & 0 deletions .github/workflows/static_artifacts.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
# This workflow runs the tests and then dumps the flow reports into our pages branch.
# While we like using bowlby to serve artifacts, it relies on a bunch of perishable
# stuff like an OCI instance, SSL certs and an API token. If any of those go wrong
# we still want to have a working demo of the execution reports.

# Hence this manually-invoked job that dumps a set of reports onto our pages branch
# We can run this whenever something noteworthy changes in the reports and have
# confidence that we'll always have a report to link to in our documentation.

name: static artifacts

on:
workflow_dispatch:

permissions: # added using https://github.com/step-security/secure-workflows
contents: read

jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7

- name: Set up JDK 8
uses: actions/setup-java@2dfa2011c5b2a0f1489bf9e433881c92c1631f88 # v4.3.0
with:
java-version: '8'
distribution: 'temurin'
cache: maven

- name: Set up Node
uses: actions/setup-node@0a44ba7841725637a19e28fa30b79a866c81b0a6 # v4.0.4
with:
node-version: '14.15.1'
cache: 'npm'
cache-dependency-path: report/report-ng/package-lock.json

- name: Build with Maven
run: mvn -B -Dnode=system package

- name: Save flow execution reports
uses: actions/upload-artifact@50769540e7f4bd5e21e526ee35c689e35e0d6874 # v4.4.0
id: upload_flow
with:
name: flow_execution_reports
path: 'example/**/target/mctf/latest'

publish:
permissions:
contents: write # for stefanzweifel/git-auto-commit-action to push code in repo
needs: build
runs-on: ubuntu-latest
continue-on-error: true
concurrency: pages_branch
steps:
- name: Checkout
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
with:
ref: slim_pages

- name: Delete old content
run: rm -rf static

- name: Download flow reports
uses: actions/download-artifact@fa0a91b85d4f404e444e00e005971372dc801d16 # v4.1.8
with:
name: flow_execution_reports
path: static

- name: Commit
uses: stefanzweifel/git-auto-commit-action@8621497c8c39c72f3e2a999a26b4ca1b5058a842 # v5.0.1
with:
branch: slim_pages
38 changes: 6 additions & 32 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,45 +35,19 @@ jobs:

- name: Save flow execution reports
uses: actions/upload-artifact@50769540e7f4bd5e21e526ee35c689e35e0d6874 # v4.4.0
id: upload_flow
with:
name: flow_execution_reports
path: 'example/**/target/mctf/latest'

- name: Save angular coverage reports
uses: actions/upload-artifact@50769540e7f4bd5e21e526ee35c689e35e0d6874 # v4.4.0
id: upload_angular
with:
name: angular_coverage
path: 'report/report-ng/coverage'

publish:
permissions:
contents: write # for stefanzweifel/git-auto-commit-action to push code in repo
needs: build
runs-on: ubuntu-latest
continue-on-error: true
concurrency: pages_branch
steps:
- name: Checkout
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
with:
ref: pages

- name: Download flow reports
uses: actions/download-artifact@fa0a91b85d4f404e444e00e005971372dc801d16 # v4.1.8
with:
name: flow_execution_reports
path: execution/ingest

- name: Download angular coverage
uses: actions/download-artifact@fa0a91b85d4f404e444e00e005971372dc801d16 # v4.1.8
with:
name: angular_coverage
path: ng_coverage/ingest

- name: Ingest
run: perl regen_index.pl $GITHUB_HEAD_REF >> $GITHUB_STEP_SUMMARY

- name: Commit
uses: stefanzweifel/git-auto-commit-action@8621497c8c39c72f3e2a999a26b4ca1b5058a842 # v5.0.1
with:
branch: pages
- name: Emit links
run: |
echo " * [flow reports](https://bowlby.flowty.dev/flow/artifacts/Mastercard/flow/${{ steps.upload_flow.outputs.artifact-id }})" >> $GITHUB_STEP_SUMMARY
echo " * [angular coverage](https://bowlby.flowty.dev/flow/artifacts/Mastercard/flow/${{ steps.upload_angular.outputs.artifact-id }}/report/index.html)" >> $GITHUB_STEP_SUMMARY

0 comments on commit c60770b

Please sign in to comment.