From eb50c4f28d978fcd914b819d523e8da607d05b0c Mon Sep 17 00:00:00 2001 From: Ignat Beresnev Date: Fri, 21 Apr 2023 18:29:22 +0200 Subject: Clean up GitHub workflows (#2951) * Run Gradle wrapper checksum less often * Do not publish examples as artifacts in internal PRs --- .github/workflows/check-api.yml | 23 ++++ .github/workflows/check-gradle.yml | 17 +++ .github/workflows/check.yml | 28 ---- .github/workflows/dokka-examples.yml | 143 -------------------- .github/workflows/examples-build.yml | 146 +++++++++++++++++++++ .../workflows/gh-actions-artifacts-snapshots.yml | 89 ------------- .github/workflows/gh-pages-deploy-examples.yml | 99 ++++++++++++++ .github/workflows/gh-pages-deploy-mkdocs.yml | 40 ++++++ .github/workflows/gh-pages-examples.yml | 97 -------------- .github/workflows/gh-pages.yml | 48 ------- .github/workflows/gradle-test.pr.yml | 47 ------- .github/workflows/preview-cleanup-web-s3.yml | 20 +++ .github/workflows/preview-publish-ga.yml | 96 ++++++++++++++ .github/workflows/preview-publish-web-s3.yml | 101 ++++++++++++++ .github/workflows/rebase.yml | 20 --- .github/workflows/s3-cleanup.yml | 19 --- .github/workflows/s3-snapshots.yml | 101 -------------- .github/workflows/tests-smoke.yml | 35 +++++ .github/workflows/tests-thorough.yml | 36 +++++ 19 files changed, 613 insertions(+), 592 deletions(-) create mode 100644 .github/workflows/check-api.yml create mode 100644 .github/workflows/check-gradle.yml delete mode 100644 .github/workflows/check.yml delete mode 100644 .github/workflows/dokka-examples.yml create mode 100644 .github/workflows/examples-build.yml delete mode 100644 .github/workflows/gh-actions-artifacts-snapshots.yml create mode 100644 .github/workflows/gh-pages-deploy-examples.yml create mode 100644 .github/workflows/gh-pages-deploy-mkdocs.yml delete mode 100644 .github/workflows/gh-pages-examples.yml delete mode 100644 .github/workflows/gh-pages.yml delete mode 100644 .github/workflows/gradle-test.pr.yml create mode 100644 .github/workflows/preview-cleanup-web-s3.yml create mode 100644 .github/workflows/preview-publish-ga.yml create mode 100644 .github/workflows/preview-publish-web-s3.yml delete mode 100644 .github/workflows/rebase.yml delete mode 100644 .github/workflows/s3-cleanup.yml delete mode 100644 .github/workflows/s3-snapshots.yml create mode 100644 .github/workflows/tests-smoke.yml create mode 100644 .github/workflows/tests-thorough.yml (limited to '.github/workflows') diff --git a/.github/workflows/check-api.yml b/.github/workflows/check-api.yml new file mode 100644 index 00000000..7322809e --- /dev/null +++ b/.github/workflows/check-api.yml @@ -0,0 +1,23 @@ +name: API check + +on: pull_request + +concurrency: + group: '${{ github.workflow }} @ ${{ github.event.pull_request.head.label || github.head_ref || github.ref }}' + cancel-in-progress: true + +jobs: + apiCheck: + name: binary compatibility + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + - uses: actions/setup-java@v3 + with: + distribution: 'zulu' + java-version: 17 + cache: 'maven' + - uses: gradle/gradle-build-action@v2 + with: + gradle-home-cache-cleanup: true + arguments: apiCheck --stacktrace diff --git a/.github/workflows/check-gradle.yml b/.github/workflows/check-gradle.yml new file mode 100644 index 00000000..1e85a4d2 --- /dev/null +++ b/.github/workflows/check-gradle.yml @@ -0,0 +1,17 @@ +name: Gradle check + +on: + push: + branches: + - master + pull_request: + paths: + - 'gradle/**' + +jobs: + wrapper: + name: wrapper checksums + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + - uses: gradle/wrapper-validation-action@v1 diff --git a/.github/workflows/check.yml b/.github/workflows/check.yml deleted file mode 100644 index f3ae5ded..00000000 --- a/.github/workflows/check.yml +++ /dev/null @@ -1,28 +0,0 @@ -name: Check - -on: pull_request - -concurrency: - group: '${{ github.workflow }} @ ${{ github.event.pull_request.head.label || github.head_ref || github.ref }}' - cancel-in-progress: true - -jobs: - validate-wrapper: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v3 - - uses: gradle/wrapper-validation-action@v1 - - apiCheck: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v3 - - uses: actions/setup-java@v3 - with: - distribution: 'zulu' - java-version: 17 - cache: 'maven' - - uses: gradle/gradle-build-action@v2 - with: - gradle-home-cache-cleanup: true - arguments: apiCheck --stacktrace diff --git a/.github/workflows/dokka-examples.yml b/.github/workflows/dokka-examples.yml deleted file mode 100644 index 4d3a9f8d..00000000 --- a/.github/workflows/dokka-examples.yml +++ /dev/null @@ -1,143 +0,0 @@ -name: Build examples - -on: pull_request - -concurrency: - group: '${{ github.workflow }} @ ${{ github.event.pull_request.head.label || github.head_ref || github.ref }}' - cancel-in-progress: true - -jobs: - build: - strategy: - matrix: - projects: [ - examples/gradle/dokka-gradle-example, - examples/gradle/dokka-kotlinAsJava-example, - examples/gradle/dokka-library-publishing-example, - examples/gradle/dokka-multimodule-example, - examples/gradle/dokka-multiplatform-example, - examples/gradle/dokka-customFormat-example - ] - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v3 - - uses: dorny/paths-filter@v2 - id: filter - with: - filters: | - examples_changed: - - '${{ matrix.projects }}/**' - - uses: actions/setup-java@v3 - with: - distribution: 'zulu' - java-version: 17 - cache: 'maven' - - uses: gradle/gradle-build-action@v2 - with: - gradle-home-cache-cleanup: true - - run: ./gradlew build --no-daemon --stacktrace - working-directory: ${{ matrix.projects }} - if: steps.filter.outputs.examples_changed == 'true' - - run-dokka-html: - strategy: - matrix: - projects: [ - examples/gradle/dokka-gradle-example, - examples/gradle/dokka-kotlinAsJava-example, - examples/gradle/dokka-library-publishing-example, - examples/gradle/dokka-multiplatform-example, - examples/gradle/dokka-customFormat-example - ] - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v3 - - uses: dorny/paths-filter@v2 - id: filter - with: - filters: | - examples_changed: - - '${{ matrix.projects }}/**' - - uses: actions/setup-java@v3 - with: - distribution: 'zulu' - java-version: 17 - cache: 'maven' - - uses: gradle/gradle-build-action@v2 - with: - gradle-home-cache-cleanup: true - - run: ./gradlew dokkaHtml --no-daemon --stacktrace - working-directory: ${{ matrix.projects }} - if: steps.filter.outputs.examples_changed == 'true' - - run-dokka-publishing: - strategy: - matrix: - tasks: [ dokkaJavadocJar, dokkaHtmlJar ] - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v3 - - uses: dorny/paths-filter@v2 - id: filter - with: - filters: | - examples_changed: - - 'examples/gradle/dokka-library-publishing-example/**' - - uses: actions/setup-java@v3 - with: - distribution: 'zulu' - java-version: 17 - cache: 'maven' - - uses: gradle/gradle-build-action@v2 - with: - gradle-home-cache-cleanup: true - - run: ./gradlew ${{ matrix.tasks }} --no-daemon --stacktrace - working-directory: examples/gradle/dokka-library-publishing-example - if: steps.filter.outputs.examples_changed == 'true' - - run-dokka-gradle-tasks: - runs-on: ubuntu-latest - strategy: - matrix: - include: - - task: "dokkaHtmlMultiModule" - dir: "examples/gradle/dokka-multimodule-example" - steps: - - uses: actions/checkout@v3 - - uses: dorny/paths-filter@v2 - id: filter - with: - filters: | - examples_changed: - - '${{ matrix.dir }}/**' - - uses: actions/setup-java@v3 - with: - distribution: 'zulu' - java-version: 17 - cache: 'maven' - - uses: gradle/gradle-build-action@v2 - with: - gradle-home-cache-cleanup: true - - run: ./gradlew ${{ matrix.task }} --no-daemon --stacktrace - working-directory: ${{ matrix.dir }} - if: steps.filter.outputs.examples_changed == 'true' - - run-dokka-maven-example: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v3 - - uses: dorny/paths-filter@v2 - id: filter - with: - filters: | - examples_changed: - - 'examples/maven/**' - working-directory: examples/maven - - uses: actions/setup-java@v3 - with: - distribution: 'zulu' - java-version: 17 - cache: 'maven' - - run: mvn compile dokka:dokka - working-directory: examples/maven - if: steps.filter.outputs.examples_changed == 'true' diff --git a/.github/workflows/examples-build.yml b/.github/workflows/examples-build.yml new file mode 100644 index 00000000..18aa2985 --- /dev/null +++ b/.github/workflows/examples-build.yml @@ -0,0 +1,146 @@ +name: Build examples + +on: + pull_request: + paths: + - 'examples/**' + +concurrency: + group: '${{ github.workflow }} @ ${{ github.event.pull_request.head.label || github.head_ref || github.ref }}' + cancel-in-progress: true + +jobs: + build: + strategy: + matrix: + projects: [ + examples/gradle/dokka-gradle-example, + examples/gradle/dokka-kotlinAsJava-example, + examples/gradle/dokka-library-publishing-example, + examples/gradle/dokka-multimodule-example, + examples/gradle/dokka-multiplatform-example, + examples/gradle/dokka-customFormat-example + ] + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + - uses: dorny/paths-filter@v2 + id: filter + with: + filters: | + examples_changed: + - '${{ matrix.projects }}/**' + - uses: actions/setup-java@v3 + with: + distribution: 'zulu' + java-version: 17 + cache: 'maven' + - uses: gradle/gradle-build-action@v2 + with: + gradle-home-cache-cleanup: true + - run: ./gradlew build --no-daemon --stacktrace + working-directory: ${{ matrix.projects }} + if: steps.filter.outputs.examples_changed == 'true' + + run-dokka-html: + strategy: + matrix: + projects: [ + examples/gradle/dokka-gradle-example, + examples/gradle/dokka-kotlinAsJava-example, + examples/gradle/dokka-library-publishing-example, + examples/gradle/dokka-multiplatform-example, + examples/gradle/dokka-customFormat-example + ] + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + - uses: dorny/paths-filter@v2 + id: filter + with: + filters: | + examples_changed: + - '${{ matrix.projects }}/**' + - uses: actions/setup-java@v3 + with: + distribution: 'zulu' + java-version: 17 + cache: 'maven' + - uses: gradle/gradle-build-action@v2 + with: + gradle-home-cache-cleanup: true + - run: ./gradlew dokkaHtml --no-daemon --stacktrace + working-directory: ${{ matrix.projects }} + if: steps.filter.outputs.examples_changed == 'true' + + run-dokka-publishing: + strategy: + matrix: + tasks: [ dokkaJavadocJar, dokkaHtmlJar ] + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + - uses: dorny/paths-filter@v2 + id: filter + with: + filters: | + examples_changed: + - 'examples/gradle/dokka-library-publishing-example/**' + - uses: actions/setup-java@v3 + with: + distribution: 'zulu' + java-version: 17 + cache: 'maven' + - uses: gradle/gradle-build-action@v2 + with: + gradle-home-cache-cleanup: true + - run: ./gradlew ${{ matrix.tasks }} --no-daemon --stacktrace + working-directory: examples/gradle/dokka-library-publishing-example + if: steps.filter.outputs.examples_changed == 'true' + + run-dokka-gradle-tasks: + runs-on: ubuntu-latest + strategy: + matrix: + include: + - task: "dokkaHtmlMultiModule" + dir: "examples/gradle/dokka-multimodule-example" + steps: + - uses: actions/checkout@v3 + - uses: dorny/paths-filter@v2 + id: filter + with: + filters: | + examples_changed: + - '${{ matrix.dir }}/**' + - uses: actions/setup-java@v3 + with: + distribution: 'zulu' + java-version: 17 + cache: 'maven' + - uses: gradle/gradle-build-action@v2 + with: + gradle-home-cache-cleanup: true + - run: ./gradlew ${{ matrix.task }} --no-daemon --stacktrace + working-directory: ${{ matrix.dir }} + if: steps.filter.outputs.examples_changed == 'true' + + run-dokka-maven-example: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + - uses: dorny/paths-filter@v2 + id: filter + with: + filters: | + examples_changed: + - 'examples/maven/**' + working-directory: examples/maven + - uses: actions/setup-java@v3 + with: + distribution: 'zulu' + java-version: 17 + cache: 'maven' + - run: mvn compile dokka:dokka + working-directory: examples/maven + if: steps.filter.outputs.examples_changed == 'true' diff --git a/.github/workflows/gh-actions-artifacts-snapshots.yml b/.github/workflows/gh-actions-artifacts-snapshots.yml deleted file mode 100644 index d027b009..00000000 --- a/.github/workflows/gh-actions-artifacts-snapshots.yml +++ /dev/null @@ -1,89 +0,0 @@ -name: Build example projects and publish them to GitHub Actions Artifacts - -on: - pull_request: - push: - branches: - - master - -jobs: - coroutines: - runs-on: ubuntu-latest - if: github.repository == 'Kotlin/dokka' - steps: - - name: Checkout dokka - uses: actions/checkout@v3 - with: - submodules: true - - uses: actions/setup-java@v3 - with: - distribution: 'zulu' - java-version: 17 - cache: 'maven' - - name: Document coroutines - uses: gradle/gradle-build-action@v2 - with: - gradle-home-cache-cleanup: true - arguments: :integration-tests:gradle:integrationTest --tests org.jetbrains.dokka.it.gradle.kotlin.CoroutinesGradleIntegrationTest --stacktrace - env: - DOKKA_TEST_OUTPUT_PATH: /home/runner/work/dokka/coroutines - - name: Copy files to GitHub Actions Artifacts - uses: actions/upload-artifact@v3 - with: - name: dokka-coroutines - path: /home/runner/work/dokka/coroutines - retention-days: 7 - - serialization: - runs-on: ubuntu-latest - if: github.repository == 'Kotlin/dokka' - steps: - - name: Checkout dokka - uses: actions/checkout@v3 - with: - submodules: true - - uses: actions/setup-java@v3 - with: - distribution: 'zulu' - java-version: 17 - cache: 'maven' - - name: Document serialization - uses: gradle/gradle-build-action@v2 - with: - gradle-home-cache-cleanup: true - arguments: :integration-tests:gradle:integrationTest --tests org.jetbrains.dokka.it.gradle.kotlin.SerializationGradleIntegrationTest --stacktrace - env: - DOKKA_TEST_OUTPUT_PATH: /home/runner/work/dokka/serialization - - name: Copy files to GitHub Actions Artifacts - uses: actions/upload-artifact@v3 - with: - name: dokka-serialization - path: /home/runner/work/dokka/serialization - retention-days: 7 - - biojava: - runs-on: ubuntu-latest - if: github.repository == 'Kotlin/dokka' - steps: - - name: Checkout dokka - uses: actions/checkout@v3 - with: - submodules: true - - uses: actions/setup-java@v3 - with: - distribution: 'zulu' - java-version: 17 - cache: 'maven' - - name: Document biojava-core - uses: gradle/gradle-build-action@v2 - with: - gradle-home-cache-cleanup: true - arguments: :integration-tests:maven:integrationTest --tests org.jetbrains.dokka.it.maven.BiojavaIntegrationTest --stacktrace - env: - DOKKA_TEST_OUTPUT_PATH: /home/runner/work/dokka/biojava - - name: Copy files to GitHub Actions Artifacts - uses: actions/upload-artifact@v3 - with: - name: dokka-biojava - path: /home/runner/work/dokka/biojava - retention-days: 7 diff --git a/.github/workflows/gh-pages-deploy-examples.yml b/.github/workflows/gh-pages-deploy-examples.yml new file mode 100644 index 00000000..752d8f0f --- /dev/null +++ b/.github/workflows/gh-pages-deploy-examples.yml @@ -0,0 +1,99 @@ +name: Deploy examples to GitHub Pages + +on: + push: + branches: + - master + paths: + - 'examples/**' + +jobs: + build-examples: + runs-on: ubuntu-latest + if: github.repository == 'Kotlin/dokka' + strategy: + matrix: + projects: [ + dokka-gradle-example, + dokka-kotlinAsJava-example, + dokka-library-publishing-example, + dokka-multiplatform-example, + dokka-customFormat-example + ] + steps: + - uses: actions/checkout@v3 + - uses: dorny/paths-filter@v2 + id: filter + with: + filters: | + examples_changed: + - 'examples/gradle/${{ matrix.projects }}/**' + - uses: actions/setup-java@v3 + with: + distribution: 'zulu' + java-version: 17 + cache: 'maven' + - uses: gradle/gradle-build-action@v2 + with: + gradle-home-cache-cleanup: true + - name: Build html + run: ./gradlew dokkaHtml --no-daemon --stacktrace + working-directory: examples/gradle/${{ matrix.projects }} + if: steps.filter.outputs.examples_changed == 'true' + - name: Upload artifact + uses: actions/upload-artifact@v2 + if: steps.filter.outputs.examples_changed == 'true' + with: + name: ${{ matrix.projects }} + path: examples/gradle/${{ matrix.projects }}/build/dokka + + build-multimodule-examples: + runs-on: ubuntu-latest + if: github.repository == 'Kotlin/dokka' + strategy: + matrix: + projects: [ + dokka-versioning-multimodule-example, + dokka-multimodule-example + ] + steps: + - uses: actions/checkout@v3 + - uses: dorny/paths-filter@v2 + id: filter + with: + filters: | + examples_changed: + - 'examples/gradle/${{ matrix.projects }}/**' + - uses: actions/setup-java@v3 + with: + distribution: 'zulu' + java-version: 17 + cache: 'maven' + - uses: gradle/gradle-build-action@v2 + with: + gradle-home-cache-cleanup: true + - name: Build html + run: ./gradlew dokkaHtmlMultiModule --no-daemon --stacktrace + working-directory: examples/gradle/${{ matrix.projects }} + if: steps.filter.outputs.examples_changed == 'true' + - name: Upload artifact + uses: actions/upload-artifact@v2 + if: steps.filter.outputs.examples_changed == 'true' + with: + name: ${{ matrix.projects }} + path: examples/gradle/${{ matrix.projects }}/parentProject/build/dokka + + deploy-examples: + runs-on: ubuntu-latest + needs: [ build-examples, build-multimodule-examples ] + steps: + - uses: actions/download-artifact@v2 + with: + path: public/examples + - name: Deploy + uses: peaceiris/actions-gh-pages@v3 + with: + github_token: ${{ secrets.GITHUB_TOKEN }} + keep_files: true + publish_dir: ./public + full_commit_message: Publish examples diff --git a/.github/workflows/gh-pages-deploy-mkdocs.yml b/.github/workflows/gh-pages-deploy-mkdocs.yml new file mode 100644 index 00000000..b212f55b --- /dev/null +++ b/.github/workflows/gh-pages-deploy-mkdocs.yml @@ -0,0 +1,40 @@ +name: Deploy MkDocs to GitHub Pages + +on: + push: + branches: + - master + paths: + - 'mkdocs/**' + release: + types: [ published ] + +jobs: + docs: + if: github.repository == 'Kotlin/dokka' + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + with: + path: dokka + - uses: actions/setup-java@v3 + with: + distribution: 'zulu' + java-version: 17 + cache: 'maven' + - uses: gradle/gradle-build-action@v2 + with: + gradle-home-cache-cleanup: true + - name: Get current dokka version + run: echo "DOKKA_VERSION=`./gradlew :properties | grep '^version:.*' | cut -d ' ' -f 2`" >> $GITHUB_ENV + working-directory: ./dokka + - name: Build docs + run: ./gradlew mkdocsBuild -Pdokka_version=$DOKKA_VERSION --info + working-directory: ./dokka + - name: Deploy + uses: peaceiris/actions-gh-pages@v3 + with: + github_token: ${{ secrets.GITHUB_TOKEN }} + publish_dir: ./dokka/mkdocs/build/mkdocs + keep_files: true + full_commit_message: Publish ${{ env.DOKKA_VERSION }} documentation diff --git a/.github/workflows/gh-pages-examples.yml b/.github/workflows/gh-pages-examples.yml deleted file mode 100644 index 81c9f195..00000000 --- a/.github/workflows/gh-pages-examples.yml +++ /dev/null @@ -1,97 +0,0 @@ -name: Build and deploy examples to GitHub Pages - -on: - push: - branches: - - master - -jobs: - build-examples: - runs-on: ubuntu-latest - if: github.repository == 'Kotlin/dokka' - strategy: - matrix: - projects: [ - dokka-gradle-example, - dokka-kotlinAsJava-example, - dokka-library-publishing-example, - dokka-multiplatform-example, - dokka-customFormat-example - ] - steps: - - uses: actions/checkout@v3 - - uses: dorny/paths-filter@v2 - id: filter - with: - filters: | - examples_changed: - - 'examples/gradle/${{ matrix.projects }}/**' - - uses: actions/setup-java@v3 - with: - distribution: 'zulu' - java-version: 17 - cache: 'maven' - - uses: gradle/gradle-build-action@v2 - with: - gradle-home-cache-cleanup: true - - name: Build html - run: ./gradlew dokkaHtml --no-daemon --stacktrace - working-directory: examples/gradle/${{ matrix.projects }} - if: steps.filter.outputs.examples_changed == 'true' - - name: Upload artifact - uses: actions/upload-artifact@v2 - if: steps.filter.outputs.examples_changed == 'true' - with: - name: ${{ matrix.projects }} - path: examples/gradle/${{ matrix.projects }}/build/dokka - - build-multimodule-examples: - runs-on: ubuntu-latest - if: github.repository == 'Kotlin/dokka' - strategy: - matrix: - projects: [ - dokka-versioning-multimodule-example, - dokka-multimodule-example - ] - steps: - - uses: actions/checkout@v3 - - uses: dorny/paths-filter@v2 - id: filter - with: - filters: | - examples_changed: - - 'examples/gradle/${{ matrix.projects }}/**' - - uses: actions/setup-java@v3 - with: - distribution: 'zulu' - java-version: 17 - cache: 'maven' - - uses: gradle/gradle-build-action@v2 - with: - gradle-home-cache-cleanup: true - - name: Build html - run: ./gradlew dokkaHtmlMultiModule --no-daemon --stacktrace - working-directory: examples/gradle/${{ matrix.projects }} - if: steps.filter.outputs.examples_changed == 'true' - - name: Upload artifact - uses: actions/upload-artifact@v2 - if: steps.filter.outputs.examples_changed == 'true' - with: - name: ${{ matrix.projects }} - path: examples/gradle/${{ matrix.projects }}/parentProject/build/dokka - - deploy-examples: - runs-on: ubuntu-latest - needs: [ build-examples, build-multimodule-examples ] - steps: - - uses: actions/download-artifact@v2 - with: - path: public/examples - - name: Deploy - uses: peaceiris/actions-gh-pages@v3 - with: - github_token: ${{ secrets.GITHUB_TOKEN }} - keep_files: true - publish_dir: ./public - full_commit_message: Publish examples diff --git a/.github/workflows/gh-pages.yml b/.github/workflows/gh-pages.yml deleted file mode 100644 index ab8e9aeb..00000000 --- a/.github/workflows/gh-pages.yml +++ /dev/null @@ -1,48 +0,0 @@ -name: Build and deploy MkDocs to GitHub Pages - -on: - push: - branches: - - master - release: - types: [ published ] - -jobs: - docs: - if: github.repository == 'Kotlin/dokka' - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v3 - with: - path: dokka - - uses: dorny/paths-filter@v2 - id: filter - with: - filters: | - mkdocs_changed: - - 'mkdocs/**' - working-directory: ./dokka - - uses: actions/setup-java@v3 - with: - distribution: 'zulu' - java-version: 17 - cache: 'maven' - - uses: gradle/gradle-build-action@v2 - with: - gradle-home-cache-cleanup: true - - name: Get current dokka version - run: echo "DOKKA_VERSION=`./gradlew :properties | grep '^version:.*' | cut -d ' ' -f 2`" >> $GITHUB_ENV - if: github.event_name == 'release' || steps.filter.outputs.mkdocs_changed == 'true' - working-directory: ./dokka - - name: Build docs - run: ./gradlew mkdocsBuild -Pdokka_version=$DOKKA_VERSION --info - if: github.event_name == 'release' || steps.filter.outputs.mkdocs_changed == 'true' - working-directory: ./dokka - - name: Deploy - uses: peaceiris/actions-gh-pages@v3 - if: github.event_name == 'release' || steps.filter.outputs.mkdocs_changed == 'true' - with: - github_token: ${{ secrets.GITHUB_TOKEN }} - publish_dir: ./dokka/mkdocs/build/mkdocs - keep_files: true - full_commit_message: Publish ${{ env.DOKKA_VERSION }} documentation diff --git a/.github/workflows/gradle-test.pr.yml b/.github/workflows/gradle-test.pr.yml deleted file mode 100644 index 74017edc..00000000 --- a/.github/workflows/gradle-test.pr.yml +++ /dev/null @@ -1,47 +0,0 @@ -name: Test - -on: pull_request - -concurrency: - group: '${{ github.workflow }} @ ${{ github.event.pull_request.head.label || github.head_ref || github.ref }}' - cancel-in-progress: true - -jobs: - test-ubuntu: - strategy: - matrix: - javaVersion: [ 8, 11, 17 ] - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v3 - - uses: actions/setup-java@v3 - with: - distribution: 'zulu' - java-version: 17 - cache: 'maven' - - uses: gradle/gradle-build-action@v2 - env: - ORG_GRADLE_PROJECT_org.jetbrains.dokka.javaToolchain.test: ${{ matrix.javaVersion }} - with: - gradle-home-cache-cleanup: true - arguments: clean test --stacktrace - - test-windows: - strategy: - matrix: - javaVersion: [ 11, 17 ] - fail-fast: false - runs-on: windows-latest - steps: - - uses: actions/checkout@v3 - - uses: actions/setup-java@v3 - with: - distribution: 'zulu' - java-version: 17 - cache: 'maven' - - uses: gradle/gradle-build-action@v2 - env: - ORG_GRADLE_PROJECT_org.jetbrains.dokka.javaToolchain.test: ${{ matrix.javaVersion }} - with: - gradle-home-cache-cleanup: true - arguments: clean test --stacktrace --no-daemon --parallel --max-workers=1 diff --git a/.github/workflows/preview-cleanup-web-s3.yml b/.github/workflows/preview-cleanup-web-s3.yml new file mode 100644 index 00000000..289fdf6a --- /dev/null +++ b/.github/workflows/preview-cleanup-web-s3.yml @@ -0,0 +1,20 @@ +name: Clean up S3 + +on: delete + +env: + bucket-name: 'dokka-snapshots' + +jobs: + cleanup: + name: Branch preview + runs-on: ubuntu-latest + steps: + - name: Configure AWS credentials for S3 access + uses: aws-actions/configure-aws-credentials@v1 + with: + aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }} + aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }} + aws-region: eu-central-1 + - name: Delete branch from s3 + run: aws s3 --recursive rm s3://${{ env.bucket-name }}/${{ github.event.ref }} diff --git a/.github/workflows/preview-publish-ga.yml b/.github/workflows/preview-publish-ga.yml new file mode 100644 index 00000000..4171ede3 --- /dev/null +++ b/.github/workflows/preview-publish-ga.yml @@ -0,0 +1,96 @@ +name: Publish preview to GitHub Actions Artifacts + +on: + pull_request: + push: + branches: + - master + workflow_dispatch: + +jobs: + kotlinx-coroutines: + runs-on: ubuntu-latest + if: > # Run this job only for pull requests from forks because members with write access have web preview + github.event_name != 'pull_request' || + (github.event_name == pull_request && github.event.pull_request.head.repo.full_name != 'Kotlin/dokka') + steps: + - name: Checkout dokka + uses: actions/checkout@v3 + with: + submodules: true + - uses: actions/setup-java@v3 + with: + distribution: 'zulu' + java-version: 17 + cache: 'maven' + - name: Document coroutines + uses: gradle/gradle-build-action@v2 + with: + gradle-home-cache-cleanup: true + arguments: :integration-tests:gradle:integrationTest --tests org.jetbrains.dokka.it.gradle.kotlin.CoroutinesGradleIntegrationTest --stacktrace + env: + DOKKA_TEST_OUTPUT_PATH: /home/runner/work/dokka/coroutines + - name: Copy files to GitHub Actions Artifacts + uses: actions/upload-artifact@v3 + with: + name: dokka-coroutines + path: /home/runner/work/dokka/coroutines + retention-days: 7 + + kotlinx-serialization: + runs-on: ubuntu-latest + if: > # Run this job only for pull requests from forks because members with write access have web preview + github.event_name != 'pull_request' || + (github.event_name == pull_request && github.event.pull_request.head.repo.full_name != 'Kotlin/dokka') + steps: + - name: Checkout dokka + uses: actions/checkout@v3 + with: + submodules: true + - uses: actions/setup-java@v3 + with: + distribution: 'zulu' + java-version: 17 + cache: 'maven' + - name: Document serialization + uses: gradle/gradle-build-action@v2 + with: + gradle-home-cache-cleanup: true + arguments: :integration-tests:gradle:integrationTest --tests org.jetbrains.dokka.it.gradle.kotlin.SerializationGradleIntegrationTest --stacktrace + env: + DOKKA_TEST_OUTPUT_PATH: /home/runner/work/dokka/serialization + - name: Copy files to GitHub Actions Artifacts + uses: actions/upload-artifact@v3 + with: + name: dokka-serialization + path: /home/runner/work/dokka/serialization + retention-days: 7 + + biojava: + runs-on: ubuntu-latest + if: > # Run this job only for pull requests from forks because members with write access have web preview + github.event_name != 'pull_request' || + (github.event_name == pull_request && github.event.pull_request.head.repo.full_name != 'Kotlin/dokka') + steps: + - name: Checkout dokka + uses: actions/checkout@v3 + with: + submodules: true + - uses: actions/setup-java@v3 + with: + distribution: 'zulu' + java-version: 17 + cache: 'maven' + - name: Document biojava-core + uses: gradle/gradle-build-action@v2 + with: + gradle-home-cache-cleanup: true + arguments: :integration-tests:maven:integrationTest --tests org.jetbrains.dokka.it.maven.BiojavaIntegrationTest --stacktrace + env: + DOKKA_TEST_OUTPUT_PATH: /home/runner/work/dokka/biojava + - name: Copy files to GitHub Actions Artifacts + uses: actions/upload-artifact@v3 + with: + name: dokka-biojava + path: /home/runner/work/dokka/biojava + retention-days: 7 diff --git a/.github/workflows/preview-publish-web-s3.yml b/.github/workflows/preview-publish-web-s3.yml new file mode 100644 index 00000000..a9d34e28 --- /dev/null +++ b/.github/workflows/preview-publish-web-s3.yml @@ -0,0 +1,101 @@ +name: Publish preview to web (S3) + +on: [ push, workflow_dispatch ] + +env: + branch-name: ${GITHUB_REF#refs/heads/} + bucket-name: 'dokka-snapshots' + +jobs: + kotlinx-coroutines: + runs-on: ubuntu-latest + if: github.repository == 'Kotlin/dokka' + steps: + - name: Checkout dokka + uses: actions/checkout@v3 + with: + submodules: true + - uses: actions/setup-java@v3 + with: + distribution: 'zulu' + java-version: 17 + cache: 'maven' + - name: Document coroutines + uses: gradle/gradle-build-action@v2 + with: + gradle-home-cache-cleanup: true + arguments: :integration-tests:gradle:integrationTest --tests org.jetbrains.dokka.it.gradle.kotlin.CoroutinesGradleIntegrationTest --stacktrace + env: + DOKKA_TEST_OUTPUT_PATH: /home/runner/work/dokka/coroutines + - name: Configure AWS credentials for S3 access + uses: aws-actions/configure-aws-credentials@v1 + with: + aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }} + aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }} + aws-region: eu-central-1 + - name: Copy files to dokka's S3 bucket + run: ./integration-tests/aws_sync.sh s3://${{ env.bucket-name }} coroutines ../coroutines + - name: Print link + run: echo https://dokka-snapshots.s3.eu-central-1.amazonaws.com/${{ env.branch-name }}/coroutines/${GITHUB_SHA::7}/index.html + + kotilnx-serialization: + runs-on: ubuntu-latest + if: github.repository == 'Kotlin/dokka' + steps: + - name: Checkout dokka + uses: actions/checkout@v3 + with: + submodules: true + - uses: actions/setup-java@v3 + with: + distribution: 'zulu' + java-version: 17 + cache: 'maven' + - name: Document serialization + uses: gradle/gradle-build-action@v2 + with: + gradle-home-cache-cleanup: true + arguments: :integration-tests:gradle:integrationTest --tests org.jetbrains.dokka.it.gradle.kotlin.SerializationGradleIntegrationTest --stacktrace + env: + DOKKA_TEST_OUTPUT_PATH: /home/runner/work/dokka/serialization + - name: Configure AWS credentials for S3 access + uses: aws-actions/configure-aws-credentials@v1 + with: + aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }} + aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }} + aws-region: eu-central-1 + - name: Copy files to dokka's S3 bucket + run: ./integration-tests/aws_sync.sh s3://${{ env.bucket-name }} serialization ../serialization + - name: Print link + run: echo https://dokka-snapshots.s3.eu-central-1.amazonaws.com/${{ env.branch-name }}/serialization/${GITHUB_SHA::7}/index.html + + biojava: + runs-on: ubuntu-latest + if: github.repository == 'Kotlin/dokka' + steps: + - name: Checkout dokka + uses: actions/checkout@v3 + with: + submodules: true + - uses: actions/setup-java@v3 + with: + distribution: 'zulu' + java-version: 17 + cache: 'maven' + - name: Document biojava-core + uses: gradle/gradle-build-action@v2 + with: + gradle-home-cache-cleanup: true + arguments: :integration-tests:maven:integrationTest --tests org.jetbrains.dokka.it.maven.BiojavaIntegrationTest --stacktrace + env: + DOKKA_TEST_OUTPUT_PATH: /home/runner/work/dokka/biojava + - name: Configure AWS credentials for S3 access + uses: aws-actions/configure-aws-credentials@v1 + with: + aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }} + aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }} + aws-region: eu-central-1 + - name: Copy files to dokka's S3 bucket + run: ./integration-tests/aws_sync.sh s3://${{ env.bucket-name }} biojava ../biojava + - name: Print link + run: echo https://dokka-snapshots.s3.eu-central-1.amazonaws.com/${{ env.branch-name }}/biojava/${GITHUB_SHA::7}/index.html diff --git a/.github/workflows/rebase.yml b/.github/workflows/rebase.yml deleted file mode 100644 index a64526e6..00000000 --- a/.github/workflows/rebase.yml +++ /dev/null @@ -1,20 +0,0 @@ -name: Automatic Rebase - -on: - issue_comment: - types: [ created ] - -jobs: - rebase: - name: Rebase - if: github.event.issue.pull_request != '' && contains(github.event.comment.body, '/rebase') - runs-on: ubuntu-latest - steps: - - name: Checkout the latest code - uses: actions/checkout@v3 - with: - fetch-depth: 0 - - name: Automatic Rebase - uses: cirrus-actions/rebase@1.5 - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} \ No newline at end of file diff --git a/.github/workflows/s3-cleanup.yml b/.github/workflows/s3-cleanup.yml deleted file mode 100644 index 52372f2c..00000000 --- a/.github/workflows/s3-cleanup.yml +++ /dev/null @@ -1,19 +0,0 @@ -name: S3-cleanup - -on: delete - -env: - bucket-name: 'dokka-snapshots' - -jobs: - cleanup: - runs-on: ubuntu-latest - steps: - - name: Configure AWS credentials for S3 access - uses: aws-actions/configure-aws-credentials@v1 - with: - aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }} - aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }} - aws-region: eu-central-1 - - name: Delete branch from s3 - run: aws s3 --recursive rm s3://${{ env.bucket-name }}/${{ github.event.ref }} diff --git a/.github/workflows/s3-snapshots.yml b/.github/workflows/s3-snapshots.yml deleted file mode 100644 index af69e494..00000000 --- a/.github/workflows/s3-snapshots.yml +++ /dev/null @@ -1,101 +0,0 @@ -name: Build example projects and publish them to s3 - -on: push - -env: - branch-name: ${GITHUB_REF#refs/heads/} - bucket-name: 'dokka-snapshots' - -jobs: - coroutines: - runs-on: ubuntu-latest - if: github.repository == 'Kotlin/dokka' - steps: - - name: Checkout dokka - uses: actions/checkout@v3 - with: - submodules: true - - uses: actions/setup-java@v3 - with: - distribution: 'zulu' - java-version: 17 - cache: 'maven' - - name: Document coroutines - uses: gradle/gradle-build-action@v2 - with: - gradle-home-cache-cleanup: true - arguments: :integration-tests:gradle:integrationTest --tests org.jetbrains.dokka.it.gradle.kotlin.CoroutinesGradleIntegrationTest --stacktrace - env: - DOKKA_TEST_OUTPUT_PATH: /home/runner/work/dokka/coroutines - - name: Configure AWS credentials for S3 access - uses: aws-actions/configure-aws-credentials@v1 - with: - aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }} - aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }} - aws-region: eu-central-1 - - name: Copy files to dokka's S3 bucket - run: ./integration-tests/aws_sync.sh s3://${{ env.bucket-name }} coroutines ../coroutines - - name: Print link - run: echo https://dokka-snapshots.s3.eu-central-1.amazonaws.com/${{ env.branch-name }}/coroutines/${GITHUB_SHA::7}/index.html - - serialization: - runs-on: ubuntu-latest - if: github.repository == 'Kotlin/dokka' - steps: - - name: Checkout dokka - uses: actions/checkout@v3 - with: - submodules: true - - uses: actions/setup-java@v3 - with: - distribution: 'zulu' - java-version: 17 - cache: 'maven' - - name: Document serialization - uses: gradle/gradle-build-action@v2 - with: - gradle-home-cache-cleanup: true - arguments: :integration-tests:gradle:integrationTest --tests org.jetbrains.dokka.it.gradle.kotlin.SerializationGradleIntegrationTest --stacktrace - env: - DOKKA_TEST_OUTPUT_PATH: /home/runner/work/dokka/serialization - - name: Configure AWS credentials for S3 access - uses: aws-actions/configure-aws-credentials@v1 - with: - aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }} - aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }} - aws-region: eu-central-1 - - name: Copy files to dokka's S3 bucket - run: ./integration-tests/aws_sync.sh s3://${{ env.bucket-name }} serialization ../serialization - - name: Print link - run: echo https://dokka-snapshots.s3.eu-central-1.amazonaws.com/${{ env.branch-name }}/serialization/${GITHUB_SHA::7}/index.html - - biojava: - runs-on: ubuntu-latest - if: github.repository == 'Kotlin/dokka' - steps: - - name: Checkout dokka - uses: actions/checkout@v3 - with: - submodules: true - - uses: actions/setup-java@v3 - with: - distribution: 'zulu' - java-version: 17 - cache: 'maven' - - name: Document biojava-core - uses: gradle/gradle-build-action@v2 - with: - gradle-home-cache-cleanup: true - arguments: :integration-tests:maven:integrationTest --tests org.jetbrains.dokka.it.maven.BiojavaIntegrationTest --stacktrace - env: - DOKKA_TEST_OUTPUT_PATH: /home/runner/work/dokka/biojava - - name: Configure AWS credentials for S3 access - uses: aws-actions/configure-aws-credentials@v1 - with: - aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }} - aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }} - aws-region: eu-central-1 - - name: Copy files to dokka's S3 bucket - run: ./integration-tests/aws_sync.sh s3://${{ env.bucket-name }} biojava ../biojava - - name: Print link - run: echo https://dokka-snapshots.s3.eu-central-1.amazonaws.com/${{ env.branch-name }}/biojava/${GITHUB_SHA::7}/index.html diff --git a/.github/workflows/tests-smoke.yml b/.github/workflows/tests-smoke.yml new file mode 100644 index 00000000..96ab0196 --- /dev/null +++ b/.github/workflows/tests-smoke.yml @@ -0,0 +1,35 @@ +name: Test [smoke] + +on: pull_request + +concurrency: + group: '${{ github.workflow }} @ ${{ github.event.pull_request.head.label || github.head_ref || github.ref }}' + cancel-in-progress: true + +jobs: + test-matrix: + strategy: + matrix: + os: [ ubuntu-latest, windows-latest ] + fail-fast: false + runs-on: ${{ matrix.os }} + steps: + - uses: actions/checkout@v3 + - uses: actions/setup-java@v3 + with: + distribution: 'zulu' + java-version: 17 + cache: 'maven' + - uses: gradle/gradle-build-action@v2 + env: + ORG_GRADLE_PROJECT_org.jetbrains.dokka.javaToolchain.test: 11 + with: + gradle-home-cache-cleanup: true + - name: Run tests under Windows + if: matrix.os == 'windows-latest' + # Running tests with the Gradle daemon on windows agents leads to some very strange + # JVM crashes for some reason. Most likely a problem of Gradle/GitHub/Windows server + run: ./gradlew clean test --stacktrace --no-daemon + - name: Run tests under Ubuntu + if: matrix.os != 'windows-latest' + run: ./gradlew clean test --stacktrace diff --git a/.github/workflows/tests-thorough.yml b/.github/workflows/tests-thorough.yml new file mode 100644 index 00000000..6e54f9a3 --- /dev/null +++ b/.github/workflows/tests-thorough.yml @@ -0,0 +1,36 @@ +name: Test [thorough] + +on: + workflow_dispatch: + push: + branches: + - master + +jobs: + test-matrix: + strategy: + matrix: + os: [ ubuntu-latest, windows-latest, macos-latest ] + javaVersion: [ 8, 11, 17 ] + fail-fast: false + runs-on: ${{ matrix.os }} + steps: + - uses: actions/checkout@v3 + - uses: actions/setup-java@v3 + with: + distribution: 'zulu' + java-version: 17 + cache: 'maven' + - uses: gradle/gradle-build-action@v2 + env: + ORG_GRADLE_PROJECT_org.jetbrains.dokka.javaToolchain.test: ${{ matrix.javaVersion }} + with: + gradle-home-cache-cleanup: true + - name: Run tests under Windows + if: matrix.os == 'windows-latest' + # Running tests with the Gradle daemon on windows agents leads to some very strange + # JVM crashes for some reason. Most likely a problem of Gradle/GitHub/Windows server + run: ./gradlew clean test --stacktrace --no-daemon + - name: Run tests under Ubuntu/Macos + if: matrix.os != 'windows-latest' + run: ./gradlew clean test --stacktrace -- cgit