<commit_before>name: CI for Scala3doc

on:
  push:
  pull_request:
jobs:
  build:
    env:
      AZURE_STORAGE_SAS_TOKEN: ${{ secrets.AZURE_STORAGE_SAS_TOKEN }}
    runs-on: ubuntu-latest
    if: "github.event_name == 'pull_request' || contains(github.event.ref, 'scala3doc') || contains(github.event.ref, 'master')"

    steps:
      - name: Git Checkout
        uses: actions/checkout@v2

      - name: Cache Coursier
        uses: actions/cache@v1
        with:
          path: ~/.cache/coursier
          key: sbt-coursier-cache
      - name: Cache SBT
        uses: actions/cache@v1
        with:
          path: ~/.sbt
          key: sbt-${{ hashFiles('**/build.sbt') }}

      - name: Set up JDK 11
        uses: actions/setup-java@v1
        with:
          java-version: 11

      - name: Compile and test
        run: ./project/scripts/sbt scala3doc/test

      - name: Locally publish self
        run: ./project/scripts/sbt scala3doc/publishLocal

      - name: Generate self documentation
        run: ./project/scripts/sbt scala3doc/generateSelfDocumentation

      - name: Generate testcases documentation
        run: ./project/scripts/sbt scala3doc/generateTestcasesDocumentation

      - name: Generate Scala 3 documentation
        run: ./project/scripts/sbt scala3doc/generateScala3Documentation

      - name: Generate documentation for example project using dotty-sbt
        run: ./project/scripts/sbt "sbt-dotty/scripted sbt-dotty/scala3doc"

      - name: Generate index file
        run: scala3doc/scripts/mk-index.sh scala3doc/output > scala3doc/output/index.html

      - name: Upload documentation to server
        uses: azure/CLI@v1
        if: env.AZURE_STORAGE_SAS_TOKEN
        env:
          PR_NUMBER: ${{ github.event.pull_request.number }}
        with:
          inlineScript: |
            DOC_DEST=pr-${PR_NUMBER:-${GITHUB_REF##*/}}
            echo uplading docs to https://scala3doc.virtuslab.com/$DOC_DEST
            az storage container create --name $DOC_DEST --account-name scala3docstorage --public-access container
            az storage blob sync -s scala3doc/output -c $DOC_DEST --account-name scala3docstorage<commit_msg>Run doc on community build over CI<commit_after>name: CI for Scala3doc

on:
  push:
  pull_request:
jobs:
  build:
    env:
      AZURE_STORAGE_SAS_TOKEN: ${{ secrets.AZURE_STORAGE_SAS_TOKEN }}
    runs-on: ubuntu-latest
    if: "github.event_name == 'pull_request' || contains(github.event.ref, 'scala3doc') || contains(github.event.ref, 'master')"

    steps:
      - name: Git Checkout
        uses: actions/checkout@v2

      - name: Cache Coursier
        uses: actions/cache@v1
        with:
          path: ~/.cache/coursier
          key: sbt-coursier-cache
      - name: Cache SBT
        uses: actions/cache@v1
        with:
          path: ~/.sbt
          key: sbt-${{ hashFiles('**/build.sbt') }}

      - name: Set up JDK 11
        uses: actions/setup-java@v1
        with:
          java-version: 11

      - name: Compile and test
        run: ./project/scripts/sbt scala3doc/test

      - name: Locally publish self
        run: ./project/scripts/sbt scala3doc/publishLocal

      - name: Generate self documentation
        run: ./project/scripts/sbt scala3doc/generateSelfDocumentation

      - name: Generate testcases documentation
        run: ./project/scripts/sbt scala3doc/generateTestcasesDocumentation

      - name: Generate Scala 3 documentation
        run: ./project/scripts/sbt scala3doc/generateScala3Documentation

      - name: Generate documentation for example project using dotty-sbt
        run: ./project/scripts/sbt "sbt-dotty/scripted sbt-dotty/scala3doc"

      - name: Generate index file
        run: scala3doc/scripts/mk-index.sh scala3doc/output > scala3doc/output/index.html

      - name: Upload documentation to server
        uses: azure/CLI@v1
        if: env.AZURE_STORAGE_SAS_TOKEN
        env:
          PR_NUMBER: ${{ github.event.pull_request.number }}
        with:
          inlineScript: |
            DOC_DEST=pr-${PR_NUMBER:-${GITHUB_REF##*/}}
            echo uplading docs to https://scala3doc.virtuslab.com/$DOC_DEST
            az storage container create --name $DOC_DEST --account-name scala3docstorage --public-access container
            az storage blob sync -s scala3doc/output -c $DOC_DEST --account-name scala3docstorage

  community-docs:
    env:
      AZURE_STORAGE_SAS_TOKEN: ${{ secrets.AZURE_STORAGE_SAS_TOKEN }}
    runs-on: ubuntu-latest
    if: "github.event_name == 'pull_request' || contains(github.event.ref, 'scala3doc') || contains(github.event.ref, 'master')"

    steps:
      - name: Git Checkout
        uses: actions/checkout@v2

      - name: Set up JDK 8
        uses: actions/setup-java@v1
        with:
          java-version: 8

      - name: Init submodules
        run: git submodule update --init --recursive --jobs 7

      - name: Generate docs
        run: ./project/scripts/sbt "community-build/run doc all docsOutput"

      - name: Upload documentation to server
        uses: azure/CLI@v1
        if: env.AZURE_STORAGE_SAS_TOKEN
        env:
          PR_NUMBER: ${{ github.event.pull_request.number }}
        with:
          inlineScript: |
            DOC_DEST=pr-${PR_NUMBER:-${GITHUB_REF##*/}}-docs
            echo uplading docs to https://scala3doc.virtuslab.com/$DOC_DEST
            az storage container create --name $DOC_DEST --account-name scala3docstorage --public-access container
            az storage blob sync -s community-build/docsOutput -c $DOC_DEST --account-name scala3docstorage
{'fraction_non_alphanumeric': 0.10367054610564011, 'fraction_numerical': 0.011101163831692032, 'mean_word_length': 2.3131672597864767, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 5, 'https://': 3, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2467907', 'n_tokens_mistral': 1838, 'n_tokens_neox': 1744, 'n_words': 402}