Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update Release workflow and update examples #322

Merged
merged 33 commits into from
Feb 26, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
33 commits
Select commit Hold shift + click to select a range
539f3e0
Update Release workflow
sahanHe Feb 16, 2024
f4f384e
Add build.sh file to samples
sahanHe Feb 19, 2024
167e8e8
Add build.sh file to samples
sahanHe Feb 19, 2024
c7114c7
Update build.gradle
sahanHe Feb 19, 2024
8208d60
Merge branch 'revamp-2023' of https://github.com/ballerina-platform/m…
sahanHe Feb 19, 2024
e371cc6
Clean the code
sahanHe Feb 19, 2024
db871a1
Remove integration examples
sahanHe Feb 19, 2024
6fa31e6
move samples to examples
sahanHe Feb 19, 2024
26e8f8b
Update examples in to ballerina projects
sahanHe Feb 19, 2024
873c8b8
Update examples removing os dependancy
sahanHe Feb 19, 2024
05e45d3
Update .github/workflows/release.yml
sahanHe Feb 19, 2024
c780483
Update CODEOWNERS
sahanHe Feb 19, 2024
06c7364
Update pull-request.yml
sahanHe Feb 19, 2024
22342ff
Merge branch 'revamp-2023' of https://github.com/ballerina-platform/m…
sahanHe Feb 19, 2024
8e8e3b6
Update resource paths
sahanHe Feb 20, 2024
4135f26
Update example links in md files
sahanHe Feb 21, 2024
d20575a
Update Ballerina.toml
sahanHe Feb 21, 2024
afdc8b0
Clean the code
sahanHe Feb 21, 2024
dea0d61
Merge branch 'revamp-2023' of https://github.com/ballerina-platform/m…
sahanHe Feb 21, 2024
dce5b53
Apply suggestions from code review
sahanHe Feb 21, 2024
77d651a
Migrate other workflows to centralized ones
sahanHe Feb 21, 2024
8543bbd
Merge branch 'revamp-2023' of https://github.com/ballerina-platform/m…
sahanHe Feb 21, 2024
60fa932
Merge branch 'master' into revamp-2023
sahanHe Feb 21, 2024
2b56a84
Update graalvm check workflow
sahanHe Feb 21, 2024
73627d4
Merge branch 'revamp-2023' of https://github.com/ballerina-platform/m…
sahanHe Feb 21, 2024
00efe42
Update readme files of examples
sahanHe Feb 22, 2024
5b2cd79
Update Module.md
sahanHe Feb 22, 2024
a8716f1
Apply suggestions from code review
sahanHe Feb 22, 2024
70dfeb8
Update release.yml removing repository_dispatch
sahanHe Feb 22, 2024
117efc6
Merge branch 'revamp-2023' of https://github.com/ballerina-platform/m…
sahanHe Feb 22, 2024
bbda6d2
Update project organisation of examples
sahanHe Feb 22, 2024
637bff3
Update code according to comments
sahanHe Feb 22, 2024
a312931
Update org name
sahanHe Feb 26, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/CODEOWNERS
Validating CODEOWNERS rules …
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,4 @@
# See: https://help.github.com/articles/about-codeowners/

# These owners will be the default owners for everything in the repo.
* @indikasampath2000 @abeykoon @sachinira
* @aashikam @niveathika @sahanHe
21 changes: 21 additions & 0 deletions .github/workflows/build-with-bal-test-graalvm.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
name: GraalVM Check

on:
schedule:
- cron: "30 18 * * *"
workflow_dispatch:

concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.run_id }}
cancel-in-progress: true

jobs:
call_stdlib_workflow:
name: Run StdLib Workflow
if: ${{ github.event_name != 'schedule' || (github.event_name == 'schedule' && github.repository_owner == 'ballerina-platform') }}
uses: ballerina-platform/ballerina-standard-library/.github/workflows/build-with-bal-test-graalvm-connector-template.yml@main
secrets: inherit
with:
additional-build-flags: "-x :salesforce-examples:build"


