diff --git a/.github/workflows/bowlby_health.yml b/.github/workflows/bowlby_health.yml new file mode 100644 index 0000000000..faf3635ff6 --- /dev/null +++ b/.github/workflows/bowlby_health.yml @@ -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 diff --git a/.github/workflows/mutation.yml b/.github/workflows/mutation.yml index 5afce995de..cfb8e9fd24 100644 --- a/.github/workflows/mutation.yml +++ b/.github/workflows/mutation.yml @@ -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 diff --git a/.github/workflows/reindex.yml b/.github/workflows/reindex.yml deleted file mode 100644 index cef5a8c3da..0000000000 --- a/.github/workflows/reindex.yml +++ /dev/null @@ -1,25 +0,0 @@ -name: Reindex build artifacts - -on: - workflow_dispatch - -permissions: # added using https://github.com/step-security/secure-workflows - contents: read - -jobs: - index: - permissions: - contents: write # for stefanzweifel/git-auto-commit-action to push code in repo - runs-on: ubuntu-latest - steps: - - name: Checkout - uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7 - with: - ref: pages - - - name: Index - run: perl regen_index.pl >> $GITHUB_STEP_SUMMARY - - - name: Commit - uses: stefanzweifel/git-auto-commit-action@8621497c8c39c72f3e2a999a26b4ca1b5058a842 # v5.0.1 - diff --git a/.github/workflows/static_artifacts.yml b/.github/workflows/static_artifacts.yml new file mode 100644 index 0000000000..a682676e9a --- /dev/null +++ b/.github/workflows/static_artifacts.yml @@ -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 diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 0351c065b4..36fd6352ab 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -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