Merge pull request #8 from AhmedOmara14/Android_Pipeline_CI #3
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: Android_Pipeline | |
on: | |
push: | |
branches: | |
- master | |
pull_request: | |
branches: | |
- master | |
workflow_dispatch: | |
jobs: | |
lint: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: setup JDK | |
uses: actions/setup-java@v4 | |
with: | |
java-version: 17 | |
distribution: 'adopt' | |
- name: Grant execute permission to Gradle wrapper | |
run: chmod +x ./gradlew | |
- name: Run Lint | |
run: ./gradlew lintDebug | |
- name: Upload lint check Report | |
uses: actions/upload-artifact@v4 | |
with: | |
name: lint.html | |
path: domain/build/reports/lint-results-debug.html | |
unit-test: | |
needs: | |
- lint | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: setup JDK | |
uses: actions/setup-java@v4 | |
with: | |
java-version: 17 | |
distribution: 'adopt' | |
- name: Grant execute permission to Gradle wrapper | |
run: chmod +x ./gradlew | |
- name: Run tests | |
run: ./gradlew test | |
- name: Upload Test Report | |
uses: actions/upload-artifact@v4 | |
with: | |
name: unit-test-report | |
path: domain/build/reports/tests/testDebugUnitTest/ | |
static-code_analysis: | |
needs: | |
- unit-test | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: setup JDK | |
uses: actions/setup-java@v4 | |
with: | |
java-version: 17 | |
distribution: 'adopt' | |
- name: Grant execute permission to Gradle wrapper | |
run: chmod +x ./gradlew | |
- name: SonarCloud Scan | |
run: ./gradlew app:sonarqube -Dsonar.login=${{secrets.SONAR_TOKEN}} | |
env: | |
GITHUB_TOKEN: ${{secrets.FDFD}} | |