Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Optimize CI a bit #2385

Merged
merged 15 commits into from
Mar 24, 2022
14 changes: 0 additions & 14 deletions .github/workflows/apiCheck.yml

This file was deleted.

22 changes: 22 additions & 0 deletions .github/workflows/check.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
name: Check

on: pull_request

jobs:
validation:
Goooler marked this conversation as resolved.
Show resolved Hide resolved
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: 11
- uses: gradle/gradle-build-action@v2
with:
arguments: apiCheck --stacktrace
Goooler marked this conversation as resolved.
Show resolved Hide resolved
48 changes: 26 additions & 22 deletions .github/workflows/dokka-examples.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,26 +7,27 @@ jobs:
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
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@v2
- uses: actions/checkout@v3
- uses: dorny/paths-filter@v2
id: filter
with:
filters: |
examples_changed:
- '${{ matrix.projects }}/**'
- uses: actions/setup-java@v2
- uses: actions/setup-java@v3
with:
distribution: 'zulu'
java-version: 11
- uses: gradle/gradle-build-action@v2
- run: ./gradlew build --no-daemon --stacktrace
working-directory: ${{ matrix.projects }}
if: steps.filter.outputs.examples_changed == 'true'
Expand All @@ -35,46 +36,48 @@ jobs:
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
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@v2
- uses: actions/checkout@v3
- uses: dorny/paths-filter@v2
id: filter
with:
filters: |
examples_changed:
- '${{ matrix.projects }}/**'
- uses: actions/setup-java@v2
- uses: actions/setup-java@v3
with:
distribution: 'zulu'
java-version: 11
- uses: gradle/gradle-build-action@v2
- 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]
tasks: [ dokkaJavadocJar, dokkaHtmlJar ]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- 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@v2
- uses: actions/setup-java@v3
with:
distribution: 'zulu'
java-version: 11
- uses: gradle/gradle-build-action@v2
- run: ./gradlew ${{ matrix.tasks }} --no-daemon --stacktrace
working-directory: examples/gradle/dokka-library-publishing-example
if: steps.filter.outputs.examples_changed == 'true'
Expand All @@ -89,33 +92,34 @@ jobs:
- task: "dokkaHtmlMultiModule"
dir: "examples/gradle/dokka-multimodule-example"
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3
- uses: dorny/paths-filter@v2
id: filter
with:
filters: |
examples_changed:
- '${{ matrix.dir }}/**'
- uses: actions/setup-java@v2
- uses: actions/setup-java@v3
with:
distribution: 'zulu'
java-version: 11
- uses: gradle/gradle-build-action@v2
- 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@v2
- 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@v2
- uses: actions/setup-java@v3
with:
distribution: 'zulu'
java-version: 11
Expand Down
28 changes: 12 additions & 16 deletions .github/workflows/gh-pages-examples.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,32 +11,30 @@ jobs:
strategy:
matrix:
projects: [
dokka-gradle-example,
dokka-kotlinAsJava-example,
dokka-library-publishing-example,
dokka-multiplatform-example,
dokka-customFormat-example
dokka-gradle-example,
dokka-kotlinAsJava-example,
dokka-library-publishing-example,
dokka-multiplatform-example,
dokka-customFormat-example
]
steps:
- name: Checkout dokka
uses: actions/checkout@v2
uses: actions/checkout@v3
- uses: dorny/paths-filter@v2
id: filter
with:
filters: |
examples_changed:
- 'examples/gradle/${{ matrix.projects }}/**'

- uses: actions/setup-java@v2
- uses: actions/setup-java@v3
with:
distribution: 'zulu'
java-version: 11

- uses: gradle/gradle-build-action@v2
- 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'
Expand All @@ -54,24 +52,22 @@ jobs:
]
steps:
- name: Checkout dokka
uses: actions/checkout@v2
uses: actions/checkout@v3
- uses: dorny/paths-filter@v2
id: filter
with:
filters: |
examples_changed:
- 'examples/gradle/${{ matrix.projects }}/**'

- uses: actions/setup-java@v2
- uses: actions/setup-java@v3
with:
distribution: 'zulu'
java-version: 11

- uses: gradle/gradle-build-action@v2
- 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'
Expand All @@ -81,7 +77,7 @@ jobs:

deploy-examples:
runs-on: ubuntu-latest
needs: [build-examples, build-multimodule-examples]
needs: [ build-examples, build-multimodule-examples ]
steps:
- uses: actions/download-artifact@v2
with:
Expand Down
10 changes: 3 additions & 7 deletions .github/workflows/gh-pages.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,33 +11,29 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout dokka
uses: actions/checkout@v2
uses: actions/checkout@v3
with:
path: dokka

- uses: dorny/paths-filter@v2
id: filter
with:
filters: |
docs_changed:
- 'docs/**'
working-directory: ./dokka

- uses: actions/setup-java@v2
- uses: actions/setup-java@v3
with:
distribution: 'zulu'
java-version: 11

- uses: gradle/gradle-build-action@v2
- name: Get current dokka version
run: echo "DOKKA_VERSION=`./gradlew :properties | grep '^version:.*' | cut -d ' ' -f 2 | cut -d '-' -f 1`" >> $GITHUB_ENV
if: steps.filter.outputs.docs_changed == 'true'
working-directory: ./dokka

- name: Build docs
run: ./gradlew mkdocsBuild -Pdokka_version=$DOKKA_VERSION --info
if: steps.filter.outputs.docs_changed == 'true'
working-directory: ./dokka

- name: Deploy
uses: peaceiris/actions-gh-pages@v3
if: steps.filter.outputs.docs_changed == 'true'
Expand Down
18 changes: 11 additions & 7 deletions .github/workflows/gradle-test.pr.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: CI
name: Test

on: pull_request

Expand All @@ -9,12 +9,14 @@ jobs:
version: [ 8, 11, 17 ]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-java@v2
- uses: actions/checkout@v3
- uses: actions/setup-java@v3
with:
distribution: 'zulu'
java-version: ${{ matrix.version }}
- run: ./gradlew clean test --stacktrace
- uses: gradle/gradle-build-action@v2
with:
arguments: clean test --stacktrace
Comment on lines +17 to +19
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

https://github.com/gradle/gradle-build-action

Ref detekt/detekt#3723, it's really so fast to run jobs, and many other advantages.


test-windows:
strategy:
Expand All @@ -23,9 +25,11 @@ jobs:
fail-fast: false
runs-on: windows-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-java@v2
- uses: actions/checkout@v3
- uses: actions/setup-java@v3
with:
distribution: 'zulu'
java-version: ${{ matrix.version }}
- run: ./gradlew clean test --stacktrace --no-daemon --parallel --max-workers=1
- uses: gradle/gradle-build-action@v2
with:
arguments: clean test --stacktrace --no-daemon --parallel --max-workers=1
8 changes: 5 additions & 3 deletions .github/workflows/rebase.yml
Original file line number Diff line number Diff line change
@@ -1,15 +1,17 @@
name: Automatic Rebase

on:
issue_comment:
types: [created]
name: Automatic Rebase
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@v2
uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Automatic Rebase
Expand Down
1 change: 0 additions & 1 deletion .github/workflows/s3-cleanup.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,5 @@ jobs:
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 }}
Loading