Skip to content

Commit

Permalink
Merge pull request #1901 from tharindu1st/enable-checks
Browse files Browse the repository at this point in the history
Enable checks
  • Loading branch information
tharindu1st authored Dec 11, 2023
2 parents 24bee7b + 9eb3f3d commit 09d025d
Show file tree
Hide file tree
Showing 33 changed files with 201 additions and 250 deletions.
17 changes: 9 additions & 8 deletions .github/workflows/adapter-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,11 +29,9 @@ on:
next_version:
type: string
description: "Next Development Version"
pull_request:
pull_request_target:
types:
- closed
- opened
- synchronize
paths:
- '**/adapter/**'
branches:
Expand Down Expand Up @@ -68,7 +66,7 @@ jobs:
git config --global user.email ${{ secrets.WSO2_BOT_EMAIL }}
- name: checkout pull request and merge.
shell: sh
if: github.event_name == 'pull_request' && github.event.action == 'opened' || github.event.action == 'synchronize'
if: github.event_name == 'pull_request_target' && contains(github.event.label.name, 'trigger-action')
run: |
cd apk-repo
gh pr checkout ${{ github.event.number }} -b pr-${{ github.event.number }}
Expand All @@ -77,14 +75,17 @@ jobs:
- name: Run Release Gradle build
if: github.event_name == 'workflow_dispatch' && github.event.inputs.release_version != '' && github.event.inputs.next_version != ''
run: |
cd apk-repo/adapter
./gradlew 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
cd apk-repo
git checkout -b adapter-1.x
git push origin adapter-1.x
cd adapter
./gradlew 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 -PreleaseBranch=adapter-1.x
- name: Run Gradle Build
run: |
cd apk-repo/adapter
./gradlew build
- name: Run Gradle Build
if: github.event_name == 'pull_request' && github.event.action == 'closed' && github.event.pull_request.merged == true
if: github.event_name == 'pull_request_target' && github.event.action == 'closed' && github.event.pull_request_target.merged == true
run: |
cd apk-repo/adapter
./gradlew docker_push -Pdocker_organization=${{ secrets.DOCKER_ORGANIZATION }} -Pdocker_username=${{ secrets.DOCKER_USERNAME }} -Pdocker_password=${{ secrets.DOCKER_PASSWORD }} -Pimage_version=latest -PmultiArch=true
Expand All @@ -106,4 +107,4 @@ jobs:
with:
verbose: true # optional (default = false)
directory: apk-repo/adapter
flags: adapter
flags: adapter
27 changes: 15 additions & 12 deletions .github/workflows/admin-domain-service-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,8 @@ on:
AZURE_ACR_NAME:
required: true
AZURE_CREDENTIALS:
required: true
required: true

