Skip to content

PR #20371

PR #20371 #58

name: "Open CB: custom/manual builds B"
run-name: ${{ inputs.build-name != '' && inputs.build-name || format('Scala {0} @ {1} / {2} {3}{4}', inputs.published-scala-version != '' && inputs.published-scala-version || 'snapshot', inputs.repository-url, inputs.repository-branch, inputs.extra-scalac-options != '' && format('extraScalacOptions={0} ', inputs.extra-scalac-options) || '', inputs.disabled-scalac-options != '' && format('disabledScalacOptions={0}', inputs.disabled-scalac-options) || '' ) }}
on:
workflow_dispatch:
inputs:
build-name:
type: string
description: "Custom name of the job in GitHub Actions"
default: ""
published-scala-version:
type: string
description: "Published Scala version to use, if empty new version of compiler would be build with default name based on the selected repository"
repository-url:
type: string
description: "GitHub repository URL for compiler to build, ignored when published-scala-version is defined"
default: "scala/scala3"
repository-branch:
type: string
description: "GitHub repository branch for compiler to build, ignored when published-scala-version is defined"
default: "main"
extra-scalac-options:
type: string
description: "List of scalacOptions which should be used when building projects. Multiple entires should be seperated by a single comma character `,` (Best effort)"
default: ""
disabled-scalac-options:
type: string
description: "List of scalacOptions which should be filtered out when building projects. (Best effort)"
default: ""
extra-library-dependencies:
type: string
description: "List of library dependencies which should be injected when building projects, in format org:artifact:version, or org::artifact:version for Scala cross version. Multiple entires should be seperated by a single semicolon character `;`. (Best effort)"
default: ""
push-to-gh-pages:
type: boolean
description: "Should the workflow push the generated raport to gh-pages branch"
default: false
jobs:
# Name of this job need to match inputs of build-project/job-info
execute-build-plan:
uses: ./.github/workflows/buildPlan-B.yaml
with:
published-scala-version: ${{ inputs.published-scala-version }}
repository-url: ${{ inputs.repository-url }}
repository-branch: ${{ inputs.repository-branch }}
extra-scalac-options: ${{ inputs.extra-scalac-options }}
disabled-scalac-options: ${{ inputs.disabled-scalac-options }}
extra-library-dependencies: ${{ inputs.extra-library-dependencies }}
custom-build-id: ${{ inputs.build-name }}
secrets: inherit
create-raport:
needs: [execute-build-plan]
runs-on: ubuntu-22.04
continue-on-error: true
steps:
- name: Git Checkout
uses: actions/checkout@v4
- 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: |
scalaVersion=${{ needs.execute-build-plan.outputs.used-scala-version }}
lastRC="$(./scripts/lastVersionRC.sc)"
lastStable=$(./scripts/lastVersionStable.sc)
FOR_HTML=1 scala-cli scripts/raport-regressions.scala -- $scalaVersion > raport-full.rendered.md
scala-cli scripts/raport-regressions.scala -- $scalaVersion | tee raport-full.md
scala-cli scripts/raport-regressions.scala -- $scalaVersion --compareWith=$lastRC > raport-compare-$lastRC.md
scala-cli scripts/raport-regressions.scala -- $scalaVersion --compareWith=$lastStable > raport-compare-$lastStable.md
- name: Upload raports
uses: actions/upload-artifact@v3
with:
name: build-raports
path: ${{ github.workspace }}/raport-*.md
- uses: tibdex/github-app-token@v1
if: ${{ inputs.push-to-gh-pages }}
id: generate-token
with:
app_id: 303718
private_key: ${{ secrets.OPENCB_CONFIG_UPDATE_TOKEN }}
- name: Push raport
if: ${{ inputs.push-to-gh-pages }}
uses: ./.github/actions/push-raport-to-gh-pages
with:
artifact-name: build-raports
file-to-pick: raport-full.rendered.md
build-title: ${{ needs.execute-build-plan.outputs.used-scala-version }}
token: ${{ steps.generate-token.outputs.token }}