Skip to content

Commit

Permalink
Merge pull request #1 from DharshiBalasubramaniyam/templete
Browse files Browse the repository at this point in the history
Add Library templete
  • Loading branch information
NipunaRanasinghe authored Dec 3, 2024
2 parents 03ca308 + d05f032 commit 62df2df
Show file tree
Hide file tree
Showing 32 changed files with 1,313 additions and 7 deletions.
12 changes: 12 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
#
# https://help.github.com/articles/dealing-with-line-endings/
#
# Linux start script should use lf
/gradlew text eol=lf

# These are Windows script files and should use crlf
*.bat text eol=crlf

# Binary files should be left untouched
*.jar binary

7 changes: 7 additions & 0 deletions .github/CODEOWNERS
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# Lines starting with '#' are comments.
# Each line is a file pattern followed by one or more owners.

# See: https://help.github.com/articles/about-codeowners/

# TODO: Add code owners
# These owners will be the default owners for everything in the repo.
10 changes: 10 additions & 0 deletions .github/pull_request_template.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
## Purpose

## Examples

## Checklist
- [ ] Linked to an issue
- [ ] Updated the changelog
- [ ] Added tests
- [ ] Updated the spec
- [ ] Checked native-image compatibility
18 changes: 18 additions & 0 deletions .github/worflows/build-with-bal-test-graalvm.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
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-library/.github/workflows/build-with-bal-test-graalvm-connector-template.yml@main
secrets: inherit

19 changes: 19 additions & 0 deletions .github/worflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
name: Build

on:
push:
branches:
- main
- 2201.[0-9]+.x
repository_dispatch:
types: check_connector_for_breaking_changes

jobs:
call_workflow:
name: Run Connector Build Workflow
if: ${{ github.repository_owner == 'ballerina-platform' }}
uses: ballerina-platform/ballerina-library/.github/workflows/build-connector-template.yml@main
secrets: inherit
with:
repo-name: module-selenium

15 changes: 15 additions & 0 deletions .github/worflows/daily-build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
name: Daily build

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

jobs:
call_workflow:
name: Run Daily Build Workflow
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-selenium

22 changes: 22 additions & 0 deletions .github/worflows/dev-stg-release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
name: Publish to the Ballerina Dev\Stage Central

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

jobs:
call_workflow:
name: Run Dev\Stage Central Publish Workflow
if: ${{ github.repository_owner == 'ballerina-platform' }}
uses: ballerina-platform/ballerina-library/.github/workflows/dev-stage-central-publish-connector-template.yml@main
secrets: inherit
with:
environment: ${{ github.event.inputs.environment }}

17 changes: 17 additions & 0 deletions .github/worflows/pull-request.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
name: PR Build

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

on: pull_request

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
secrets: inherit
with:
additional-test-flags: ${{ github.event.pull_request.head.repo.full_name != github.repository && '-x test' || ''}}

17 changes: 17 additions & 0 deletions .github/worflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
name: Publish Release

on:
workflow_dispatch:
repository_dispatch:
types: [ stdlib-release-pipeline ]

jobs:
call_workflow:
name: Run Release Workflow
if: ${{ github.repository_owner == 'ballerina-platform' }}
uses: ballerina-platform/ballerina-library/.github/workflows/release-package-connector-template.yml@main
secrets: inherit
with:
package-name: selenium
package-org: xlibb

14 changes: 14 additions & 0 deletions .github/worflows/trivy-scan.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
name: Trivy

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

jobs:
call_workflow:
name: Run Trivy Scan Workflow
if: ${{ github.repository_owner == 'ballerina-platform' }}
uses: ballerina-platform/ballerina-library/.github/workflows/trivy-scan-template.yml@main
secrets: inherit

52 changes: 45 additions & 7 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,11 +1,49 @@
# generated files
# Mobile Tools for Java (J2ME)
.mtj.tmp/

# .DS_Store files
*.DS_Store

# Package Files
*.jar
!gradle/wrapper/gradle-wrapper.jar
*.war
*.ear
*.zip
*.tar.gz
*.rar
*.deb

# virtual machine crash logs, see http://www.java.com/en/download/help/error_hotspot.xml
hs_err_pid*

# Ignore everything in this directory
target
.classpath
.settings
.project
*.iml
*.iws
*.ipr
.idea
.m2
.vscode/

# Ignore ballerina files
accessToken.bal
temp.bal.ballerina/
target/
generated/
.DS_Store
*Ballerina.lock
.ballerina
**/Config.toml

