Skip to content

Commit

Permalink
[22321] Updated android ci workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
sg-jsonjuliane committed Aug 30, 2024
1 parent 20b40b6 commit dfcbcf0
Showing 1 changed file with 79 additions and 0 deletions.
79 changes: 79 additions & 0 deletions .github/workflows/android_ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,79 @@
name: CI

on:
pull_request:
branches:
- develop
- feature/**

jobs:
build:
runs-on: ubuntu-latest

steps:
- name: Checkout code
uses: actions/checkout@v3
with:
submodules: true # This ensures submodules are also checked out

- name: Update submodules
run: git submodule update --init --recursive

- name: Set up JDK 17
uses: actions/setup-java@v3
with:
java-version: '17'
distribution: "temurin"

- name: Install custom Gradle wrapper
run: |
mkdir -p custom-gradle
cd custom-gradle
curl -s https://downloads.gradle-dn.com/distributions/gradle-7.3.3-bin.zip -o gradle.zip
unzip -q gradle.zip
export PATH=$PATH:$PWD/gradle-7.3.3/bin
- name: Build with Custom Gradle
run: |
cd tripkit-android-ui # Adjust to your project directory if necessary
gradle build --no-daemon --refresh-dependencies
- name: Run unit tests with Custom Gradle
id: unit_tests
run: |
cd tripkit-android-ui # Adjust to your project directory if necessary
gradle test --no-daemon --refresh-dependencies
- name: Archive test results
if: always()
uses: actions/upload-artifact@v3
with:
name: test-results
path: tripkit-android-ui/build/test-results/test # Adjust path as necessary

- name: Comment on Pull Request for Unit Test Failures
if: failure() && github.event_name == 'pull_request' && steps.unit_tests.outcome == 'failure'
uses: thollander/[email protected]
with:
message: |
:x: Unit tests failed!
@${{ github.event.pull_request.assignee.login || github.event.pull_request.user.login }}, please review and fix the issues in the unit tests. Let us know if you need any help.
- name: Comment on Pull Request for General Workflow Failures
if: failure() && github.event_name == 'pull_request' && steps.unit_tests.outcome != 'failure'
uses: thollander/[email protected]
with:
message: |
:x: Workflow execution failed!
@${{ github.event.pull_request.assignee.login || github.event.pull_request.user.login }}, there was an issue with the workflow execution. Please check the logs and resolve the issue.
- name: Comment on Pull Request on Success
if: success() && github.event_name == 'pull_request'
uses: thollander/[email protected]
with:
message: |
:white_check_mark: Unit tests passed successfully!
@${{ github.event.pull_request.requested_reviewers.*.login }}, the tests have passed. The code is ready for review.

0 comments on commit dfcbcf0

Please sign in to comment.