A Java calculator web app, build by Maven, CI/CD
Create calculator App
- Sum: sum two numbers and return result
- Subtract: subtract two numbers and return result
- Multiply: multiply two numbers and return result
- Divide: divide two numbers and return result
- divide by zero should return error message
Create a service to wrap those methods
- Sum: sum two numbers and return result
- Subtract: subtract two numbers and return result
- Multiply: multiply two numbers and return result
- Divide: divide two numbers and return result
- divide by zero should return error message
- JDK-11
- Maven 3.8.4
Maven execution:
$ mvn clean test
Maven wrapper:
$ mvn wrapper:wrapper -Dmaven=3.8.4
Execute (linux/macos mvnw or windows mvnw.cmd):
$ ./mvnw clean test
Github action ci step definition:
steps:
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- uses: actions/checkout@v2
# Runs a single command using the runners shell
- name: Set up JDK 1.11
uses: actions/[email protected]
with:
java-version: '11'
distribution: 'zulu'
cache: 'maven'
- name: Compile
run: mvn compile
- name: Test
run: mvn verify
TODO