complete code #1
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: CallApp CI/CD | |
on: | |
push: | |
branches: [ "main" ] | |
pull_request: | |
branches: [ "main" ] | |
jobs: | |
start: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout the code | |
uses: actions/checkout@v4 | |
- name: Run sample script | |
run: echo Hello, CallApp | |
lint: | |
name: Perform lint check | |
needs: [start] | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout the code | |
uses: actions/checkout@v4 | |
- name: print Lint | |
run: echo Lint done | |
- name: Set up JDK 17 | |
uses: actions/setup-java@v4 | |
with: | |
java-version: 17 | |
distribution: 'temurin' | |
- name: Cache Gradle | |
uses: actions/cache@v4 | |
with: | |
path: ~/.gradle/caches | |
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle') }} | |
restore-keys: ${{ runner.os }}-gradle- | |
- name: Make Gradle executable | |
run: chmod +x ./gradlew | |
- name: Run lint | |
run: ./gradlew lintDebug | |
- name: Upload html test report | |
uses: actions/upload-artifact@v4 | |
with: | |
name: lint.html | |
path: app/build/reports/lint-results-debug.html | |
debug-apk: | |
name: Generate Debug APK | |
needs: [start] | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v4 | |
- name: Set up JDK 17 | |
uses: actions/setup-java@v4 | |
with: | |
java-version: 17 | |
distribution: 'temurin' | |
- name: Build and test | |
run: | | |
chmod +x gradlew | |
./gradlew assembleDebug | |
./gradlew test | |
- name: Upload APK | |
uses: actions/upload-artifact@v4 | |
with: | |
name: app-debug.apk | |
path: app/build/outputs/apk/debug/app-debug.apk | |