workflow_dispatch:
inputs:
release_version:
Expand All @@ -28,21 +29,19 @@ on:
next_version:
type: string
description: "Next Development Version"
pull_request:
pull_request_target:
types:
- closed
- opened
- synchronize
paths:
- '**/admin/admin-domain-service/**'
- '**/common-bal-libs/**'
branches:
- 'main'
env:
GH_TOKEN: ${{ secrets.WSO2_BOT_TOKEN }}
concurrency:
group: admin-domain-service-${{ github.event.number || github.run_id }}
cancel-in-progress: true
env:
GH_TOKEN: ${{ secrets.WSO2_BOT_TOKEN }}
jobs:
build:
runs-on: ubuntu-latest
Expand Down Expand Up @@ -75,15 +74,15 @@ jobs:
with:
fetch-depth: "0"
path: apk-repo
token: ${{ secrets.WSO2_BOT_TOKEN }}
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: checkout pull request and merge.
shell: sh
if: github.event_name == 'pull_request' && github.event.action == 'opened' || github.event.action == 'synchronize'
if: github.event_name == 'pull_request_target' && contains(github.event.label.name, 'trigger-action')
run: |
cd apk-repo
gh pr checkout ${{ github.event.number }} -b pr-${{ github.event.number }}
Expand All @@ -96,17 +95,21 @@ jobs:
./gradlew build
- name: Run Gradle build
if: github.event_name == 'workflow_dispatch' && github.event.inputs.release_version != '' && github.event.inputs.next_version != ''
shell: sh
run: |
cd apk-repo/admin/admin-domain-service
./gradlew 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
cd apk-repo
git checkout -b admin-domain-service-1.x
git push origin admin-domain-service-1.x
cd admin/admin-domain-service
./gradlew 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 -PreleaseBranch=admin-domain-service-1.x
./gradlew :ballerina:commit_toml_files
git push
- name: Run Gradle Build
run: |
cd apk-repo/admin/admin-domain-service
./gradlew build
- name: Run Gradle Build
if: github.event_name == 'pull_request' && github.event.action == 'closed' && github.event.pull_request.merged == true
if: github.event_name == 'pull_request_target' && github.event.action == 'closed' && github.event.pull_request_target.merged == true
run: |
cd apk-repo/admin/admin-domain-service
./gradlew docker:docker_push -Pdocker_organization=${{ secrets.DOCKER_ORGANIZATION }} -Pdocker_username=${{ secrets.DOCKER_USERNAME }} -Pdocker_password=${{ secrets.DOCKER_PASSWORD }} -Pimage_version=latest -PmultiArch=true
Expand All @@ -127,4 +130,4 @@ jobs:
with:
verbose: true # optional (default = false)
directory: apk-repo/admin/admin-domain-service
flags: admin-domain-service
flags: admin-domain-service
23 changes: 13 additions & 10 deletions .github/workflows/backoffice-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,21 +29,19 @@ on:
next_version:
type: string
description: "Next Development Version"
pull_request:
pull_request_target:
types:
- closed
- opened
- synchronize
paths:
- '**/backoffice/backoffice-domain-service/**'
- '**/common-bal-libs/**'
branches:
- 'main'
env:
GH_TOKEN: ${{ secrets.WSO2_BOT_TOKEN }}
concurrency:
group: backoffice-${{ github.event.number || github.run_id }}
cancel-in-progress: true
env:
GH_TOKEN: ${{ secrets.WSO2_BOT_TOKEN }}
jobs:
build:
runs-on: ubuntu-latest
Expand Down Expand Up @@ -84,29 +82,34 @@ jobs:
git config --global user.email ${{ secrets.WSO2_BOT_EMAIL }}
- name: checkout pull request and merge.
shell: sh
if: github.event_name == 'pull_request' && github.event.action == 'opened' || github.event.action == 'synchronize'
if: github.event_name == 'pull_request_target' && contains(github.event.label.name, 'trigger-action')
run: |
cd apk-repo
gh pr checkout ${{ github.event.number }} -b pr-${{ github.event.number }}
git checkout pr-${{ github.event.number }}
git merge origin/main
- name: build common bal libs
run: |
cd apk-repo/common-bal-libs
./gradlew build
- name: Run Gradle build
if: github.event_name == 'workflow_dispatch' && github.event.inputs.release_version != '' && github.event.inputs.next_version != ''
shell: sh
run: |
cd apk-repo/backoffice/backoffice-domain-service
./gradlew 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
cd apk-repo
git checkout -b backoffice-domain-service-1.x
git push origin backoffice-domain-service-1.x
cd backoffice/backoffice-domain-service
./gradlew 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 -PreleaseBranch=backoffice-domain-service-1.x
./gradlew :ballerina:commit_toml_files
git push
- name: Run Gradle Build
run: |
cd apk-repo/backoffice/backoffice-domain-service
./gradlew build
- name: Run Gradle Build
if: github.event_name == 'pull_request' && github.event.action == 'closed' && github.event.pull_request.merged == true
if: github.event_name == 'pull_request_target' && github.event.action == 'closed' && github.event.pull_request_target.merged == true
run: |
cd apk-repo/backoffice/backoffice-domain-service
./gradlew docker:docker_push -Pdocker_organization=${{ secrets.DOCKER_ORGANIZATION }} -Pdocker_username=${{ secrets.DOCKER_USERNAME }} -Pdocker_password=${{ secrets.DOCKER_PASSWORD }} -Pimage_version=latest -PmultiArch=true
Expand All @@ -128,4 +131,4 @@ jobs:
verbose: true # optional (default = false)
directory: apk-repo/backoffice/backoffice-domain-service
flags: backoffice-domain-service


