Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
24 changes: 24 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
# Force LF line endings for all text files on all platforms
* text=auto eol=lf

# Java source files
*.java text eol=lf

# Ballerina source files
*.bal text eol=lf

# Config and build files
*.xml text eol=lf
*.json text eol=lf
*.yaml text eol=lf
*.yml text eol=lf
*.toml text eol=lf
*.properties text eol=lf
*.gradle text eol=lf

# Shell scripts
*.sh text eol=lf

# Windows scripts keep CRLF
*.bat text eol=crlf
*.cmd text eol=crlf
29 changes: 25 additions & 4 deletions .github/workflows/build-with-bal-test-graalvm.yml
Original file line number Diff line number Diff line change
@@ -1,9 +1,26 @@
name: GraalVM Check

on:
schedule:
- cron: "30 18 * * *"
workflow_dispatch:
inputs:
lang_tag:
description: Branch/Release Tag of the Ballerina Lang
required: true
default: master
lang_version:
description: Ballerina Lang Version (If given ballerina lang buid will be skipped)
required: false
default: ''
native_image_options:
description: Default native-image options
required: false
default: ''
pull_request:
branches:
- main
types: [ opened, synchronize, reopened, labeled, unlabeled ]
schedule:
- cron: '30 18 * * *'

concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.run_id }}
Expand All @@ -13,5 +30,9 @@ 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-library/.github/workflows/build-with-bal-test-graalvm-connector-template.yml@main
secrets: inherit
uses: ballerina-platform/ballerina-library/.github/workflows/build-with-bal-test-graalvm-template.yml@main
with:
lang_tag: ${{ inputs.lang_tag }}
lang_version: ${{ inputs.lang_version }}
native_image_options: '-J-Xmx7G ${{ inputs.native_image_options }}'
additional_windows_build_flags: '-x test'
6 changes: 2 additions & 4 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,7 @@ on:

jobs:
call_workflow:
name: Run Connector Build Workflow
name: Run Build Workflow
if: ${{ github.repository_owner == 'ballerina-platform' }}
uses: ballerina-platform/ballerina-library/.github/workflows/build-connector-template.yml@main
uses: ballerina-platform/ballerina-library/.github/workflows/build-timestamp-master-template.yml@main
secrets: inherit
with:
repo-name: module-ballerinax-wso2.apim.catalog
47 changes: 41 additions & 6 deletions .github/workflows/daily-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,45 @@ on:
- cron: "30 2 * * *"

jobs:
call_workflow:
name: Run Daily Build Workflow
build:
name: Daily Build
runs-on: ubuntu-22.04
if: ${{ github.repository_owner == 'ballerina-platform' }}
uses: ballerina-platform/ballerina-library/.github/workflows/daily-build-connector-template.yml@main
secrets: inherit
with:
repo-name: module-ballerinax-wso2.apim.catalog
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

steps:
- name: Checkout Repository
uses: actions/checkout@v3

- name: Set ENV Variables
run: |
echo "packageUser=${{ secrets.BALLERINA_BOT_USERNAME }}" >> $GITHUB_ENV
echo "packagePAT=${{ secrets.BALLERINA_BOT_TOKEN }}" >> $GITHUB_ENV

- name: Set up JDK 21
uses: actions/setup-java@v3
with:
distribution: 'temurin'
java-version: '21.0.3'

- name: Set up Ballerina
uses: ballerina-platform/setup-ballerina@v1.1.3
with:
version: 2201.13.1

- name: Build the Package
run: ./gradlew build -x test

- name: Run Tests
run: ./gradlew test