sahanHe marked this conversation as resolved.
Show resolved Hide resolved
59 changes: 0 additions & 59 deletions .github/workflows/build-with-bal-test-native.yml

This file was deleted.

74 changes: 9 additions & 65 deletions .github/workflows/daily-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,71 +2,15 @@ name: Daily build

on:
schedule:
- cron: '30 2 * * *'
- cron: "30 2 * * *"

jobs:
build:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2

# Set up Java Environment
- name: Set up JDK 17
uses: actions/setup-java@v1
with:
java-version: 17.0.7

# Setup Ballerina Environment
- name: Set Up Ballerina
uses: ballerina-platform/[email protected]
with:
version: latest

# Grant execute permission to the gradlew script
- name: Grant execute permission for gradlew
run: chmod +x gradlew

# Build the project with Gradle
- name: Build with Gradle
env:
packageUser: ${{ secrets.BALLERINA_BOT_USERNAME }}
packagePAT: ${{ secrets.BALLERINA_BOT_TOKEN }}
JAVA_OPTS: -DBALLERINA_DEV_COMPILE_BALLERINA_ORG=true
run: |
./gradlew build -x test

# Build Ballerina Project
- name: Ballerina Build
run: bal pack ./ballerina
env:
JAVA_HOME: /usr/lib/jvm/default-jvm
call_workflow:
name: Run Daily Build Workflow
if: ${{ github.repository_owner == 'ballerina-platform' }}
uses: ballerina-platform/ballerina-standard-library/.github/workflows/daily-build-connector-template.yml@main
secrets: inherit
with:
repo-name: module-ballerinax-sfdc

# Test Ballerina Project
- name: Ballerina Test
run: bal test --test-report --code-coverage --coverage-format=xml ./ballerina
env:
CLIENT_ID: ${{ secrets.CLIENT_ID }}
CLIENT_SECRET: ${{ secrets.CLIENT_SECRET }}
EP_URL: ${{ secrets.EP_URL }}
REFRESH_TOKEN: ${{ secrets.REFRESH_TOKEN }}
REFRESH_URL: ${{ secrets.REFRESH_URL }}
JAVA_HOME: /usr/lib/jvm/default-jvm

- name: Upload coverage reports to Codecov
uses: codecov/codecov-action@v3

# Send notification when build fails
- name: Notify failure
if: ${{ failure() }}
run: |
curl -X POST \
'https://api.github.com/repos/ballerina-platform/ballerina-release/dispatches' \
-H 'Accept: application/vnd.github.v3+json' \
-H 'Authorization: Bearer ${{ secrets.BALLERINA_BOT_TOKEN }}' \
--data "{
\"event_type\": \"notify-build-failure\",
\"client_payload\": {
\"repoName\": \"module-ballerinax-sfdc\"
}
}"

sahanHe marked this conversation as resolved.
Show resolved Hide resolved
79 changes: 15 additions & 64 deletions .github/workflows/dev-stg-release.yml
Original file line number Diff line number Diff line change
@@ -1,72 +1,23 @@
name: Dev/Staging BCentral Release
name: Publish to the Ballerina Dev\Stage Central

on:
workflow_dispatch:
inputs:
bal_central_environment:
description: Ballerina Central Environment
environment:
type: choice
options:
- STAGE
- DEV
description: Select Environment
required: true
options:
- DEV CENTRAL
- STAGE CENTRAL

jobs:
release:
runs-on: ubuntu-latest
env:
BALLERINA_${{ github.event.inputs.bal_central_environment }}_CENTRAL: true

steps:
- uses: actions/checkout@v2
- name: Set up JDK 17
uses: actions/setup-java@v1
with:
java-version: 17.0.7

- name: Set Up Ballerina
uses: ballerina-platform/[email protected]
with:
version: 2201.8.0

- name: Grant execute permission for gradlew
run: chmod +x gradlew