2 changes: 0 additions & 2 deletions .github/workflows/clean-acr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,6 @@ on:
workflow_dispatch:
schedule:
- cron: "0 0 * * MON"
env:
GH_TOKEN: ${{ secrets.WSO2_BOT_TOKEN }}
jobs:
clean:
runs-on: ubuntu-latest
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/code-coverage.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name: Code Coverage
on:
workflow_dispatch:
pull_request:
pull_request_target:
types:
- closed
branches:
Expand Down
17 changes: 9 additions & 8 deletions .github/workflows/common-controller-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,11 +29,9 @@ on:
next_version:
type: string
description: "Next Development Version"
pull_request:
pull_request_target:
types:
- closed
- opened
- synchronize
paths:
- '**/common-controller/**'
branches:
Expand Down Expand Up @@ -68,7 +66,7 @@ jobs:
git config --global user.email ${{ secrets.WSO2_BOT_EMAIL }}
- name: checkout pull request and merge.
shell: sh
if: github.event_name == 'pull_request' && github.event.action == 'opened' || github.event.action == 'synchronize'
if: github.event_name == 'pull_request_target' && contains(github.event.label.name, 'trigger-action')
run: |
cd apk-repo
gh pr checkout ${{ github.event.number }} -b pr-${{ github.event.number }}
Expand All @@ -77,14 +75,17 @@ jobs:
- name: Run Release Gradle build
if: github.event_name == 'workflow_dispatch' && github.event.inputs.release_version != '' && github.event.inputs.next_version != ''
run: |
cd apk-repo/common-controller
./gradlew 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
cd apk-repo
git checkout -b common-controller-1.x
git push origin common-controller-1.x
cd common-controller
./gradlew 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 -PreleaseBranch=common-controller-1.x
- name: Run Gradle Build
run: |
cd apk-repo/common-controller
./gradlew build
- name: Run Gradle Build
if: github.event_name == 'pull_request' && github.event.action == 'closed' && github.event.pull_request.merged == true
if: github.event_name == 'pull_request_target' && github.event.action == 'closed' && github.event.pull_request_target.merged == true
run: |
cd apk-repo/common-controller
./gradlew docker_push -Pdocker_organization=${{ secrets.DOCKER_ORGANIZATION }} -Pdocker_username=${{ secrets.DOCKER_USERNAME }} -Pdocker_password=${{ secrets.DOCKER_PASSWORD }} -Pimage_version=latest -PmultiArch=true
Expand All @@ -106,4 +107,4 @@ jobs:
with:
verbose: true # optional (default = false)
directory: apk-repo/common-controller
flags: common-controller
flags: common-controller
19 changes: 10 additions & 9 deletions .github/workflows/config-deployer-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,19 +29,16 @@ on:
next_version:
type: string
description: "Next Development Version"
pull_request:
pull_request_target:
types:
- closed
- opened
- synchronize
paths:
- '**/runtime/config-deployer-service/**'
- '**/common-bal-libs/**'
branches:
- 'main'
env:
GH_TOKEN: ${{ secrets.WSO2_BOT_TOKEN }}

concurrency:
group: config-deployer-service-${{ github.event.number || github.run_id }}
cancel-in-progress: true
Expand Down Expand Up @@ -85,7 +82,7 @@ jobs:
git config --global user.email ${{ secrets.WSO2_BOT_EMAIL }}
- name: checkout pull request and merge.
shell: sh
if: github.event_name == 'pull_request' && github.event.action == 'opened' || github.event.action == 'synchronize'
if: github.event_name == 'pull_request_target' && contains(github.event.label.name, 'trigger-action')
run: |
cd apk-repo
gh pr checkout ${{ github.event.number }} -b pr-${{ github.event.number }}
Expand All @@ -98,17 +95,21 @@ jobs:
./gradlew build
- name: Run Gradle build
if: github.event_name == 'workflow_dispatch' && github.event.inputs.release_version != '' && github.event.inputs.next_version != ''
shell: sh
run: |
cd apk-repo/runtime/config-deployer-service
./gradlew 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
cd apk-repo
git checkout -b config-deployer-service-1.x
git push origin config-deployer-service-1.x
cd runtime/config-deployer-service
./gradlew 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 -PreleaseBranch=config-deployer-service-1.x
./gradlew :ballerina:commit_toml_files
git push
- name: Run Gradle Build
run: |
cd apk-repo/runtime/config-deployer-service
./gradlew build
- name: Run Gradle Build
if: github.event_name == 'pull_request' && github.event.action == 'closed' && github.event.pull_request.merged == true
if: github.event_name == 'pull_request_target' && github.event.action == 'closed' && github.event.pull_request_target.merged == true
run: |
cd apk-repo/runtime/config-deployer-service
./gradlew docker:docker_push -Pdocker_organization=${{ secrets.DOCKER_ORGANIZATION }} -Pdocker_username=${{ secrets.DOCKER_USERNAME }} -Pdocker_password=${{ secrets.DOCKER_PASSWORD }} -Pimage_version=latest -PmultiArch=true
Expand All @@ -129,4 +130,4 @@ jobs:
with:
verbose: true # optional (default = false)
directory: apk-repo/runtime/config-deployer-service
flags: config-deployer-service
flags: config-deployer-service
26 changes: 26 additions & 0 deletions .github/workflows/delete-workflow-trigger.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
name: Remove github integration action trigger label
on:
pull_request_target:
types:
- synchronize
- closed
concurrency:
group: integration-test-${{ github.event.number || github.run_id }}
cancel-in-progress: true
jobs:
remove-label:
runs-on: ubuntu-latest
steps:
- name: Check out repository
uses: actions/checkout@v2

- name: Remove label
run: |
TOKEN="${{ secrets.GITHUB_TOKEN }}"
PR_NUMBER="${{ github.event.number }}"
LABEL_TO_REMOVE="trigger-action"
# Remove the label from the pull request
curl -X DELETE \
-H "Authorization: token $TOKEN" \
"https://api.github.com/repos/${{ github.repository }}/issues/${PR_NUMBER}/labels/${LABEL_TO_REMOVE}"
Loading

0 comments on commit 09d025d

Please sign in to comment.