Skip to content

Commit

Permalink
Merge pull request #2 from Sunbird-Knowlg/release-5.7.0
Browse files Browse the repository at this point in the history
Issue KN-000 merge: Merge Release 5.7.0 into Master
  • Loading branch information
maheshkumargangula authored Aug 30, 2023
2 parents 87be9d5 + 03509ec commit 3b8b871
Show file tree
Hide file tree
Showing 1,045 changed files with 42,950 additions and 98,711 deletions.
52 changes: 0 additions & 52 deletions .circleci/config.yml

This file was deleted.

2 changes: 1 addition & 1 deletion .github/pull_request_template.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ Please describe the tests that you ran to verify your changes in the below check
- [ ] Ran Test B

**Test Configuration**:
* Software versions: Java 11, scala-2.11, play-2.7.2
* Software versions: Java 11, scala-2.12, play-2.7.2
* Hardware versions: 2 CPU/ 4GB RAM

### Checklist:
Expand Down
2 changes: 1 addition & 1 deletion .github/pull_request_template.md.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ Please describe the tests that you ran to verify your changes in the below check
- [ ] Ran Test B

**Test Configuration**:
* Software versions: Java 11, scala-2.11, play-2.7.2
* Software versions: Java 11, scala-2.12, play-2.7.2
* Hardware versions:

### Checklist:
Expand Down
98 changes: 98 additions & 0 deletions .github/workflows/search-api-build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,98 @@
name: search api workflow

on:
push:
branches:
- '*'

jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v2

- name: Set up JDK
uses: actions/setup-java@v2
with:
java-version: 14
distribution: 'adopt'
architecture: x64

- name: Cache Maven dependencies
uses: actions/cache@v2
with:
path: ~/.m2
key: kp-dependency-build-cache-${{ hashFiles('pom.xml') }}

- name: Build the project
run: |
cd search-api/
ls
mvn clean install -DskipTests
- name: Login to docker hub
uses: docker/login-action@v2
with:
username: ${{ vars.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}

- name: Build docker image and push
run: |
docker images
cd search-api/
sh knowlg-docker-image.sh ${{ github.ref_name }}
docker images
docker tag search-service:${{ github.ref_name }} ${{ vars.DOCKERHUB_USERNAME }}/search-service:${{ github.ref_name }}
docker push ${{ vars.DOCKERHUB_USERNAME }}/search-service:${{ github.ref_name }}
- name: Store Maven dependencies cache
uses: actions/cache@v2
with:
path: ~/.m2
key: kp-dependency-build-cache-${{ hashFiles('pom.xml') }}

unit-tests:
needs: [build]
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v2

- name: Set up JDK
uses: actions/setup-java@v2
with:
java-version: 14
distribution: 'adopt'
architecture: x64

- name: Cache Maven dependencies
uses: actions/cache@v2
with:
path: ~/.m2
key: kp-dependency-test-cache-${{ hashFiles('pom.xml') }}

- name: Setup environment and run tests
env:
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
run: |
cd search-api/
bash vmsetup.sh
- name: Save test results
run: |
mkdir -p ~/test-results/junit/
find . -type f -regex ".*/target/surefire-reports/.*xml" -exec cp {} ~/test-results/junit/ \;
if: always()

- name: Store Maven dependencies cache
uses: actions/cache@v2
with:
path: ~/.m2
key: kp-dependency-test-cache-${{ hashFiles('pom.xml') }}

- name: Upload test results
uses: actions/upload-artifact@v2
with:
name: test-results
path: ~/test-results

76 changes: 76 additions & 0 deletions .github/workflows/search-job-build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,76 @@
name: search job workflow

on:
push:
branches:
- '*'

jobs:
docker-build:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v3
with:
fetch-depth: 0

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2

- name: Login to docker hub
uses: docker/login-action@v2
with:
username: ${{ vars.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}

- name: Build docker image and push
run: |
cd search-job/
mvn clean install -DskipTests
docker build -t ${{ vars.DOCKERHUB_USERNAME }}/search-indexer:${{ github.ref_name }} .
docker images
docker push ${{ vars.DOCKERHUB_USERNAME }}/search-indexer:${{ github.ref_name }}
unit-tests:
runs-on: ubuntu-latest
defaults:
run:
working-directory: ./search-job/
steps:
- name: Checkout code
uses: actions/checkout@v2

- name: Set up Java
uses: actions/setup-java@v2
with:
java-version: 14
distribution: 'adopt'
architecture: x64

- name: Install imagemagick
run: |
sudo apt-get update --allow-releaseinfo-change || sudo apt-get update --allow-releaseinfo-change
sudo apt-get install -y imagemagick
- name: Execute coverage report
run: |
mvn clean scoverage:report
- name: Save test results
run: |
mkdir -p ~/test-results/junit/
find . -type f -regex ".*/target/surefire-reports/.*xml" -exec cp {} ~/test-results/junit/ \;
if: always()
- name: Save Maven cache
uses: actions/cache@v2
with:
path: ~/.m2
key: kp-jobs-dependency-cache-${{ hashFiles('pom.xml') }}
- name: Upload test results
uses: actions/upload-artifact@v2
with:
name: test-results
path: ~/test-results
- name: Run SonarQube analysis
env:
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
run: |
mvn -X sonar:sonar -Dlog4j.configuration=./logs sonar:sonar -Dsonar.projectKey=Sunbird-Knowlg_knowlg-search -Dsonar.organization=sunbird-knowlg-1 -Dsonar.host.url=https://sonarcloud.io -Dsonar.exclusions=**/cert-processor/** -Dsonar.scala.coverage.reportPaths=/home/runner/work/knowlg-search/knowlg-search/search-job/target/scoverage.xml
7 changes: 4 additions & 3 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
knowlg-search/.metals/metals.lock.db
project
.DS_Store
**/target/**
**/.idea/**
**/*.iml
.idea
*.class
Loading

0 comments on commit 3b8b871

Please sign in to comment.