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
46 changes: 46 additions & 0 deletions .github/workflows/github-actions-build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
name: Java CI

# Trigger workflow on push or pull_request
# Note - the first pull_request from a forked repo will need to be given approval to run
on: [push, pull_request]

jobs:
build:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2

- name: Set up JDK 8
uses: actions/setup-java@v2
with:
java-version: '8'
distribution: 'adopt'

- name: Cache Maven Repo
uses: actions/cache@v4
with:
path: ~/.m2
key: ${{ runner.os }}-m2-${{ hashFiles('**/pom.xml') }}
restore-keys: ${{ runner.os }}-m2

- name: Build Test and Verify
run: mvn -B -U clean install

- name: Set up JDK 17
uses: actions/setup-java@v2
with:
java-version: '17'
distribution: 'adopt'

- name: SonarCloud Scan
run: |
if ["$SONAR_TOKEN" == ""]; then
echo "Sonar secure variables NOT available"
else
echo "Sonar secure variables ARE available"
mvn -B sonar:sonar -Dsonar.projectKey="bordertech-sample-app" -Dsonar.organization="bordertech-github" -Dsonar.host.url="https://sonarcloud.io"
fi
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
30 changes: 0 additions & 30 deletions .travis.yml

This file was deleted.

15 changes: 2 additions & 13 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ Sample application demonstrates how a project can be structured with RESTful ser
This project can be cloned as a template.

## Status
[![Build Status](https://travis-ci.com/BorderTech/sample-app.svg?branch=master)](https://travis-ci.com/BorderTech/sample-app)
[![Java CI](https://github.com/BorderTech/sample-app/actions/workflows/github-actions-build.yml/badge.svg)](https://github.com/BorderTech/sample-app/actions/workflows/github-actions-build.yml)
[![Quality Gate Status](https://sonarcloud.io/api/project_badges/measure?project=bordertech-sample-app&metric=alert_status)](https://sonarcloud.io/dashboard?id=bordertech-sample-app)
[![Reliability Rating](https://sonarcloud.io/api/project_badges/measure?project=bordertech-sample-app&metric=reliability_rating)](https://sonarcloud.io/dashboard?id=bordertech-sample-app)
[![Coverage](https://sonarcloud.io/api/project_badges/measure?project=bordertech-sample-app&metric=coverage)](https://sonarcloud.io/dashboard?id=bordertech-sample-app)
Expand All @@ -19,18 +19,7 @@ Follow these commands to fetch the source and build:

1. git clone https://github.com/BorderTech/sample-app.git my-dir (first time only)
2. cd my-dir

#### Quick build

Quick build profile has QA and Tests turned off

3. ```mvn install -Pquick-build```

#### Full build

On windows make sure chromedriver is in PATH, on *NIX in current user profile. Otherwise provide system property `-Dwebdriver.chrome.driver`. See [ChromeDriver](https://github.com/SeleniumHQ/selenium/wiki/ChromeDriver) for more information.

4. ```mvn install -Dwebdriver.chrome.driver=/path/to/chromedriver.exe```
3. mvn clean install -Pquick-build (The profile quick-build has QA and Tests turned off)

<a name="restservice"></a>
### Run REST Service
Expand Down
7 changes: 2 additions & 5 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,20 +5,17 @@
<parent>
<groupId>com.github.bordertech.common</groupId>
<artifactId>qa-parent</artifactId>
<version>1.0.16</version>
<version>1.0.21</version>
</parent>

<packaging>pom</packaging>

<properties>
<bt.qa.skip>false</bt.qa.skip>
<!-- Report Vulnerabilities. -->
<failBuildOnCVSS>11</failBuildOnCVSS>
<!-- Update every 168 hours (7 days) -->
<cveValidForHours>168</cveValidForHours>
<!-- warName defaults to maven's generated name, with option to modify it -->
<app.warName>${project.build.finalName}</app.warName>
<web.warName>${project.build.finalName}</web.warName>
<dependency-check.skip>true</dependency-check.skip>
</properties>

<name>sample-app-parent</name>
Expand Down
10 changes: 8 additions & 2 deletions web-ui/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,13 @@
<dependency>
<groupId>com.github.bordertech.webfriends</groupId>
<artifactId>webfriends-selenium-wc</artifactId>
<version>0.0.4</version>
<version>0.0.6</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>com.github.bordertech.webfriends</groupId>
<artifactId>webfriends-selenium-junit</artifactId>
<version>0.0.6</version>
<scope>test</scope>
</dependency>

Expand All @@ -105,7 +111,7 @@
<dependency>
<groupId>com.google.guava</groupId>
<artifactId>guava</artifactId>
<version>27.1-jre</version>
<version>33.5.0-jre</version>
<scope>test</scope>
</dependency>

Expand Down
5 changes: 3 additions & 2 deletions web-ui/src/test/java/com/sample/app/ui/test/SampleUiTest.java
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
package com.sample.app.ui.test;

import com.github.bordertech.webfriends.junit.runner.AbstractFriendTestCase;
import com.github.bordertech.webfriends.selenium.common.tag.SeleniumTags;
import com.github.bordertech.webfriends.selenium.element.form.SButton;
import com.github.bordertech.webfriends.selenium.element.sections.SHeading1;
import com.github.bordertech.webfriends.selenium.element.table.STable;
import com.github.bordertech.webfriends.selenium.smart.junit.SmartDriverTestCase;
import com.github.bordertech.webfriends.selenium.smart.driver.SmartDriver;
import com.sample.app.test.Smoke;
import com.sample.app.test.Unit;
import org.junit.Assert;
Expand All @@ -15,7 +16,7 @@
* Sample UI Unit tests.
*/
@Category({Unit.class, Smoke.class})
public class SampleUiTest extends SmartDriverTestCase {
public class SampleUiTest extends AbstractFriendTestCase<SmartDriver> {
// ## SMOKE Properties
// ##bordertech.webfriends.selenium.launchServer=false
// ##bordertech.webfriends.selenium.serverUrl=http://localhost:8081/lde
Expand Down
2 changes: 2 additions & 0 deletions web-ui/src/test/resources/bordertech-app.properties
Original file line number Diff line number Diff line change
Expand Up @@ -17,3 +17,5 @@ bordertech.factory.impl.com.github.bordertech.webfriends.selenium.util.driver.Pa
## SMOKE Properties
##bordertech.webfriends.selenium.launchServer=false
##bordertech.webfriends.selenium.serverUrl=http://localhost:8081/lde

##bordertech.webfriends.selenium.driver.runner=firefox