Skip to content

Commit

Permalink
temp
Browse files Browse the repository at this point in the history
  • Loading branch information
holashchand committed Aug 16, 2024
1 parent c377055 commit 6f2dc13
Show file tree
Hide file tree
Showing 2 changed files with 58 additions and 12 deletions.
51 changes: 47 additions & 4 deletions .github/workflows/maven.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,30 @@ name: Java CI with Maven

on:
push:
branches: [ main ]
branches: [ main-test ]
pull_request:
branches: [ main ]
branches: [ main-test ]
workflow_dispatch:
inputs:
booleanInput:
description: 'Boolean input'
required: true
type: boolean
integerInput:
description: 'Integer input'
required: true
type: number
stringInput:
description: 'String input'
required: true
choiceInput:
description: 'Choice input'
required: true
type: choice
options:
- option1
- option2
- option3

jobs:
build:
Expand All @@ -20,6 +41,22 @@ jobs:
java-version: '11'
distribution: 'adopt'
cache: 'maven'
- name: Cache Maven dependencies
uses: actions/cache@v2
id: maven-cache
with:
path: ~/.m2/repository
key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}
restore-keys: |
${{ runner.os }}-maven-
- name: Cache Docker layers
uses: actions/cache@v2
id: docker-cache
with:
path: /tmp/.buildx-cache
key: ${{ runner.os }}-docker-${{ github.sha }}
restore-keys: |
${{ runner.os }}-docker-
- name: Set up properties
run: sh configure-dependencies.sh
- name: Check space before free up the space
Expand All @@ -43,9 +80,15 @@ jobs:
# ## limits ssh access and adds the ssh public key for the user which triggered the workflow ie holashchand
# limit-access-to-actor: true
- name: Build and test
run: make test
env:
BUILD_SERVICES: ${{ github.event.inputs.choiceInput }}
MAVEN_CACHE: ${{ steps.maven-cache.outputs.cache-hit }}
DOCKER_CACHE: ${{ steps.docker-cache.outputs.cache-hit }}
run: make test-build
- name: Check space after tests
run: df -h
run: |
df -h
docker image ls
# test:
# runs-on: ubuntu-latest
# steps:
Expand Down
19 changes: 11 additions & 8 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -11,21 +11,24 @@ build: java/registry/target/registry.jar
echo ${SOURCES}
rm -rf java/claim/target/*.jar
cd target && rm -rf * && jar xvf ../java/registry/target/registry.jar && cp ../java/Dockerfile ./ && docker build -t ghcr.io/sunbird-rc/sunbird-rc-core .
make -C java/claim
make -C services/notification-service docker
make -C services/metrics docker
make -C services/id-gen-service docker
make -C services/encryption-service docker
make -C services/identity-service/ docker
make -C services/credential-schema docker
make -C services/credentials-service/ docker
# make -C java/claim
# make -C services/notification-service docker
# make -C services/metrics docker
# make -C services/id-gen-service docker
# make -C services/encryption-service docker
# make -C services/identity-service/ docker
# make -C services/credential-schema docker
# make -C services/credentials-service/ docker


java/registry/target/registry.jar: $(SOURCES)
echo $(SOURCES)
sh configure-dependencies.sh
cd java && ./mvnw clean install

test-build: build
@echo BUILD SERVICE: $BUILD_SERVICES

test: build
@docker-compose -f docker-compose-v1.yml down
@sudo rm -rf db-data* es-data* || echo "no permission to delete"
Expand Down

0 comments on commit 6f2dc13

Please sign in to comment.