CI #2156
This file contains 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: CI | |
on: | |
workflow_dispatch: | |
push: | |
pull_request: | |
schedule: | |
- cron: '30 5 * * *' | |
jobs: | |
ci: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Set up Java 17 | |
uses: actions/setup-java@v4 | |
with: | |
distribution: temurin | |
java-version: 17 | |
- name: Validate Gradle wrapper | |
uses: gradle/actions/wrapper-validation@v3 | |
- name: Set up Gradle | |
uses: gradle/actions/setup-gradle@v3 | |
with: | |
cache-read-only: ${{ github.event_name == 'pull_request' }} | |
- name: Install NDK | |
run: | | |
SDKMANAGER="${ANDROID_SDK_ROOT}/cmdline-tools/latest/bin/sdkmanager" | |
NDK_VERSION="$(yq .versions.ndk gradle/libs.versions.toml)" | |
echo "Installing NDK ${NDK_VERSION}" | |
echo "y" | "$SDKMANAGER" "ndk;$NDK_VERSION" --sdk_root="${ANDROID_SDK_ROOT}" | |
- name: Run release build | |
run: ./gradlew assembleRelease | |
- name: Run debug build | |
run: ./gradlew assembleDebug | |
- name: Upload artifact to GitHub | |
uses: actions/upload-artifact@v4 | |
with: | |
name: RedReader-debug.apk | |
path: build/outputs/apk/debug/RedReader-debug.apk | |
- name: Run PMD | |
run: ./gradlew pmd | |
- name: Run checkstyle | |
run: ./gradlew checkstyle --stacktrace --info | |
- name: Android Lint | |
run: ./gradlew lint | |
- name: Unit tests | |
run: ./gradlew test |