- name: Notify Build Failure
if: ${{ failure() }}
run: |
curl -X POST \
-H "Accept: application/vnd.github.v3+json" \
-H "Authorization: token ${{ secrets.BALLERINA_BOT_TOKEN }}" \
https://api.github.com/repos/ballerina-platform/ballerina-release/dispatches \
-d '{"event_type": "notify-build-failure", "client_payload": {"repoName": "module-ballerinax-wso2.apim.catalog"}}'
4 changes: 3 additions & 1 deletion .github/workflows/pull-request.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,5 +10,7 @@ jobs:
call_workflow:
name: Run PR Build Workflow
if: ${{ github.repository_owner == 'ballerina-platform' }}
uses: ballerina-platform/ballerina-library/.github/workflows/pr-build-connector-template.yml@main
uses: ballerina-platform/ballerina-library/.github/workflows/pull-request-build-template.yml@main
secrets: inherit
with:
additional-windows-test-flags: "-x test"
8 changes: 4 additions & 4 deletions ballerina-tests/Ballerina.toml
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
[package]
org = "ballerinax"
name = "apim_catalog_tests"
version = "1.1.0"
version = "1.2.0"

[[dependency]]
org = "ballerinax"
name = "wso2.apim.catalog"
version = "1.1.0"
version = "1.2.0"
repository="local"

[build-options]
Expand All @@ -18,5 +18,5 @@ graalvmCompatible = true
[[platform.java21.dependency]]
groupId = "io.ballerina"
artifactId = "wso2.apim.catalog-native"
version = "1.1.0"
path = "../native/build/libs/wso2.apim.catalog-native-1.1.0-SNAPSHOT.jar"
version = "1.2.0"
path = "../native/build/libs/wso2.apim.catalog-native-1.2.0-SNAPSHOT.jar"
47 changes: 32 additions & 15 deletions ballerina-tests/Dependencies.toml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

[ballerina]
dependencies-toml-version = "2"
distribution-version = "2201.12.0"
distribution-version = "2201.13.1"

