Skip to content

Commit

Permalink
add build jobs and codecov for idp-domain-service and idp-ui
Browse files Browse the repository at this point in the history
  • Loading branch information
tharindu1st committed Feb 8, 2023
1 parent 18a162a commit bd6cf10
Show file tree
Hide file tree
Showing 4 changed files with 123 additions and 3 deletions.
66 changes: 66 additions & 0 deletions .github/workflows/idp-domain-service-release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
name: Release IDP Domain Service Release.
on:
workflow_dispatch:
inputs:
release_version:
required: true
type: string
description: "Release Version"
next_version:
type: string
description: "Next Development Version"
pull_request_target:
types:
- closed
paths:
- '**/idp/idp-service/**'

jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Cache Ballerina.
uses: actions/cache@v3
id: cache
with:
path: "ballerina-dist/*.deb"
key: ${{ runner.os }}-${{ hashFiles('**/lockfiles') }}
- name: Download Ballerina distribution.
shell: sh
run: |
mkdir -p ballerina-dist
wget 'https://dist.ballerina.io/downloads/2201.3.0/ballerina-2201.3.0-swan-lake-linux-x64.deb' -P ballerina-dist
if: steps.cache.outputs.cache-hit != 'true'
- name: Install Ballerina distribution.
shell: sh
run: "sudo dpkg -i ballerina-dist/ballerina-2201.3.0-swan-lake-linux-x64.deb"
- name: Verify Ballerina Version
shell: sh
run: "bal -v"

- name: Checkout apk-repo.
uses: actions/checkout@v3
with:
fetch-depth: "0"
path: apk-repo
token: ${{ secrets.WSO2_BOT_TOKEN }}
- name: Set release username and email
shell: sh
run: |
git config --global user.name ${{ secrets.WSO2_BOT_USER }}
git config --global user.email ${{ secrets.WSO2_BOT_EMAIL }}
- name: Run Gradle build
if: github.event_name == 'workflow_dispatch'
shell: sh
run: |
cd apk-repo/idp/idp-service
gradle release -Prelease.useAutomaticVersion=true -Pdocker_organization=${{ secrets.DOCKER_ORGANIZATION }} -Pdocker_username=${{ secrets.DOCKER_USERNAME }} -Pdocker_password=${{ secrets.DOCKER_PASSWORD }} -Prelease.releaseVersion=${{ github.event.inputs.release_version }} -Prelease.newVersion=${{ github.event.inputs.next_version }} -PmultiArch=true
- name: Run Gradle Build
if: github.event_name == 'pull_request_target' && github.event.action == 'closed' && github.event.pull_request.merged == true
run: |
cd apk-repo/idp/idp-service
gradle build -Pdocker_organization=${{ secrets.DOCKER_ORGANIZATION }} -Pdocker_username=${{ secrets.DOCKER_USERNAME }} -Pdocker_password=${{ secrets.DOCKER_PASSWORD }} -Pimage_version=latest -PmultiArch=true
gradle docker_push -Pdocker_organization=${{ secrets.DOCKER_ORGANIZATION }} -Pdocker_username=${{ secrets.DOCKER_USERNAME }} -Pdocker_password=${{ secrets.DOCKER_PASSWORD }} -Pimage_version=latest -PmultiArch=true
gradle docker_push -Pdocker_organization=${{ secrets.DOCKER_ORGANIZATION }} -Pdocker_username=${{ secrets.DOCKER_USERNAME }} -Pdocker_password=${{ secrets.DOCKER_PASSWORD }} -Pimage_version=${{ github.sha }} -PmultiArch=true
47 changes: 47 additions & 0 deletions .github/workflows/idp-ui-release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
name: Release IDP UI Server.
on:
workflow_dispatch:
inputs:
release_version:
required: true
type: string
description: "Release Version"
next_version:
type: string
description: "Next Development Version"
pull_request_target:
types:
- closed
paths:
- '**/management-server/**'

jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout apk-repo.
uses: actions/checkout@v3
with:
fetch-depth: "0"
path: apk-repo
token: ${{ secrets.WSO2_BOT_TOKEN }}
- name: Set release username and email
shell: sh
run: |
git config --global user.name ${{ secrets.WSO2_BOT_USER }}
git config --global user.email ${{ secrets.WSO2_BOT_EMAIL }}
- name: Run Gradle build
if: github.event_name == 'workflow_dispatch'
shell: sh
run: |
cd apk-repo/idp/idp-ui
gradle release -Prelease.useAutomaticVersion=true -Pdocker_organization=${{ secrets.DOCKER_ORGANIZATION }} -Pdocker_username=${{ secrets.DOCKER_USERNAME }} -Pdocker_password=${{ secrets.DOCKER_PASSWORD }} -Prelease.releaseVersion=${{ github.event.inputs.release_version }} -Prelease.newVersion=${{ github.event.inputs.next_version }} -PmultiArch=true
- name: Run Gradle Build
if: github.event_name == 'pull_request_target' && github.event.action == 'closed' && github.event.pull_request.merged == true
run: |
cd apk-repo/idp/idp-ui
gradle build -Pdocker_organization=${{ secrets.DOCKER_ORGANIZATION }} -Pdocker_username=${{ secrets.DOCKER_USERNAME }} -Pdocker_password=${{ secrets.DOCKER_PASSWORD }} -Pimage_version=latest -PmultiArch=true
gradle docker_push -Pdocker_organization=${{ secrets.DOCKER_ORGANIZATION }} -Pdocker_username=${{ secrets.DOCKER_USERNAME }} -Pdocker_password=${{ secrets.DOCKER_PASSWORD }} -Pimage_version=latest -PmultiArch=true
gradle docker_push -Pdocker_organization=${{ secrets.DOCKER_ORGANIZATION }} -Pdocker_username=${{ secrets.DOCKER_USERNAME }} -Pdocker_password=${{ secrets.DOCKER_PASSWORD }} -Pimage_version=${{ github.sha }} -PmultiArch=true
4 changes: 4 additions & 0 deletions build-apk.sh
Original file line number Diff line number Diff line change
Expand Up @@ -19,3 +19,7 @@ cd $current_dir;
cd gateway/router;gradle build;
cd $current_dir;
cd gateway/enforcer;gradle build;
cd $current_dir;
cd idp/idp-service;gradle build;
cd $current_dir;
cd idp/idp-ui;gradle build;
9 changes: 6 additions & 3 deletions codecov.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,6 @@ flag_management:
- name: backoffice-domain-service
paths:
- backoffice/backoffice-domain-service
- name: backoffice-internal-domain-service
paths:
- backoffice/backoffice-internal-domain-service
- name: devportal-domain-service
paths:
- devportal/devportal-domain-service
Expand All @@ -26,6 +23,12 @@ flag_management:
- name: runtime-domain-service
paths:
- runtime-domain-service
- name: idp-domain-service
paths:
- '**/idp/idp-service/**'
- name: idp-ui
paths:
- '**/idp/idp-ui/**'

statuses:
- type: project
Expand Down

0 comments on commit bd6cf10

Please sign in to comment.