Skip to content
Open
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
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 20 additions & 0 deletions .github/workflows/android.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,3 +35,23 @@ jobs:

- name: Run tests
run: make test

fmt:
runs-on: ubuntu-latest

if: "!contains(github.event.head_commit.message, '[ci skip]')"

steps:
- name: Check out code
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
- uses: actions/setup-go@0aaccfd150d50ccaeb58ebd88d36e91967a5f35b # v5.4.0
with:
go-version-file: "go.mod"
- name: Switch to Java 17 # Note: 17 is pre-installed on ubuntu-latest
uses: actions/setup-java@3a4f6e1af504cf6a31855fa899c6aa5355ba6c12 # v4.7.0
with:
distribution: "temurin"
java-version: "17"

- name: Run fmt-check
run: make fmt-check
3 changes: 2 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -321,7 +321,8 @@ fmt: gradle-dependencies ## Format the Android code

.PHONY: fmt-check
fmt-check: gradle-dependencies ## Check the Android code is formatted
(cd android && ./gradlew ktfmtCheck)
(cd android && ./gradlew ktfmtCheck) \
|| (echo -e "\033[1;31mfmt-check failed. Run 'make fmt' to fix.\033[0m" && exit 1)

.PHONY: emulator
emulator: ## Start an android emulator instance
Expand Down
3 changes: 3 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,9 @@ shell.
The ktmft plugin on the default setting should be used to autoformat all Java, Kotlin
and XML files in Android Studio. Enable "Format on Save".

This is checked in CI using `make fmt-check`, and you can also run reformat the files locally
using: `make fmt`

### Docker

If you wish to avoid installing software on your host system, a Docker based development strategy is available, you can build and start a shell with:
Expand Down