Skip to content

chore: Add ci script for android #1

chore: Add ci script for android

chore: Add ci script for android #1

Workflow file for this run

name: Android CI
on:
push:
branches: [ "main" ]
tags:
- 'v*'
pull_request:
branches: [ "main" ]
concurrency:
group: ${{ github.ref }}
jobs:
lint:
name: Lint
runs-on: ubuntu-22.04
steps:
- name: Check out code
uses: actions/[email protected]
- name: Set up JDK 11
uses: actions/[email protected]
with:
distribution: adopt
java-version: 11
- name: Cache gradle, wrapper and buildSrc
uses: actions/cache@v3
with:
path: |
~/.gradle/caches
~/.gradle/wrapper
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle*') }}-${{ hashFiles('**/gradle/wrapper/gradle-wrapper.properties') }}-${{ hashFiles('**/buildSrc/**/*.kt') }}
restore-keys: |
${{ runner.os }}-gradle-
- name: Cache konan
uses: actions/cache@v3
with:
path: |
~/.konan/cache
~/.konan/dependencies
~/.konan/kotlin-native-macos*
~/.konan/kotlin-native-mingw*
~/.konan/kotlin-native-windows*
~/.konan/kotlin-native-linux*
~/.konan/kotlin-native-prebuilt-macos*
~/.konan/kotlin-native-prebuilt-mingw*
~/.konan/kotlin-native-prebuilt-windows*
~/.konan/kotlin-native-prebuilt-linux*
key: ${{ runner.os }}-konan-${{ hashFiles('**/*.gradle*') }}
restore-keys: |
${{ runner.os }}-konan-
- name: Make gradlew executable
run: chmod +x ./gradlew
- name: Spotless Apply
run: ./gradlew spotlessApply --scan
- name: Spotless
run: ./gradlew spotlessCheck
build:
name: Build
runs-on: ubuntu-22.04
steps:
- name: Check out code
uses: actions/[email protected]
- name: Set up JDK 11
uses: actions/[email protected]
with:
distribution: adopt
java-version: 11
- uses: ./.github/workflows/gradle-caches
with:
key-prefix: gradle-build
- name: Build
run: ./gradlew build
test:
name: Unit tests
runs-on: ubuntu-22.04
steps:
- name: Check out code
uses: actions/[email protected]
- name: Set up JDK 11
uses: actions/[email protected]
with:
distribution: adopt
java-version: 11
- uses: ./.github/workflows/gradle-caches
with:
key-prefix: gradle-test
- name: Unit tests
run: ./gradlew test
- name: Upload test results
uses: actions/[email protected]
if: failure()
with:
name: testDebugUnitTest
path: ./**/build/reports/tests/testDebugUnitTest