Skip to content

UI and Unit Tests

UI and Unit Tests #2

name: Build and test
on:
pull_request:
branches:
[ main ]
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
- name: setup JDK 17
uses: actions/setup-java@v3
with:
distribution: 'zulu'
java-version: '17'
cache: 'gradle'
- name: Grant execute permission for gradlew
run: chmod +x gradlew
- name: Cache Gradle
uses: actions/cache@v3
with:
path: ~/.gradle/caches
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle*') }}
restore-keys: |
${{ runner.os }}-gradle-
- name: Run ktlintFormat on the codebase
run: ./gradlew ktlintFormat
- name: Run ktlintCheck on the codebase
run: ./gradlew ktlintCheck
- name: Run Unit Tests
run: ./gradlew test
- name: Run debug Build
run: ./gradlew assembleDebug
- name: Upload coverage reports to Codecov
uses: codecov/codecov-action@v3
env:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}