- name: Build with Gradle
env:
packageUser: ${{ secrets.BALLERINA_BOT_USERNAME }}
packagePAT: ${{ secrets.BALLERINA_BOT_TOKEN }}
JAVA_OPTS: -DBALLERINA_DEV_COMPILE_BALLERINA_ORG=true
run: |
./gradlew build -x test -x :salesforce-examples:build

- name: Run Trivy vulnerability scanner
uses: aquasecurity/trivy-action@master
with:
scan-type: 'rootfs'
scan-ref: '.'
skip-dirs: 'gradle/'
format: 'table'
timeout: '10m0s'
exit-code: '1'

- name: Ballerina Build
run: bal pack ./ballerina
env:
JAVA_HOME: /usr/lib/jvm/default-jvm

- name: Push to Staging
if: github.event.inputs.bal_central_environment == 'STAGE'
working-directory: ./ballerina
run: bal push
env:
BALLERINA_CENTRAL_ACCESS_TOKEN: ${{ secrets.BALLERINA_CENTRAL_STAGE_ACCESS_TOKEN }}
JAVA_HOME: /usr/lib/jvm/default-jvm

- name: Push to Dev
if: github.event.inputs.bal_central_environment == 'DEV'
run: bal push
working-directory: ./ballerina
env:
BALLERINA_CENTRAL_ACCESS_TOKEN: ${{ secrets.BALLERINA_CENTRAL_DEV_ACCESS_TOKEN }}
JAVA_HOME: /usr/lib/jvm/default-jvm
call_workflow:
name: Run Dev\Stage Central Publish Workflow
if: ${{ github.repository_owner == 'ballerina-platform' }}
uses: ballerina-platform/ballerina-standard-library/.github/workflows/dev-stage-central-publish-connector-template.yml@main
secrets: inherit
with:
environment: ${{ github.event.inputs.environment }}
additional-publish-flags: "-x :salesforce-examples:build"

66 changes: 12 additions & 54 deletions .github/workflows/pull-request.yml
Original file line number Diff line number Diff line change
@@ -1,57 +1,15 @@
name: CI_pull_request
name: PR Build

on: [ pull_request ]
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.run_id }}
cancel-in-progress: true

jobs:
build:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2

# Set up Java Environment
- name: Set up JDK 17
uses: actions/setup-java@v1
with:
java-version: 17.0.7

# Setup Ballerina Environment
- name: Set Up Ballerina
uses: ballerina-platform/[email protected]
with:
version: latest
on: pull_request

# Grant execute permission to the gradlew script
- name: Grant execute permission for gradlew
run: chmod +x gradlew

# Build the project with Gradle
- name: Build with Gradle
env:
packageUser: ${{ github.actor }}
packagePAT: ${{ secrets.GITHUB_TOKEN }}
JAVA_OPTS: -DBALLERINA_DEV_COMPILE_BALLERINA_ORG=true
run: |
./gradlew build -x test

# Build Ballerina Project
- name: Ballerina Build
run: bal pack ./ballerina
env:
JAVA_HOME: /usr/lib/jvm/default-jvm

# Test Ballerina Project
- name: Ballerina Test
# tests will be skipped if the PR is from a forked repository (as the secrets are not available)
if: ${{ github.event.pull_request.head.repo.full_name == github.repository }}
run: bal test --test-report --code-coverage --coverage-format=xml ./ballerina
env:
CLIENT_ID: ${{ secrets.CLIENT_ID }}
CLIENT_SECRET: ${{ secrets.CLIENT_SECRET }}
EP_URL: ${{ secrets.EP_URL }}
REFRESH_TOKEN: ${{ secrets.REFRESH_TOKEN }}
REFRESH_URL: ${{ secrets.REFRESH_URL }}
JAVA_HOME: /usr/lib/jvm/default-jvm

- name: Upload coverage reports to Codecov
uses: codecov/codecov-action@v3
jobs:
call_workflow:
name: Run PR Build Workflow
if: ${{ github.repository_owner == 'ballerina-platform' }}
uses: ballerina-platform/ballerina-standard-library/.github/workflows/pr-build-connector-template.yml@main
secrets: inherit

Loading
Loading