# Ignore Gradle project-specific cache directory
.gradle

# dependencies
Dependencies.toml
# Ignore Gradle build output directory
build

# config files
Config.toml
# the config files used for testing, Uncomment the following line if you want to commit the test config files
#!**/tests/Config.toml
# Ignore Docker env file
**/docker.env
108 changes: 108 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,2 +1,110 @@
# module-selenium
This repository contains the source code of the Ballerina Selenium library package

[![Build](https://github.com/xlibb/module-selenium/actions/workflows/ci.yml/badge.svg)](https://github.com/xlibb/module-selenium/actions/workflows/ci.yml)
[![Trivy](https://github.com/xlibb/module-selenium/actions/workflows/trivy-scan.yml/badge.svg)](https://github.com/xlibb/module-selenium/actions/workflows/trivy-scan.yml)
[![GraalVM Check](https://github.com/xlibb/module-selenium/actions/workflows/build-with-bal-test-graalvm.yml/badge.svg)](https://github.com/xlibb/module-selenium/actions/workflows/build-with-bal-test-graalvm.yml)
[![GitHub Last Commit](https://img.shields.io/github/last-commit/xlibb/module-selenium.svg)](https://github.com/xlibb/module-selenium/commits/master)
[![GitHub Issues](https://img.shields.io/github/issues/ballerina-platform/ballerina-library/module/selenium.svg?label=Open%20Issues)](https://github.com/ballerina-platform/ballerina-library/labels/module%selenium)

## Overview

[//]: # (TODO: Add overview mentioning the purpose of the module, supported REST API versions, and other high-level details.)

## Setup guide

[//]: # (TODO: Add detailed steps to obtain credentials and configure the module.)

## Quickstart

[//]: # (TODO: Add a quickstart guide to demonstrate a basic functionality of the module, including sample code snippets.)

## Examples

The `Selenium` connector provides practical examples illustrating usage in various scenarios. Explore these [examples](https://github.com/xlibb/module-selenium/tree/main/examples/), covering the following use cases:

[//]: # (TODO: Add examples)

## Build from the source

### Setting up the prerequisites

1. Download and install Java SE Development Kit (JDK) version 17. You can download it from either of the following sources:

* [Oracle JDK](https://www.oracle.com/java/technologies/downloads/)
* [OpenJDK](https://adoptium.net/)

> **Note:** After installation, remember to set the `JAVA_HOME` environment variable to the directory where JDK was installed.
2. Download and install [Ballerina Swan Lake](https://ballerina.io/).

3. Download and install [Docker](https://www.docker.com/get-started).

> **Note**: Ensure that the Docker daemon is running before executing any tests.
4. Export Github Personal access token with read package permissions as follows,

```bash
export packageUser=<Username>
export packagePAT=<Personal access token>
```

### Build options

Execute the commands below to build from the source.

1. To build the package:

```bash
./gradlew clean build
```

2. To run the tests:

```bash
./gradlew clean test
```

3. To build the without the tests:

```bash
./gradlew clean build -x test
```

4. To run tests against different environments:

```bash
./gradlew clean test -Pgroups=<Comma separated groups/test cases>
```

5. To debug the package with a remote debugger:

```bash
./gradlew clean build -Pdebug=<port>
```

6. To debug with the Ballerina language:

```bash
./gradlew clean build -PbalJavaDebug=<port>
```

7. Publish the generated artifacts to the local Ballerina Central repository:

```bash
./gradlew clean build -PpublishToLocalCentral=true
```

8. Publish the generated artifacts to the Ballerina Central repository:

```bash
./gradlew clean build -PpublishToCentral=true
```

## Contribute to Ballerina

As an open-source project, Ballerina welcomes contributions from the community.

For more information, go to the [contribution guidelines](https://github.com/ballerina-platform/ballerina-lang/blob/master/CONTRIBUTING.md).

## Code of conduct

All the contributors are encouraged to read the [Ballerina Code of Conduct](https://ballerina.io/code-of-conduct).
16 changes: 16 additions & 0 deletions ballerina/Ballerina.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
[package]
distribution = "2201.10.0"
org = "xlibb"
name = "selenium"
version = "0.1.0"
license = ["Apache-2.0"]
authors = ["Ballerina"]
keywords = [] # TODO: Add keywords
# icon = "icon.png" # TODO: Add icon
repository = "https://github.com/xlibb/module-selenium"

[build-options]
observabilityIncluded = true

[platform.java17]
graalvmCompatible = true
Loading

0 comments on commit 62df2df

Please sign in to comment.