Skip to content

Commit 4478f41

Browse files
committed
README improvements + CI unit test naming changes
1 parent 512e543 commit 4478f41

File tree

2 files changed

+103
-12
lines changed

2 files changed

+103
-12
lines changed

.github/workflows/ci.yml

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -102,11 +102,11 @@ jobs:
102102
name: jar-artifact # naming the artifact jar file/s path
103103
path: target/ # actual relative path to the artifact in the container - target/
104104

105-
uat-parallel-tests:
106-
# uat-parallel-tests job will run on ubuntu-latest github-hosted runner
107-
name: UAT
105+
unit-parallel-tests:
106+
# unit-parallel-tests job will run on ubuntu-latest github-hosted runner
107+
name: UNIT-PARALLEL-TESTS
108108
runs-on: ubuntu-latest
109-
needs: # needs build job and runner-indexes job to be completed before running the uat-parallel-tests job
109+
needs: # needs build job and runner-indexes job to be completed before running the unit-parallel-tests job
110110
- build
111111
- runner-indexes
112112
container:
@@ -191,15 +191,15 @@ jobs:
191191

192192
build-and-publish-docker-image: # job to build the docker image and publish it to the GitHub Container Registry
193193
runs-on: ubuntu-latest # using the latest ubuntu runner
194-
needs: [build, uat-parallel-tests] # this job needs build and uat-parallel-tests jobs as a requirement to run
194+
needs: [build, unit-parallel-tests] # this job needs build and unit-parallel-tests jobs as a requirement to run
195195
if: github.ref == 'refs/heads/main' # run this job only when the branch is main branch and not on pull requests or other branches - https://docs.github.com/en/actions/reference/context-and-expression-syntax-for-github-actions#github-context
196196
# permissions for write acces to the packages and id-token and push access to the repository to create the container registry token
197197
permissions:
198198
packages: write
199199
id-token: write
200200
contents: write
201201

202-
# steps to run the uat-parallel-tests job are as follows:
202+
# steps to run the unit-parallel-tests job are as follows:
203203
# 1. checkout the repository
204204
# 2. download the jar artifact from the build job
205205
# 3. use the docker layer caching action to speed up the docker image build process
@@ -232,7 +232,7 @@ jobs:
232232
cache-from: type=registry,ref=ghcr.io/${{ github.repository }}:latest # use the docker layer caching to speed up the docker image build process
233233
cache-to: type=inline
234234

235-
runner-indexes: # job to generate the runner indexes for the uat-parallel-tests job
235+
runner-indexes: # job to generate the runner indexes for the unit-parallel-tests job
236236
runs-on: ubuntu-latest
237237
name: Generate runner indexes
238238
outputs:

README.md

Lines changed: 96 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,97 @@
1-
## Springboot app with Liquibase and Oracle Database
2-
This is a Maven project that demos how to run a Spring application in CircleCI/CD with the [Liquibase spring integration](https://www.liquibase.org/javadoc/liquibase/integration/spring/SpringLiquibase.html) and the Liquibase [Maven Plugin](https://docs.liquibase.com/tools-integrations/maven/home.html).
1+
# Java Demo App
32

4-
## GitHub Actions or CircleCI Workflows
5-
1. The workflow will first run [Quality Checks](https://www.liquibase.com/quality-checks) using the Liquibase [Maven Plugin](https://docs.liquibase.com/tools-integrations/maven/home.html).
6-
2. If the Quality Checks run successfully, the workflow will then build the application. That will include running the database changes with [Liquibase spring integration](https://www.liquibase.org/javadoc/liquibase/integration/spring/SpringLiquibase.html) and packaging the application code (compiling, running unit tests and generating artifacts).
3+
**The App**
4+
5+
This is a simple Sales Manager Java App that stores sales items in a table presented in a web app.
6+
7+
This demo repo is designed to help understand some of **CI/CD** (Continuous Integration/Continuous Delivery) principles and best practices.
8+
9+
**The Settings**
10+
11+
**Java** (Spring Boot framework) with **MVC** (Model View Controller) and **OOP** (Object Oriented Programming) design patterns.
12+
13+
*CI/CD Pipeline*
14+
[GitHub Actions](https://docs.github.com/en/enterprise-cloud@latest/actions) as the main CI/CD pipeline orchestrator
15+
Tools used to optimize the pipeline (See the `.github/workflows/ci.yml` for more detailed configuration).
16+
17+
- [Caching Dependencies to Speed Up Workflows](https://docs.github.com/en/enterprise-cloud@latest/actions/using-workflows/caching-dependencies-to-speed-up-workflows)
18+
- [Using the Metrix Strategy to Run Unit Tests In Parallel](https://docs.github.com/en/enterprise-cloud@latest/actions/using-jobs/using-a-matrix-for-your-jobs)
19+
20+
# CI/CD Diagram
21+
```mermaid
22+
stateDiagram
23+
state Continuous-Integration {
24+
Commits --> PR: Developers Commit new changes in a Pull Request
25+
PR --> CI: Security Scans, Build & Unit Test Suit
26+
CI --> PR: Feedback of failed tests - back to dev
27+
CI --> Publish: If CI passes, \nmerging to main branch \nand publishing Containerised\n App to GHCR
28+
}
29+
30+
state Parallel-Testing {
31+
CI --> JunitTest1
32+
CI --> JunitTest2
33+
CI --> JunitTest3
34+
CI --> JunitTest..N
35+
}
36+
37+
state Continuous-Delivery {
38+
Publish --> PreProdTests: Pulling Image from GHDR
39+
PreProdTests --> Deploy: Deploy the app to K8s
40+
}
41+
```
42+
43+
# Gitgraph Diagram - Developer Workflow
44+
```mermaid
45+
%%{init: { 'logLevel': 'debug', 'theme': 'base', 'gitGraph': {'showBranches': true}} }%%
46+
gitGraph
47+
commit
48+
branch hotfix
49+
checkout hotfix
50+
commit
51+
branch develop
52+
checkout develop
53+
commit id:"ash" tag:"abc"
54+
branch featureB
55+
checkout featureB
56+
commit type:HIGHLIGHT
57+
checkout main
58+
checkout hotfix
59+
commit type:NORMAL
60+
checkout develop
61+
commit type:REVERSE
62+
checkout featureB
63+
commit
64+
checkout main
65+
merge hotfix
66+
checkout featureB
67+
commit
68+
checkout develop
69+
branch featureA
70+
commit
71+
checkout develop
72+
merge hotfix
73+
checkout featureA
74+
commit
75+
checkout featureB
76+
commit
77+
checkout develop
78+
merge featureA
79+
branch release
80+
checkout release
81+
commit
82+
checkout main
83+
commit
84+
checkout release
85+
merge main
86+
checkout develop
87+
merge release
88+
```
89+
90+
*Building and Testing*
91+
- [Maven](https://maven.apache.org/) as the project management for Building and Testing the application.
92+
93+
94+
User input data is stored in an Oracle (PDB) Database.
95+
96+
97+
For easy demos, an H2 database (Oracle Mode) is setup by default in the `src/main/resources/application.properties` file.

0 commit comments

Comments
 (0)