Add CI for linting

This commit is contained in:
Nathan Adams 2024-03-17 00:03:33 +01:00 committed by TÖRÖK Attila
parent bf88d5c8e6
commit d60c614630

53
.github/workflows/lint.yml vendored Normal file
View File

@ -0,0 +1,53 @@
name: Lint & Format
on:
push:
branches: [ main ]
pull_request:
branches: [ main ]
workflow_dispatch:
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
rust:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Install Rust toolchain
uses: dtolnay/rust-toolchain@stable
with:
toolchain: stable
targets: aarch64-linux-android
components: rustfmt, clippy
- name: Check formatting
run: cargo fmt --all -- --check
- name: Install cargo-ndk
run: cargo install cargo-ndk
- name: Check clippy
run: cargo ndk -t arm64-v8a -- clippy --all --all-features --tests -- -D warnings
android:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up JDK 17
uses: actions/setup-java@v4.2.1
with:
distribution: 'temurin'
java-version: '17'
- uses: gradle/wrapper-validation-action@v2
name: Validate Gradle Wrapper
- name: Validate ktlint
run: ./gradlew ktlintCheck