The Tip Calculator is an Android application built with Kotlin. It helps users calculate the tip amount for a restaurant waiter based on the total bill amount. Users can input a desired tip percentage, and the application will calculate the corresponding tip amount.
- Calculate tip based on the total bill amount.
- Input custom tip percentage.
- Instant calculation and display of the tip amount.
The primary objective of this project is to implement Continuous Integration and Continuous Deployment (CI/CD) for the Tip Calculator application. This ensures that the application is continuously tested, built, and deployed, providing a reliable and efficient development workflow.
The CI/CD pipeline for the Tip Calculator project includes six stages, ensuring code quality, reliability, and seamless deployment:
-
Lint
Analyzes the code for potential errors and enforces coding standards to maintain code quality. -
Unit Test
Runs unit tests to verify the functionality of individual components within the application. -
Instrumentation Test
Executes instrumentation tests to ensure that the app functions correctly in an Android environment. -
Static Code Analysis
Uses tools to perform static analysis on the codebase, identifying potential issues and ensuring compliance with coding standards. -
Package
Compiles the application and prepares it for deployment by generating the APK or AAB file. -
Release
Deploys the packaged application to the designated environment (e.g., Google Play Store, internal testing).
- Android Studio
- Kotlin
- A GitHub account
- Clone the repository:
git clone https://github.com/your-username/tip-calculator.git
- Open the project in Android Studio.
- Build the project:
./gradlew build
The CI/CD process is automated using GitHub Actions. The configuration file, located in .github/workflows
, defines the steps required to execute each stage of the pipeline.
- Lint
Linting is performed using thektlint
tool, which checks the Kotlin code for style violations and potential errors. - Unit Test
Unit tests are executed using thejunit
framework, ensuring that each function works as expected. - Instrumentation Test
Instrumentation tests are run on an Android emulator usingAndroidJUnitRunner
, verifying the app's behavior in a real environment. - Static Code Analysis
Static code analysis is conducted using tools likedetekt
andsonarqube
, which provide detailed reports on code quality and potential issues. - Package
The application is packaged using Gradle, generating an APK or AAB file ready for deployment. - Release
The final stage deploys the packaged application to the specified environment. This can be configured to upload the app to the Google Play Store or another distribution platform.
Contributions are welcome! Please fork this repository and submit a pull request for any improvements or bug fixes.
This project is licensed under the MIT License - see the LICENSE file for details.
For any questions or support, please contact [email protected].