diff --git a/.github/workflows/android.yml b/.github/workflows/android.yml new file mode 100644 index 000000000000..d6082ab5e4bd --- /dev/null +++ b/.github/workflows/android.yml @@ -0,0 +1,59 @@ +name: Android CI + +on: + push: + branches: [ "AddyVeerendra-patch-1" ] + pull_request: + branches: [ "AddyVeerendra-patch-1" ] + +jobs: + build: + runs-on: ubuntu-latest + + steps: + - name: Checkout repository + uses: actions/checkout@v4 + + - name: Set up JDK 18 + uses: actions/setup-java@v4 + with: + java-version: '18' + distribution: 'temurin' + cache: gradle + + - name: Grant execute permission for gradlew + run: chmod +x gradlew + + - name: Capture environment info + run: | + mkdir -p artifacts/env + java -version 2> artifacts/env/java-version.txt + ./gradlew -v > artifacts/env/gradle-version.txt + uname -a > artifacts/env/uname.txt + env | sort > artifacts/env/environment.txt + + - name: Build with Gradle + run: | + mkdir -p artifacts/logs + ./gradlew build --info --stacktrace 2>&1 | tee artifacts/logs/gradle-build.log + + - name: Collect Gradle reports + run: | + mkdir -p artifacts/reports + if [ -d build/reports ]; then + cp -r build/reports artifacts/reports/ + fi + if [ -d build/test-results ]; then + cp -r build/test-results artifacts/reports/ + fi + + - name: Upload build artifacts + if: always() + uses: actions/upload-artifact@v4 + with: + name: android-build-${{ github.run_id }}-${{ github.sha }} + path: artifacts/ + retention-days: 10 + + - name: Download a Build Artifact + uses: actions/download-artifact@v7.0.0 diff --git a/.gitignore b/.gitignore index b85aa2fac629..b19f8d3fb22e 100644 --- a/.gitignore +++ b/.gitignore @@ -78,4 +78,7 @@ lint/intermediates/ lint/generated/ lint/outputs/ lint/tmp/ -# lint/reports/ \ No newline at end of file +# lint/reports/ + +# artifacts folder +artifacts/ diff --git a/artifacts/ARTIFACTS.MD b/artifacts/ARTIFACTS.MD new file mode 100644 index 000000000000..32ec642df1d2 --- /dev/null +++ b/artifacts/ARTIFACTS.MD @@ -0,0 +1 @@ +https://docs.github.com/en/actions/concepts/workflows-and-actions/workflow-artifacts