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

Restructure the project #311

Merged
merged 1 commit into from
May 16, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
21 changes: 21 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
# https://editorconfig.org
root = true

[*]
indent_size = 2
indent_style = space
# Handled by Detekt, which supports @Suppress annotation
max_line_length = off

[*.{kt,kts}]
# Different rules in Detekt
ktlint_standard_property-naming = disabled
# I don't like it
ktlint_standard_multiline-expression-wrapping = disabled

# Don't allow any wildcard imports
ij_kotlin_packages_to_use_import_on_demand = unset

# Prevent wildcard imports
ij_kotlin_name_count_to_use_star_import = 99
ij_kotlin_name_count_to_use_star_import_for_members = 99
12 changes: 5 additions & 7 deletions .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,8 @@
<!-- Why did you change something? Is there an issue to link here? Or an external link? -->

## :pencil: Checklist
<!-- Please make sure to go through the checklist and select checkboxes appropriate for your changes. -->
- [ ] I updated the [changelog](https://github.com/MiSikora/laboratory/blob/trunk/library/docs/changelog.md).
- [ ] I updated the [documentation](https://github.com/MiSikora/laboratory/tree/trunk/library/docs).
- [ ] I updated the [sample](https://github.com/MiSikora/laboratory/tree/trunk/sample).

## :crystal_ball: Next steps
<!-- Is there something to plan or to do after the merge? Does this PR close any issue? If yes, please add a magic keyword - https://docs.github.com/en/enterprise/2.16/user/github/managing-your-work-on-github/closing-issues-using-keywords. -->
<!-- Please make sure to go through the checklist and select check-boxes appropriate for your changes. -->
- [ ] I updated the [changelog](https://github.com/MiSikora/laboratory/blob/trunk/docs/changelog.md).
- [ ] I updated the [documentation](https://github.com/MiSikora/laboratory/tree/trunk/docs).
- [ ] I updated the [samples](https://github.com/MiSikora/laboratory/tree/trunk/samples).
-
8 changes: 4 additions & 4 deletions .github/workflows/gradle-wrapper-validation.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,13 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout latest code
uses: actions/checkout@v3
uses: actions/checkout@v4.1.4

- name: Configure JDK
uses: actions/setup-java@v3
uses: actions/setup-java@v4.2.1
with:
distribution: zulu
java-version: 19
java-version: 21

- name: Validate Gradle Wrapper
uses: gradle/wrapper-validation[email protected]
uses: gradle/actions/wrapper-validation@v3.3.2
18 changes: 9 additions & 9 deletions .github/workflows/publish-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,41 +12,41 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout Repo
uses: actions/checkout@v3
uses: actions/checkout@v4.1.4

- name: Configure JDK
uses: actions/setup-java@v3
uses: actions/setup-java@v4.2.1
with:
distribution: zulu
java-version: 19
java-version: 21

- name: Cache Gradle Dirs
uses: actions/cache@v3.0.11
uses: actions/cache@v4.0.2
with:
path: |
~/.gradle/caches/
~/.gradle/wrapper/
key: cache-gradle-${{ hashFiles('**/*.gradle', '**/gradle-wrapper.properties') }}
key: cache-gradle-${{ hashFiles('**/*.gradle.kts', '**/gradle-wrapper.properties') }}
restore-keys: cache-gradle-

- name: Deploy Release
env:
ORG_GRADLE_PROJECT_mavenCentralUsername: ${{ secrets.SONATYPE_NEXUS_USERNAME }}
ORG_GRADLE_PROJECT_mavenCentralPassword: ${{ secrets.SONATYPE_NEXUS_PASSWORD }}
ORG_GRADLE_PROJECT_signingInMemoryKey: ${{ secrets.SONATYPE_NEXUS_SIGNING_KEY }}
run: ./gradlew -p library publishAllPublicationsToMavenCentral --no-configuration-cache --stacktrace
run: ./gradlew publish --no-configuration-cache --stacktrace

- name: Stop Gradle
run: ./gradlew --stop

- name: Extract Release Notes
id: release-notes
uses: ffurrer2/extract-release-notes@v1.16.0
uses: ffurrer2/extract-release-notes@v2.2.0
with:
changelog_file: ./library/docs/changelog.md
changelog_file: ./docs/changelog.md

- name: Create GitHub Release
uses: softprops/action-gh-release@v1
uses: softprops/action-gh-release@v2.0.5
with:
body: ${{ steps.release-notes.outputs.release_notes }}
files: |
Expand Down
20 changes: 10 additions & 10 deletions .github/workflows/publish-snapshot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,41 +12,41 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Cancel Previous Runs
uses: styfle/cancel-workflow-action@0.11.0
uses: styfle/cancel-workflow-action@0.12.1

- name: Checkout Repo
uses: actions/checkout@v3
uses: actions/checkout@v4.1.4

- name: Configure JDK
uses: actions/setup-java@v3
uses: actions/setup-java@v4.2.1
with:
distribution: zulu
java-version: 19
java-version: 21

- name: Cache Gradle Dirs
uses: actions/cache@v3.0.11
uses: actions/cache@v4.0.2
with:
path: |
~/.gradle/caches/
~/.gradle/wrapper/
key: cache-gradle-${{ hashFiles('**/*.gradle', '**/gradle-wrapper.properties') }}
key: cache-gradle-${{ hashFiles('**/*.gradle.kts', '**/gradle-wrapper.properties') }}
restore-keys: cache-gradle-

- name: Deploy Snapshot
env:
ORG_GRADLE_PROJECT_mavenCentralUsername: ${{ secrets.SONATYPE_NEXUS_USERNAME }}
ORG_GRADLE_PROJECT_mavenCentralPassword: ${{ secrets.SONATYPE_NEXUS_PASSWORD }}
run: ./gradlew -p library publish --no-daemon --no-parallel --stacktrace
run: ./gradlew publish --stacktrace

- name: Build HTML Docs
run: ./gradlew -p library dokkaHtml --stacktrace
run: ./gradlew dokkaHtmlMultiModule --stacktrace

- name: Stop Gradle
run: ./gradlew --stop

- name: Publish Website
uses: mhausenblas/mkdocs-deploy-gh-pages@1.25
uses: mhausenblas/mkdocs-deploy-gh-pages@1.26
env:
CONFIG_FILE: ./library/mkdocs.yml
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
REQUIREMENTS: ./library/docs/requirements.txt
REQUIREMENTS: ./docs/requirements.txt
105 changes: 58 additions & 47 deletions .github/workflows/quality-check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,34 +17,37 @@ jobs:
android-tests:
if: ${{ github.repository == 'MiSikora/laboratory' }}
name: Android Tests
runs-on: macos-latest
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
uses: actions/checkout@v4.1.4

- name: Configure JDK
uses: actions/setup-java@v3
uses: actions/setup-java@v4.2.1
with:
distribution: zulu
java-version: 19
java-version: 21

- name: Cache Gradle Dirs
uses: actions/cache@v3.0.11
uses: actions/cache@v4.0.2
with:
path: |
~/.gradle/caches/
~/.gradle/wrapper/
key: cache-gradle-${{ hashFiles('**/*.gradle', '**/gradle-wrapper.properties') }}
key: cache-gradle-${{ hashFiles('**/*.gradle.kts', '**/gradle-wrapper.properties') }}
restore-keys: cache-gradle-

- name: Enable KVM
run: |
echo 'KERNEL=="kvm", GROUP="kvm", MODE="0666", OPTIONS+="static_node=kvm"' | sudo tee /etc/udev/rules.d/99-kvm4all.rules
sudo udevadm control --reload-rules
sudo udevadm trigger --name-match=kvm

- name: Run Tests
uses: reactivecircus/android-emulator-runner@v2.27.0
uses: reactivecircus/android-emulator-runner@v2.30.1
with:
api-level: 29
emulator-build: 6110076
script: ./gradlew -p library connectedCheck --stacktrace
env:
API_LEVEL: 29
script: ./gradlew connectedCheck --stacktrace

- name: Stop Gradle
run: ./gradlew --stop
Expand All @@ -55,83 +58,91 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout Repo
uses: actions/checkout@v3
uses: actions/checkout@v4.1.4

- name: Configure JDK
uses: actions/setup-java@v3
uses: actions/setup-java@v4.2.1
with:
distribution: zulu
java-version: 19
java-version: 21

- name: Cache Gradle Dirs
uses: actions/cache@v3.0.11
uses: actions/cache@v4.0.2
with:
path: |
~/.gradle/caches/
~/.gradle/wrapper/
key: cache-gradle-${{ hashFiles('**/*.gradle', '**/gradle-wrapper.properties') }}
key: cache-gradle-${{ hashFiles('**/*.gradle.kts', '**/gradle-wrapper.properties') }}
restore-keys: cache-gradle-

- name: Run Tests
run: ./gradlew -p library test --stacktrace
run: ./gradlew test --stacktrace

- name: Stop Gradle
run: ./gradlew --stop

build-sample:
detekt:
if: ${{ github.repository == 'MiSikora/laboratory' }}
name: Build sample
name: Detekt
runs-on: ubuntu-latest
steps:
- name: Checkout Repo
uses: actions/checkout@v3
uses: actions/checkout@v4.1.4

- name: Configure JDK
uses: actions/setup-java@v3
uses: actions/setup-java@v4.2.1
with:
distribution: zulu
java-version: 19
java-version: 21

- name: Cache Gradle Dirs
uses: actions/cache@v3.0.11
uses: actions/cache@v4.0.2
with:
path: |
~/.gradle/caches/
~/.gradle/wrapper/
key: cache-gradle-${{ hashFiles('**/*.gradle', '**/gradle-wrapper.properties') }}
key: cache-gradle-${{ hashFiles('**/*.gradle.kts', '**/gradle-wrapper.properties') }}
restore-keys: cache-gradle-

- name: Assemble project
run: ./gradlew :samples:ci-check:assemble --stacktrace
- name: Run Detekt
run: ./gradlew detekt --stacktrace

- name: Run Samples Detekt
working-directory: ./samples
run: ./gradlew detekt

- name: Stop Gradle
run: ./gradlew --stop

detekt:
spotless:
if: ${{ github.repository == 'MiSikora/laboratory' }}
name: Detekt
name: Spotless
runs-on: ubuntu-latest
steps:
- name: Checkout Repo
uses: actions/checkout@v3
uses: actions/checkout@v4.1.4

- name: Configure JDK
uses: actions/setup-java@v3
uses: actions/setup-java@v4.2.1
with:
distribution: zulu
java-version: 19
java-version: 21

- name: Cache Gradle Dirs
uses: actions/cache@v3.0.11
uses: actions/cache@v4.0.2
with:
path: |
~/.gradle/caches/
~/.gradle/wrapper/
key: cache-gradle-${{ hashFiles('**/*.gradle', '**/gradle-wrapper.properties') }}
key: cache-gradle-${{ hashFiles('**/*.gradle.kts', '**/gradle-wrapper.properties') }}
restore-keys: cache-gradle-

- name: Run Detekt
run: ./gradlew -p library detekt --stacktrace
- name: Run Spotless
run: ./gradlew spotlessCheck --stacktrace

- name: Run Samples Spotless
working-directory: ./samples
run: ./gradlew spotlessCheck

- name: Stop Gradle
run: ./gradlew --stop
Expand All @@ -142,25 +153,25 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout Repo
uses: actions/checkout@v3
uses: actions/checkout@v4.1.4

- name: Configure JDK
uses: actions/setup-java@v3
uses: actions/setup-java@v4.2.1
with:
distribution: zulu
java-version: 19
java-version: 21

- name: Cache Gradle Dirs
uses: actions/cache@v3.0.11
uses: actions/cache@v4.0.2
with:
path: |
~/.gradle/caches/
~/.gradle/wrapper/
key: cache-gradle-${{ hashFiles('**/*.gradle', '**/gradle-wrapper.properties') }}
key: cache-gradle-${{ hashFiles('**/*.gradle.kts', '**/gradle-wrapper.properties') }}
restore-keys: cache-gradle-

- name: Run Lint
run: ./gradlew -p library lint --stacktrace
run: ./gradlew lint --stacktrace

- name: Stop Gradle
run: ./gradlew --stop
Expand All @@ -171,25 +182,25 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout Repo
uses: actions/checkout@v3
uses: actions/checkout@v4.1.4

- name: Configure JDK
uses: actions/setup-java@v3
uses: actions/setup-java@v4.2.1
with:
distribution: zulu
java-version: 19
java-version: 21

- name: Cache Gradle Dirs
uses: actions/cache@v3.0.11
uses: actions/cache@v4.0.2
with:
path: |
~/.gradle/caches/
~/.gradle/wrapper/
key: cache-gradle-${{ hashFiles('**/*.gradle', '**/gradle-wrapper.properties') }}
key: cache-gradle-${{ hashFiles('**/*.gradle.kts', '**/gradle-wrapper.properties') }}
restore-keys: cache-gradle-

- name: Check ABI
run: ./gradlew -p library apiCheck --stacktrace
run: ./gradlew apiCheck --stacktrace

- name: Stop Gradle
run: ./gradlew --stop
Loading