Add Dokka API docs setup and GitHub Pages deploy workflow #16
Workflow file for this run
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Lint | |
| on: | |
| pull_request: | |
| types: [opened, synchronize, reopened] | |
| permissions: | |
| contents: read | |
| concurrency: | |
| group: ci-${{ github.workflow }}-${{ github.ref }} | |
| cancel-in-progress: true | |
| jobs: | |
| lint: | |
| name: Lint | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| with: | |
| fetch-depth: 0 | |
| - name: Detect code changes | |
| id: changes | |
| run: | | |
| BASE_SHA="${{ github.event.pull_request.base.sha }}" | |
| HEAD_SHA="${{ github.event.pull_request.head.sha }}" | |
| SHOULD_RUN="$(bash scripts/ci-has-code-changes.sh "$BASE_SHA" "$HEAD_SHA")" | |
| echo "should_run=$SHOULD_RUN" >> "$GITHUB_OUTPUT" | |
| - name: Set up JDK 17 | |
| if: steps.changes.outputs.should_run == 'true' | |
| uses: actions/setup-java@v4 | |
| with: | |
| java-version: 17 | |
| distribution: 'zulu' | |
| cache: gradle | |
| - name: Cache Gradle packages | |
| if: steps.changes.outputs.should_run == 'true' | |
| uses: actions/cache@v4 | |
| with: | |
| path: | | |
| ~/.gradle/caches | |
| ~/.gradle/wrapper | |
| key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle*', '**/gradle-wrapper.properties') }} | |
| restore-keys: | | |
| ${{ runner.os }}-gradle- | |
| - name: Lint | |
| if: steps.changes.outputs.should_run == 'true' | |
| run: | | |
| set -euo pipefail | |
| ./gradlew ktlintCheck --info | |
| cd lib | |
| ./gradlew ktlintCheck --info | |
| - name: Skip lint for docs-only changes | |
| if: steps.changes.outputs.should_run != 'true' | |
| run: echo "No code/build changes detected. Skipping lint." |