[[package]]
org = "ballerina"
Expand Down Expand Up @@ -47,7 +47,7 @@ modules = [
[[package]]
org = "ballerina"
name = "crypto"
version = "2.9.0"
version = "2.10.1"
scope = "testOnly"
dependencies = [
{org = "ballerina", name = "jballerina.java"},
Expand All @@ -57,7 +57,7 @@ dependencies = [
[[package]]
org = "ballerina"
name = "data.jsondata"
version = "1.1.0"
version = "1.1.3"
scope = "testOnly"
dependencies = [
{org = "ballerina", name = "jballerina.java"},
Expand All @@ -82,7 +82,7 @@ modules = [
[[package]]
org = "ballerina"
name = "http"
version = "2.14.0"
version = "2.15.4"
scope = "testOnly"
dependencies = [
{org = "ballerina", name = "auth"},
Expand Down Expand Up @@ -135,7 +135,7 @@ scope = "testOnly"
[[package]]
org = "ballerina"
name = "jwt"
version = "2.15.0"
version = "2.15.1"
scope = "testOnly"
dependencies = [
{org = "ballerina", name = "cache"},
Expand Down Expand Up @@ -220,6 +220,9 @@ scope = "testOnly"
dependencies = [
{org = "ballerina", name = "jballerina.java"}
]
modules = [
{org = "ballerina", packageName = "lang.runtime", moduleName = "lang.runtime"}
]

[[package]]
org = "ballerina"
Expand All @@ -243,7 +246,7 @@ dependencies = [
[[package]]
org = "ballerina"
name = "log"
version = "2.12.0"
version = "2.16.1"
scope = "testOnly"
dependencies = [
{org = "ballerina", name = "io"},
Expand All @@ -258,7 +261,7 @@ modules = [
[[package]]
org = "ballerina"
name = "mime"
version = "2.12.0"
version = "2.12.1"
scope = "testOnly"
dependencies = [
{org = "ballerina", name = "io"},
Expand All @@ -273,7 +276,7 @@ modules = [
[[package]]
org = "ballerina"
name = "oauth2"
version = "2.14.0"
version = "2.15.0"
scope = "testOnly"
dependencies = [
{org = "ballerina", name = "cache"},
Expand All @@ -287,7 +290,7 @@ dependencies = [
[[package]]
org = "ballerina"
name = "observe"
version = "1.5.0"
version = "1.7.1"
scope = "testOnly"
dependencies = [
{org = "ballerina", name = "jballerina.java"}
Expand All @@ -296,7 +299,7 @@ dependencies = [
[[package]]
org = "ballerina"
name = "os"
version = "1.10.0"
version = "1.10.1"
scope = "testOnly"
dependencies = [
{org = "ballerina", name = "io"},
Expand All @@ -309,11 +312,12 @@ modules = [
[[package]]
org = "ballerina"
name = "task"
version = "2.7.0"
version = "2.11.1"
scope = "testOnly"
dependencies = [
{org = "ballerina", name = "jballerina.java"},
{org = "ballerina", name = "time"}
{org = "ballerina", name = "time"},
{org = "ballerina", name = "uuid"}
]

[[package]]
Expand All @@ -333,7 +337,7 @@ modules = [
[[package]]
org = "ballerina"
name = "time"
version = "2.7.0"
version = "2.8.0"
scope = "testOnly"
dependencies = [
{org = "ballerina", name = "jballerina.java"}
Expand All @@ -342,21 +346,34 @@ dependencies = [
[[package]]
org = "ballerina"
name = "url"
version = "2.6.0"
version = "2.6.1"
scope = "testOnly"
dependencies = [
{org = "ballerina", name = "jballerina.java"}
]

[[package]]
org = "ballerina"
name = "uuid"
version = "1.10.0"
scope = "testOnly"
dependencies = [
{org = "ballerina", name = "crypto"},
{org = "ballerina", name = "jballerina.java"},
{org = "ballerina", name = "lang.int"},
{org = "ballerina", name = "time"}
]

[[package]]
org = "ballerinax"
name = "apim_catalog_tests"
version = "1.1.0"
version = "1.2.0"
dependencies = [
{org = "ballerina", name = "constraint"},
{org = "ballerina", name = "file"},
{org = "ballerina", name = "http"},
{org = "ballerina", name = "io"},
{org = "ballerina", name = "lang.runtime"},
{org = "ballerina", name = "log"},
{org = "ballerina", name = "mime"},
{org = "ballerina", name = "os"},
Expand Down
31 changes: 31 additions & 0 deletions ballerina-tests/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,36 @@ task initializeVariables {

def ballerinaPackagePath = "ballerina"

// ---------------------------------------------------------------------------
// Build Docker images for the mock catalog API server and the OAuth2 token
// server. Both images are built from standalone Ballerina programs under
// ballerina-tests/mock-server/ and ballerina-tests/token-server/.
// The images are used by the test suite to spin up one container per port.
// ---------------------------------------------------------------------------

task buildMockServerDockerImage {
doLast {
exec {
workingDir "${project.projectDir}/mock-server"
commandLine 'docker', 'build', '-t', 'ballerinax/apim-catalog-mock-server:latest', '.'
}
}
}

task buildTokenServerDockerImage {
doLast {
exec {
workingDir "${project.projectDir}/token-server"
commandLine 'docker', 'build', '-t', 'ballerinax/apim-catalog-token-server:latest', '.'
}
}
}

task buildDockerImages {
dependsOn(buildMockServerDockerImage)
dependsOn(buildTokenServerDockerImage)
}

task publishTestResourcePackageToLocal {
dependsOn("::${packageName}-ballerina:build")
doLast {
Expand Down Expand Up @@ -121,6 +151,7 @@ task ballerinaTest {
dependsOn(updateTomlVerions)
dependsOn(initializeVariables)
dependsOn(publishTestResourcePackageToLocal)
dependsOn(buildDockerImages)
finalizedBy(commitTomlFiles)

doLast {
Expand Down
5 changes: 5 additions & 0 deletions ballerina-tests/mock-server/Ballerina.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
[package]
org = "ballerinax"
name = "apim_catalog_mock_server"
version = "1.0.0"
distribution = "2201.13.1"
Loading