Skip to content

Commit bab349a

Browse files
Merge pull request #18 from BorderTech/feature/fix-build
Switch to github actions
2 parents 26c4b24 + 599362d commit bab349a

7 files changed

Lines changed: 63 additions & 52 deletions

File tree

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
name: Java CI
2+
3+
# Trigger workflow on push or pull_request
4+
# Note - the first pull_request from a forked repo will need to be given approval to run
5+
on: [push, pull_request]
6+
7+
jobs:
8+
build:
9+
runs-on: ubuntu-latest
10+
11+
steps:
12+
- uses: actions/checkout@v2
13+
14+
- name: Set up JDK 8
15+
uses: actions/setup-java@v2
16+
with:
17+
java-version: '8'
18+
distribution: 'adopt'
19+
20+
- name: Cache Maven Repo
21+
uses: actions/cache@v4
22+
with:
23+
path: ~/.m2
24+
key: ${{ runner.os }}-m2-${{ hashFiles('**/pom.xml') }}
25+
restore-keys: ${{ runner.os }}-m2
26+
27+
- name: Build Test and Verify
28+
run: mvn -B -U clean install
29+
30+
- name: Set up JDK 17
31+
uses: actions/setup-java@v2
32+
with:
33+
java-version: '17'
34+
distribution: 'adopt'
35+
36+
- name: SonarCloud Scan
37+
run: |
38+
if ["$SONAR_TOKEN" == ""]; then
39+
echo "Sonar secure variables NOT available"
40+
else
41+
echo "Sonar secure variables ARE available"
42+
mvn -B sonar:sonar -Dsonar.projectKey="bordertech-sample-app" -Dsonar.organization="bordertech-github" -Dsonar.host.url="https://sonarcloud.io"
43+
fi
44+
env:
45+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
46+
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}

.travis.yml

Lines changed: 0 additions & 30 deletions
This file was deleted.

README.md

Lines changed: 2 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ Sample application demonstrates how a project can be structured with RESTful ser
55
This project can be cloned as a template.
66

77
## Status
8-
[![Build Status](https://travis-ci.com/BorderTech/sample-app.svg?branch=master)](https://travis-ci.com/BorderTech/sample-app)
8+
[![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)
99
[![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)
1010
[![Reliability Rating](https://sonarcloud.io/api/project_badges/measure?project=bordertech-sample-app&metric=reliability_rating)](https://sonarcloud.io/dashboard?id=bordertech-sample-app)
1111
[![Coverage](https://sonarcloud.io/api/project_badges/measure?project=bordertech-sample-app&metric=coverage)](https://sonarcloud.io/dashboard?id=bordertech-sample-app)
@@ -19,18 +19,7 @@ Follow these commands to fetch the source and build:
1919

2020
1. git clone https://github.com/BorderTech/sample-app.git my-dir (first time only)
2121
2. cd my-dir
22-
23-
#### Quick build
24-
25-
Quick build profile has QA and Tests turned off
26-
27-
3. ```mvn install -Pquick-build```
28-
29-
#### Full build
30-
31-
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.
32-
33-
4. ```mvn install -Dwebdriver.chrome.driver=/path/to/chromedriver.exe```
22+
3. mvn clean install -Pquick-build (The profile quick-build has QA and Tests turned off)
3423

3524
<a name="restservice"></a>
3625
### Run REST Service

pom.xml

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,20 +5,17 @@
55
<parent>
66
<groupId>com.github.bordertech.common</groupId>
77
<artifactId>qa-parent</artifactId>
8-
<version>1.0.16</version>
8+
<version>1.0.21</version>
99
</parent>
1010

1111
<packaging>pom</packaging>
1212

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

2421
<name>sample-app-parent</name>

web-ui/pom.xml

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,13 @@
9090
<dependency>
9191
<groupId>com.github.bordertech.webfriends</groupId>
9292
<artifactId>webfriends-selenium-wc</artifactId>
93-
<version>0.0.4</version>
93+
<version>0.0.6</version>
94+
<scope>test</scope>
95+
</dependency>
96+
<dependency>
97+
<groupId>com.github.bordertech.webfriends</groupId>
98+
<artifactId>webfriends-selenium-junit</artifactId>
99+
<version>0.0.6</version>
94100
<scope>test</scope>
95101
</dependency>
96102

@@ -105,7 +111,7 @@
105111
<dependency>
106112
<groupId>com.google.guava</groupId>
107113
<artifactId>guava</artifactId>
108-
<version>27.1-jre</version>
114+
<version>33.5.0-jre</version>
109115
<scope>test</scope>
110116
</dependency>
111117

web-ui/src/test/java/com/sample/app/ui/test/SampleUiTest.java

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,11 @@
11
package com.sample.app.ui.test;
22

3+
import com.github.bordertech.webfriends.junit.runner.AbstractFriendTestCase;
34
import com.github.bordertech.webfriends.selenium.common.tag.SeleniumTags;
45
import com.github.bordertech.webfriends.selenium.element.form.SButton;
56
import com.github.bordertech.webfriends.selenium.element.sections.SHeading1;
67
import com.github.bordertech.webfriends.selenium.element.table.STable;
7-
import com.github.bordertech.webfriends.selenium.smart.junit.SmartDriverTestCase;
8+
import com.github.bordertech.webfriends.selenium.smart.driver.SmartDriver;
89
import com.sample.app.test.Smoke;
910
import com.sample.app.test.Unit;
1011
import org.junit.Assert;
@@ -15,7 +16,7 @@
1516
* Sample UI Unit tests.
1617
*/
1718
@Category({Unit.class, Smoke.class})
18-
public class SampleUiTest extends SmartDriverTestCase {
19+
public class SampleUiTest extends AbstractFriendTestCase<SmartDriver> {
1920
// ## SMOKE Properties
2021
// ##bordertech.webfriends.selenium.launchServer=false
2122
// ##bordertech.webfriends.selenium.serverUrl=http://localhost:8081/lde

web-ui/src/test/resources/bordertech-app.properties

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,3 +17,5 @@ bordertech.factory.impl.com.github.bordertech.webfriends.selenium.util.driver.Pa
1717
## SMOKE Properties
1818
##bordertech.webfriends.selenium.launchServer=false
1919
##bordertech.webfriends.selenium.serverUrl=http://localhost:8081/lde
20+
21+
##bordertech.webfriends.selenium.driver.runner=firefox

0 commit comments

Comments
 (0)