Skip to content

Commit

Permalink
[ci] On-demand gh page report update for ScalaVersion
Browse files Browse the repository at this point in the history
  • Loading branch information
WojciechMazur committed May 25, 2023
1 parent 59c231b commit 2249ebd
Showing 1 changed file with 36 additions and 0 deletions.
36 changes: 36 additions & 0 deletions .github/workflows/compare.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,10 @@ on:
type: string
description: "Optional version of build id to compare against. BuildId is equal to the GitHub Action Id, based on the Action URL format: `github.com/<org>/<repo>/actions/runs/<build-id>`)"
default: ""
push-to-gh-pages:
type: boolean
description: "Should the workflow push the generated raport to gh-pages branch"
default: false
jobs:
create-raport:
runs-on: ubuntu-22.04
Expand All @@ -45,3 +49,35 @@ jobs:
--compareWith=${{ inputs.compare-with-scala-version }} \
--buildId=${{ inputs.build-id }} \
--compareWithBuildId=${{ inputs.compare-with-build-id }}

- name: Generate GH-page raport
if: ${{ inputs.push-to-gh-pages == 'true' }}
env:
ES_USER: ${{ secrets.OPENCB_ELASTIC_USER }}
ES_PASSWORD: ${{ secrets.OPENCB_ELASTIC_PSWD }}
run: |
scalaVersion=${{ inputs.scala-version }}
scala-cli scripts/raport-regressions.scala scripts/md_printer.scala -- $scalaVersion > raport-full.md
- name: Upload raports
uses: actions/upload-artifact@v3
if: ${{ inputs.push-to-gh-pages == 'true' && inputs.scala-version != '' }}
with:
name: build-raports
path: ${{ github.workspace }}/raport-*.md

- uses: tibdex/github-app-token@v1
if: ${{ inputs.push-to-gh-pages == 'true' && inputs.scala-version != '' }}
id: generate-token
with:
app_id: 303718
private_key: ${{ secrets.OPENCB_CONFIG_UPDATE_TOKEN }}

- name: Push raport
if: ${{ inputs.push-to-gh-pages == 'true' && inputs.scala-version != '' }}
uses: ./.github/actions/push-raport-to-gh-pages
with:
artifact-name: build-raports
file-to-pick: raport-full.md
build-title: ${{ inputs.scala-version }}
token: ${{ steps.generate-token.outputs.token }}

0 comments on commit 2249ebd

Please sign in to comment.