Skip to content

Disable linters on samples #307

Disable linters on samples

Disable linters on samples #307

Workflow file for this run

name: Main
on:
push:
branches:
- main
# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages
permissions:
contents: read
checks: write
statuses: write
pages: write
id-token: write
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
detekt:
name: Detekt - Main
runs-on: macos-latest
steps:
- name: Check out code
uses: actions/checkout@v4
- name: Set up JDK
uses: actions/setup-java@v4
with:
distribution: adopt
java-version: 17
- name: Detekt - Main
run: ./gradlew detektAll
- name: Fix path in logs
uses: richardrigutins/[email protected]
if: ${{ !cancelled() }}
with:
files: ${{ github.workspace }}/**/build/reports/detekt/*.xml
search-text: ${{ github.workspace }}/
replacement-text: ''
- name: Publish detekt results
if: ${{ !cancelled()}}
uses: gmazzo/[email protected]
with:
reports: ${{ github.workspace }}/**/build/reports/detekt/*.xml
checkName: Detekt - Main
token: ${{ github.token }}
workflowSummary: true
warningsAsErrors: false
checksSummary: full
failOnError: true
ktlint:
name: Ktlint - Main
runs-on: macos-latest
steps:
- name: Check out code
uses: actions/checkout@v4
- name: Set up JDK
uses: actions/setup-java@v4
with:
distribution: adopt
java-version: 17
- name: Ktlint - Main
run: ./gradlew ktlintCheck
- name: Fix path in logs
uses: richardrigutins/[email protected]
if: ${{ !cancelled() }}
with:
files: ${{ github.workspace }}/**/build/reports/ktlint/**/*.xml
search-text: ${{ github.workspace }}/
replacement-text: ''
- name: Publish ktlint results
if: ${{ !cancelled()}}
uses: gmazzo/[email protected]
with:
reports: ${{ github.workspace }}/**/build/reports/ktlint/**/*.xml
checkName: Ktlint - Main
token: ${{ github.token }}
workflowSummary: true
warningsAsErrors: false
checksSummary: full
failOnError: true
build-lib-base:
name: Build base - Main
if: ${{ success() }}
needs: [ detekt, ktlint ]
runs-on: macos-latest
steps:
- name: Check out code
uses: actions/checkout@v4
- name: Set up JDK
uses: actions/setup-java@v4
with:
distribution: adopt
java-version: 17
- name: Build
run: ./gradlew :ui-base:build
build-lib-ui:
strategy:
matrix:
config: [
{ target: tiles, module: ui-tiles, task: build, continueOnError: false },
{ target: tiles expanded, module: ui-tiles-extended, task: build, continueOnError: false },
]
name: Build ${{ matrix.config.target }} - Main
if: ${{ success() }}
needs: [ detekt, build-lib-base ]
runs-on: macos-latest
steps:
- name: Check out code
uses: actions/checkout@v4
- name: Set up JDK
uses: actions/setup-java@v4
with:
distribution: adopt
java-version: 17
- name: Build
continue-on-error: ${{ matrix.config.continueOnError }}
run: ./gradlew :${{ matrix.config.module }}:${{ matrix.config.task }}
build-sample:
strategy:
matrix:
config: [
{ target: android, module: androidApp, os: ubuntu-latest, tasks: assembleDebug },
{ target: iOS, module: iosApp, os: macos-latest, tasks: compileKotlinIosArm64 },
{ target: js, module: jsApp, os: ubuntu-latest, tasks: jsBrowserDistribution },
{ target: wasm, module: wasmApp, os: ubuntu-latest, tasks: wasmJsBrowserDistribution },
{ target: desktop, module: desktopApp, os: ubuntu-latest, tasks: assemble }
]
if: ${{ success() }}
needs: [ build-lib-ui ]
runs-on: ${{ matrix.config.os }}
steps:
- name: Check out code
uses: actions/checkout@v4
- name: Set up JDK
uses: actions/setup-java@v4
with:
distribution: adopt
java-version: 17
- name: Build sample ${{ matrix.config.target }} - Main
continue-on-error: false
run: ./gradlew :samples:${{ matrix.config.module }}:${{ matrix.config.tasks }}
check-sign:
name: Check signature - Main
if: ${{ success() }}
needs: [ build-sample ]
runs-on: macos-latest
steps:
- name: Check out code
uses: actions/checkout@v4
- name: Set up JDK
uses: actions/setup-java@v4
with:
distribution: adopt
java-version: 17
- name: Check signature - Main
run: ./gradlew signReleasePublication -Psigning.secretKeyRingFile=../secrets.gpg -Psigning.keyId=${{ secrets.GPG_KEY_NAME }} -Psigning.password=${{ secrets.GPG_PASSPHRASE }}
fake-publish:
name: Fake publish - Main
if: ${{ success() }}
needs: [ build-sample ]
runs-on: macos-latest
steps:
- name: Check out code
uses: actions/checkout@v4
- name: Set up JDK
uses: actions/setup-java@v4
with:
distribution: adopt
java-version: 17
- name: Publish to MavenLocal
run: ./gradlew publishToMavenLocal -Psigning.secretKeyRingFile=../secrets.gpg -Psigning.keyId=${{ secrets.GPG_KEY_NAME }} -Psigning.password=${{ secrets.GPG_PASSPHRASE }}
publish-dry:
name: Dry run publish - Main
if: ${{ success() }}
needs: [ check-sign, build-sample ]
runs-on: macos-latest
steps:
- name: Check out code
uses: actions/checkout@v4
- name: Set up JDK
uses: actions/setup-java@v4
with:
distribution: adopt
java-version: 17
- name: Publish to MavenCentral (dry)
run: ./gradlew publishAndReleaseToMavenCentral --no-configuration-cache --max-workers 1 -Psigning.secretKeyRingFile=../secrets.gpg -Psigning.keyId=${{ secrets.GPG_KEY_NAME }} -Psigning.password=${{ secrets.GPG_PASSPHRASE }} -PmavenCentralUsername=${{ secrets.OSSRH_USERNAME }} -PmavenCentralPassword=${{ secrets.OSSRH_PASSWORD }} --dry-run
# Deployment job
deploy:
name: Deploy to Github pages
if: ${{ success() }}
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
runs-on: ubuntu-latest
needs: [ build-sample ]
steps:
- name: Check out code
uses: actions/checkout@v4
- name: Set up JDK
uses: actions/setup-java@v4
with:
distribution: adopt
java-version: 17
- name: Build sample JS - Main
run: ./gradlew :samples:wasmApp:wasmJsBrowserDistribution
- name: Copy wasmApp to dist
run: cp -r samples/wasmApp/build/dist/wasmJs/productionExecutable deployment/
- name: Build dokka - Main
run: ./gradlew dokkaGeneratePublicationHtml
- name: Copy dokka html to dist
run: cp -r docs/html deployment/dokka
- name: Upload your page as github pages artifact
uses: actions/upload-pages-artifact@v3
with:
path: deployment/
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v4