Skip to content

PR-21185-fixed

PR-21185-fixed #44

Workflow file for this run

name: "Open CB: compare builds"
run-name: ${{ inputs.build-name != '' && inputs.build-name || format('version={0}, buildId={1} vs version=${2}, buildId={3}', inputs.scala-version, inputs.build-id, inputs.compare-with-scala-version, inputs.compare-with-build-id) }}
on:
workflow_dispatch:
inputs:
build-name:
type: string
description: "Custom name of the job in GitHub Actions"
default: ""
scala-version:
type: string
description: "Reference version of Scala"
default: ""
compare-with-scala-version:
type: string
description: "Version of Scala to compare against"
default: ""
build-id:
type: string
description: "Optional version of reference build id"
default: ""
compare-with-build-id:
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
steps:
- name: Git Checkout
uses: actions/checkout@v4
- uses: coursier/[email protected]
- name: Install coursier
uses: coursier/setup-action@v1
with:
apps: scala-cli:1.2.0
- name: Generate raport
env:
ES_USER: ${{ secrets.OPENCB_ELASTIC_USER }}
ES_PASSWORD: ${{ secrets.OPENCB_ELASTIC_PSWD }}
run: |
scala-cli scripts/raport-regressions.scala -- \
${{ inputs.scala-version }} \
--compareWith=${{ inputs.compare-with-scala-version }} \
--buildId=${{ inputs.build-id }} \
--compareWithBuildId=${{ inputs.compare-with-build-id }}
- name: Compare versions
if: inputs.compare-with-scala-version != ''
env:
ES_USER: ${{ secrets.OPENCB_ELASTIC_USER }}
ES_PASSWORD: ${{ secrets.OPENCB_ELASTIC_PSWD }}
run: |
scala-cli scripts/compareVersions.scala -- \
${{ inputs.compare-with-scala-version }} \
${{ inputs.scala-version }}
- name: Generate GH-page raport
if: ${{ inputs.push-to-gh-pages }}
env:
ES_USER: ${{ secrets.OPENCB_ELASTIC_USER }}
ES_PASSWORD: ${{ secrets.OPENCB_ELASTIC_PSWD }}
run: |
scalaVersion=${{ inputs.scala-version }}
FOR_HTML=1 scala-cli scripts/raport-regressions.scala -- $scalaVersion > raport-full.md
- name: Upload raports
uses: actions/upload-artifact@v3
if: ${{ inputs.push-to-gh-pages && inputs.scala-version != '' }}
with:
name: build-raports
path: ${{ github.workspace }}/raport-*.md
- uses: tibdex/github-app-token@v1
if: ${{ inputs.push-to-gh-pages && 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 && 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 }}