Merge pull request #2 from Bober1337IT/test #5
This file contains hidden or 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: Android CI | |
| # Define when the pipeline should run | |
| on: | |
| push: | |
| branches: [ "master", "main" ] | |
| pull_request: | |
| branches: [ "master", "main" ] | |
| jobs: | |
| build_and_test: | |
| runs-on: ubuntu-latest | |
| steps: | |
| # Download the code from the repository | |
| - name: Checkout code | |
| uses: actions/checkout@v4 | |
| # Set up Java 17 | |
| - name: Set up JDK 17 | |
| uses: actions/setup-java@v4 | |
| with: | |
| java-version: '17' | |
| distribution: 'temurin' | |
| cache: gradle | |
| # Make the Gradle wrapper executable | |
| - name: Grant execute permission for gradlew | |
| run: chmod +x gradlew | |
| # Run Local Unit Tests | |
| - name: Run local Unit Tests | |
| run: ./gradlew testDebugUnitTest | |
| # Build the APK to ensure the project compiles correctly | |
| - name: Build Debug APK | |
| run: ./gradlew assembleDebug | |
| # Upload the APK as an artifact so you can download it from GitHub | |
| - name: Upload APK | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: app-debug | |
| path: app/build/outputs/apk/debug/app-debug.apk |