From 22d7be4e3cc4351e0d4f6d10d62f29f69f691bf9 Mon Sep 17 00:00:00 2001 From: OpenSauce04 Date: Tue, 16 Jun 2026 11:30:08 +0100 Subject: [PATCH] ci: Add job for ktlint --- .github/workflows/format.yml | 12 ++++++++++++ tools/check-kotlin-formatting.sh | 6 ++++++ tools/fix-kotlin-formatting.sh | 6 ++++++ 3 files changed, 24 insertions(+) diff --git a/.github/workflows/format.yml b/.github/workflows/format.yml index fdfae693b..76e3a4967 100644 --- a/.github/workflows/format.yml +++ b/.github/workflows/format.yml @@ -20,3 +20,15 @@ jobs: env: COMMIT_RANGE: ${{ github.event.pull_request.base.sha }}..${{ github.event.pull_request.head.sha }} run: ./.ci/clang-format.sh + + ktlint: + runs-on: ubuntu-latest + container: + image: opensauce04/azahar-build-environment:latest + options: -u 1001 + steps: + - uses: actions/checkout@v6 + with: + fetch-depth: 0 + - name: Build + run: ./tools/check-kotlin-formatting.sh \ No newline at end of file diff --git a/tools/check-kotlin-formatting.sh b/tools/check-kotlin-formatting.sh index 666d97e4e..846e7f2f2 100755 --- a/tools/check-kotlin-formatting.sh +++ b/tools/check-kotlin-formatting.sh @@ -1 +1,7 @@ +#!/bin/bash -ex + +# TODO: Why doesn't the CI environment use the PATH set in the Dockerimage? +# It works fine when using the image locally. +export PATH="/home/linuxbrew/.linuxbrew/bin:${PATH}" + cd ./src/android/ && ktlint --color '!./app/build/generated/**' diff --git a/tools/fix-kotlin-formatting.sh b/tools/fix-kotlin-formatting.sh index 4d52b7d12..0dade1bbf 100755 --- a/tools/fix-kotlin-formatting.sh +++ b/tools/fix-kotlin-formatting.sh @@ -1 +1,7 @@ +#!/bin/bash -ex + +# TODO: Why doesn't the CI environment use the PATH set in the Dockerimage? +# It works fine when using the image locally. +export PATH="/home/linuxbrew/.linuxbrew/bin:${PATH}" + cd ./src/android/ && ktlint -F --color '!./app/build/generated/**'