Skip to content

[library] Make Option.orNull public in binary (#26751) #35679

[library] Make Option.orNull public in binary (#26751)

[library] Make Option.orNull public in binary (#26751) #35679

Workflow file for this run

name: scaladoc
on:
push:
branches-ignore:
- 'language-reference-stable'
- 'gh-readonly-queue/**'
pull_request:
branches-ignore:
- 'language-reference-stable'
paths:
- 'docs/**'
- 'scaladoc*/**'
- 'compiler/src/dotty/tools/dotc/reporting/**' # When error codes or messages are updated, we need to update the documentation
- 'project/scripts/checkSidebarDocs.scala'
- 'project/scripts/validateScaladocLinks.sh'
- 'project/scripts/checkErrorCodeSnippets*.scala'
- '.github/workflows/scaladoc.yaml'
merge_group:
permissions:
contents: read
jobs:
build:
runs-on: ubuntu-latest
if: "github.event_name == 'merge_group'
|| ( github.event_name == 'pull_request'
&& !contains(github.event.pull_request.body, '[skip ci]')
&& !contains(github.event.pull_request.body, '[skip docs]')
)
|| contains(github.event.ref, 'scaladoc')
|| contains(github.event.ref, 'main')"
steps:
- name: Git Checkout
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
- name: Set up JDK 17
uses: actions/setup-java@03ad4de0992f5dab5e18fcb136590ce7c4a0ac95 # v5.6.0
with:
distribution: 'temurin'
java-version: 17
cache: 'sbt'
- uses: sbt/setup-sbt@bfea3c5f48abd221b04a6df4798aa5eb8b6a2baf # v1.5.6
- name: Compile and test scala3doc-js
run: ./project/scripts/sbt scaladoc-js-main/test
- name: Compile and test
run: |
./project/scripts/sbt scaladoc/test
./project/scripts/sbt dist/Universal/stage
./project/scripts/cmdScaladocTests
- name: Locally publish self
run: ./project/scripts/sbt scaladoc/publishLocal
- name: Generate self documentation
run: ./project/scripts/sbt scaladoc/generateSelfDocumentation
- name: Generate testcases documentation
run: ./project/scripts/sbt scaladoc/generateTestcasesDocumentation
- name: Generate reference documentation
run: ./project/scripts/sbt scaladoc/generateReferenceDocumentation
- name: Generate Scala 3 documentation
run: ./project/scripts/sbt scaladoc/generateScalaDocumentation
- name: Upload scaladoc output
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
with:
name: scaladoc-output
path: scaladoc/output/scala3
validate-docs:
if: github.event_name != 'pull_request' || !contains(github.event.pull_request.body, '[skip ci]')
runs-on: ubuntu-latest
steps:
- name: Git Checkout
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
- uses: coursier/cache-action@95e5b1029b6b86e7bac033ee44a0697d8a527d2d # v8.1.1
- uses: VirtusLab/scala-cli-setup@8db5313925605c20e292348c1749e80dac7eed0f # v1.16.0
- name: Validate docs sidebars
run: scala-cli ./project/scripts/checkSidebarDocs.scala
validate-generated-docs:
needs: build
if: github.event_name != 'pull_request' || !contains(github.event.pull_request.body, '[skip ci]')
runs-on: ubuntu-latest
steps:
- name: Git Checkout
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
fetch-depth: 0
- name: Download scaladoc output
uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1
with:
name: scaladoc-output
path: ./scaladoc-output/
- name: Set up Ruby
uses: ruby/setup-ruby@95ef2b042f9d7a56d8268cba8559e2842e2ad01b # v1.321.0
with:
ruby-version: '3.3'
- name: Install html-proofer
run: gem install html-proofer
- name: Check if docs/ was modified
id: docs-changed
run: |
if [ "${{ github.event_name }}" = "pull_request" ]; then
BASE="${{ github.event.pull_request.base.sha }}"
else
BASE="${{ github.event.before }}"
fi
if git diff --name-only "$BASE" HEAD | grep -q '^docs/'; then
echo "modified=true" >> $GITHUB_OUTPUT
else
echo "modified=false" >> $GITHUB_OUTPUT
fi
- name: Validate documentation links
run: ./project/scripts/validateScaladocLinks.sh scaladoc-output --checkExternalLinks=${{ steps.docs-changed.outputs.modified }}
stdlib-sourcelinks-test:
runs-on: ubuntu-latest
# if false - disable flaky test
if: "false && (( github.event_name == 'pull_request'
&& !contains(github.event.pull_request.body, '[skip ci]')
&& !contains(github.event.pull_request.body, '[skip docs]')
)
|| contains(github.event.ref, 'scaladoc')
|| contains(github.event.ref, 'scala3doc')
|| contains(github.event.ref, 'main'))"
steps:
- name: Git Checkout
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
- name: Set up JDK 17
uses: actions/setup-java@03ad4de0992f5dab5e18fcb136590ce7c4a0ac95 # v5.6.0
with:
distribution: 'temurin'
java-version: 17
- name: Test sourcelinks to stdlib
run: true # ./project/scripts/sbt scaladoc/sourceLinksIntegrationTest:test
check-error-code-snippets:
if: github.event_name != 'pull_request' || !contains(github.event.pull_request.body, '[skip ci]')
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
- uses: coursier/cache-action@95e5b1029b6b86e7bac033ee44a0697d8a527d2d # v8.1.1
- uses: VirtusLab/scala-cli-setup@8db5313925605c20e292348c1749e80dac7eed0f # v1.16.0
with:
jvm: temurin:17
apps: sbt
- name: Publish compiler locally
run: |
version=$(./project/scripts/sbt "print scala3-compiler-bootstrapped/version" | tail -n1)
echo "SCALA_VERSION=$version" >> $GITHUB_ENV
echo "Would test snippets using Scala $version"
# Publish locally minimal set of artifacts that would be required to test snippets
sbt "set every doc := new File(\"unused\");\
scala3-bootstrapped/publishLocal
"
- name: Test error code snippets
shell: bash
run: scala-cli test -S ${{ env.SCALA_VERSION }} --with-compiler project/scripts/checkErrorCodeSnippets.test.scala -- +l +a +c
- name: "[On failure] Print reproduction/fix steps"
if: failure()
run: |
cat << EOF >> $GITHUB_STEP_SUMMARY
Snippets validation for error codes failed
If you've modified messages of positions of error codes, you might need to update the expected outputs, to do it run: following command:
scala -S ${{ env.SCALA_VERSION }} project/scripts/checkErrorCodeSnippets.scala --with-compiler --main-class=updateAllErrorCodeOutputs
Single error code validation can be performed using:
scala -S ${{ env.SCALA_VERSION }} project/scripts/checkErrorCodeSnippets.scala --with-compiler -- docs/_docs/reference/error-codes/E001.md [--verbose --update-output]
To check the validation use dedicated test suite:
scala test -S ${{ env.SCALA_VERSION }} --with-compiler project/scripts/checkErrorCodeSnippets.test.scala -- +l +a +c
See ./docs/.ai/skill/add-error-code-docs.md for local skill for adding new error code docs.
EOF