From 115f90f6e5e757831e366c5af5c18cca09b43421 Mon Sep 17 00:00:00 2001 From: Jonathan Austin Date: Mon, 14 Jun 2021 13:12:13 +1000 Subject: [PATCH 01/11] Add Github Actions Config --- .github/workflows/github-actions-build.yml | 36 ++++++++++++++++++++++ 1 file changed, 36 insertions(+) create mode 100644 .github/workflows/github-actions-build.yml diff --git a/.github/workflows/github-actions-build.yml b/.github/workflows/github-actions-build.yml new file mode 100644 index 000000000..d07d4e3ce --- /dev/null +++ b/.github/workflows/github-actions-build.yml @@ -0,0 +1,36 @@ +name: Java CI + +on: [push] + +jobs: + build: + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v2 + + - name: Set up JDK 11 + uses: actions/setup-java@v2 + with: + java-version: '11' + distribution: 'adopt' + + - name: Cache Maven packages + uses: actions/cache@v2 + with: + path: ~/.m2 + key: ${{ runner.os }}-m2-${{ hashFiles('**/pom.xml') }} + restore-keys: ${{ runner.os }}-m2 + + - name: Build with Maven + run: mvn --settings ci-settings.xml clean install -Dmaven.javadoc.skip=true -B -V -Dpmd.verbose=false + + - name: SonarCloud Scan + uses: sonarsource/sonarcloud-github-action@master + with: + args: > + -Dsonar.organization=bordertech-github + -Dsonar.projectKey=bordertech-wcomponents + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} From dfd268ea4622525d9d8dc64343f6ba92ae29f49b Mon Sep 17 00:00:00 2001 From: Jonathan Austin Date: Mon, 14 Jun 2021 13:48:50 +1000 Subject: [PATCH 02/11] Update Github Actions to Headless Firefox --- .github/workflows/github-actions-build.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/workflows/github-actions-build.yml b/.github/workflows/github-actions-build.yml index d07d4e3ce..4f8ce9dc2 100644 --- a/.github/workflows/github-actions-build.yml +++ b/.github/workflows/github-actions-build.yml @@ -23,7 +23,9 @@ jobs: restore-keys: ${{ runner.os }}-m2 - name: Build with Maven - run: mvn --settings ci-settings.xml clean install -Dmaven.javadoc.skip=true -B -V -Dpmd.verbose=false + env: + MOZ_HEADLESS=1 + run: mvn --settings ci-settings.xml clean install -Dmaven.javadoc.skip=true -B -V -Dpmd.verbose=false -PskipCoreOptionalTests - name: SonarCloud Scan uses: sonarsource/sonarcloud-github-action@master From dcfc4fcd37f9f282670b59c90d80c954bb3ba220 Mon Sep 17 00:00:00 2001 From: Jonathan Austin Date: Mon, 14 Jun 2021 13:53:06 +1000 Subject: [PATCH 03/11] Fix github actions syntax --- .github/workflows/github-actions-build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/github-actions-build.yml b/.github/workflows/github-actions-build.yml index 4f8ce9dc2..f77e4580e 100644 --- a/.github/workflows/github-actions-build.yml +++ b/.github/workflows/github-actions-build.yml @@ -24,7 +24,7 @@ jobs: - name: Build with Maven env: - MOZ_HEADLESS=1 + MOZ_HEADLESS: 1 run: mvn --settings ci-settings.xml clean install -Dmaven.javadoc.skip=true -B -V -Dpmd.verbose=false -PskipCoreOptionalTests - name: SonarCloud Scan From 2d3750387db3099b81f78c29d8621ecab35da524 Mon Sep 17 00:00:00 2001 From: Jonathan Austin Date: Mon, 14 Jun 2021 14:21:55 +1000 Subject: [PATCH 04/11] Github Actions switch to maven sonar:sonar --- .github/workflows/github-actions-build.yml | 13 ++++--------- 1 file changed, 4 insertions(+), 9 deletions(-) diff --git a/.github/workflows/github-actions-build.yml b/.github/workflows/github-actions-build.yml index f77e4580e..3580581d8 100644 --- a/.github/workflows/github-actions-build.yml +++ b/.github/workflows/github-actions-build.yml @@ -23,16 +23,11 @@ jobs: restore-keys: ${{ runner.os }}-m2 - name: Build with Maven - env: - MOZ_HEADLESS: 1 - run: mvn --settings ci-settings.xml clean install -Dmaven.javadoc.skip=true -B -V -Dpmd.verbose=false -PskipCoreOptionalTests + run: mvn -B --settings ci-settings.xml clean install -DskipTests=true -Dmaven.javadoc.skip=true -Dpmd.verbose=false -DskipOptionalQA=true - - name: SonarCloud Scan - uses: sonarsource/sonarcloud-github-action@master - with: - args: > - -Dsonar.organization=bordertech-github - -Dsonar.projectKey=bordertech-wcomponents + - name: SonarCloud Scan with Tests + run: mvn -B --settings ci-settings.xml sonar:sonar -Dsonar.projectKey="bordertech-wcomponents" -Dsonar.organization="bordertech-github" -PskipCoreOptionalTests env: + MOZ_HEADLESS: 1 GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} From eff932c6ba67da00d2c6268b5584aed29a1ee053 Mon Sep 17 00:00:00 2001 From: Jonathan Austin Date: Mon, 14 Jun 2021 14:34:02 +1000 Subject: [PATCH 05/11] Add sonarcloud host URL --- .github/workflows/github-actions-build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/github-actions-build.yml b/.github/workflows/github-actions-build.yml index 3580581d8..ca307b9b8 100644 --- a/.github/workflows/github-actions-build.yml +++ b/.github/workflows/github-actions-build.yml @@ -26,7 +26,7 @@ jobs: run: mvn -B --settings ci-settings.xml clean install -DskipTests=true -Dmaven.javadoc.skip=true -Dpmd.verbose=false -DskipOptionalQA=true - name: SonarCloud Scan with Tests - run: mvn -B --settings ci-settings.xml sonar:sonar -Dsonar.projectKey="bordertech-wcomponents" -Dsonar.organization="bordertech-github" -PskipCoreOptionalTests + run: mvn -B --settings ci-settings.xml sonar:sonar -Dsonar.projectKey="bordertech-wcomponents" -Dsonar.organization="bordertech-github" -Dsonar.host.url="https://sonarcloud.io" -PskipCoreOptionalTests env: MOZ_HEADLESS: 1 GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} From 562f580bd46458f3e329040cc5915a3ed7fadbc3 Mon Sep 17 00:00:00 2001 From: Jonathan Austin Date: Mon, 14 Jun 2021 15:01:21 +1000 Subject: [PATCH 06/11] sonar:sonar code coverage with package phase --- .github/workflows/github-actions-build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/github-actions-build.yml b/.github/workflows/github-actions-build.yml index ca307b9b8..a3ffd844a 100644 --- a/.github/workflows/github-actions-build.yml +++ b/.github/workflows/github-actions-build.yml @@ -26,7 +26,7 @@ jobs: run: mvn -B --settings ci-settings.xml clean install -DskipTests=true -Dmaven.javadoc.skip=true -Dpmd.verbose=false -DskipOptionalQA=true - name: SonarCloud Scan with Tests - run: mvn -B --settings ci-settings.xml sonar:sonar -Dsonar.projectKey="bordertech-wcomponents" -Dsonar.organization="bordertech-github" -Dsonar.host.url="https://sonarcloud.io" -PskipCoreOptionalTests + run: mvn -B --settings ci-settings.xml package sonar:sonar -Dsonar.projectKey="bordertech-wcomponents" -Dsonar.organization="bordertech-github" -Dsonar.host.url="https://sonarcloud.io" -PskipCoreOptionalTests env: MOZ_HEADLESS: 1 GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} From cf2228379e0b31932a18244b0d7962ec02239fb2 Mon Sep 17 00:00:00 2001 From: Jonathan Austin Date: Mon, 14 Jun 2021 16:34:31 +1000 Subject: [PATCH 07/11] Check for SONAR_TOKEN --- .github/workflows/github-actions-build.yml | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/.github/workflows/github-actions-build.yml b/.github/workflows/github-actions-build.yml index a3ffd844a..aa632462e 100644 --- a/.github/workflows/github-actions-build.yml +++ b/.github/workflows/github-actions-build.yml @@ -1,6 +1,8 @@ name: Java CI -on: [push] +# 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: @@ -26,7 +28,14 @@ jobs: run: mvn -B --settings ci-settings.xml clean install -DskipTests=true -Dmaven.javadoc.skip=true -Dpmd.verbose=false -DskipOptionalQA=true - name: SonarCloud Scan with Tests - run: mvn -B --settings ci-settings.xml package sonar:sonar -Dsonar.projectKey="bordertech-wcomponents" -Dsonar.organization="bordertech-github" -Dsonar.host.url="https://sonarcloud.io" -PskipCoreOptionalTests + run: | + if ["$SONAR_TOKEN"] == ""; then + echo "Sonar secure variables NOT available" + mvn -B --settings ci-settings.xml package -PskipCoreOptionalTests + else + echo "Sonar secure variables ARE available" + mvn -B --settings ci-settings.xml package -PskipCoreOptionalTests sonar:sonar -Dsonar.projectKey="bordertech-wcomponents" -Dsonar.organization="bordertech-github" -Dsonar.host.url="https://sonarcloud.io" + fi env: MOZ_HEADLESS: 1 GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} From 2cb6da46f6d4ff9b56332cd172c8687e01641148 Mon Sep 17 00:00:00 2001 From: Jonathan Austin Date: Mon, 14 Jun 2021 16:55:48 +1000 Subject: [PATCH 08/11] Run Tests on Build step --- .github/workflows/github-actions-build.yml | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/.github/workflows/github-actions-build.yml b/.github/workflows/github-actions-build.yml index aa632462e..9ba90c56d 100644 --- a/.github/workflows/github-actions-build.yml +++ b/.github/workflows/github-actions-build.yml @@ -24,19 +24,19 @@ jobs: key: ${{ runner.os }}-m2-${{ hashFiles('**/pom.xml') }} restore-keys: ${{ runner.os }}-m2 - - name: Build with Maven - run: mvn -B --settings ci-settings.xml clean install -DskipTests=true -Dmaven.javadoc.skip=true -Dpmd.verbose=false -DskipOptionalQA=true + - name: Build and Tests + run: mvn -B --settings ci-settings.xml clean install -Dmaven.javadoc.skip=true -Dpmd.verbose=false -DskipOptionalQA=true -PskipCoreOptionalTests + env: + MOZ_HEADLESS: 1 - - name: SonarCloud Scan with Tests + - name: SonarCloud Scan run: | if ["$SONAR_TOKEN"] == ""; then echo "Sonar secure variables NOT available" - mvn -B --settings ci-settings.xml package -PskipCoreOptionalTests else echo "Sonar secure variables ARE available" - mvn -B --settings ci-settings.xml package -PskipCoreOptionalTests sonar:sonar -Dsonar.projectKey="bordertech-wcomponents" -Dsonar.organization="bordertech-github" -Dsonar.host.url="https://sonarcloud.io" + mvn -B sonar:sonar -Dsonar.projectKey="bordertech-wcomponents" -Dsonar.organization="bordertech-github" -Dsonar.host.url="https://sonarcloud.io" fi env: - MOZ_HEADLESS: 1 GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} From 10dbabfa01b8fae58f869f48c47cd1ee7c8f1c0c Mon Sep 17 00:00:00 2001 From: Jonathan Austin Date: Mon, 14 Jun 2021 18:11:09 +1000 Subject: [PATCH 09/11] Update snapshots and use verify instead of install --- .github/workflows/github-actions-build.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/github-actions-build.yml b/.github/workflows/github-actions-build.yml index 9ba90c56d..42f61fd3a 100644 --- a/.github/workflows/github-actions-build.yml +++ b/.github/workflows/github-actions-build.yml @@ -24,8 +24,8 @@ jobs: key: ${{ runner.os }}-m2-${{ hashFiles('**/pom.xml') }} restore-keys: ${{ runner.os }}-m2 - - name: Build and Tests - run: mvn -B --settings ci-settings.xml clean install -Dmaven.javadoc.skip=true -Dpmd.verbose=false -DskipOptionalQA=true -PskipCoreOptionalTests + - name: Build Test and Verify + run: mvn -B -U --settings ci-settings.xml clean verify -Dmaven.javadoc.skip=true -Dpmd.verbose=false -DskipOptionalQA=true -PskipCoreOptionalTests env: MOZ_HEADLESS: 1 From 095abec520559f947ddef9437401e55543722325 Mon Sep 17 00:00:00 2001 From: Jonathan Austin Date: Tue, 15 Jun 2021 10:02:29 +1000 Subject: [PATCH 10/11] Remove Travis config and add workflow badge --- .travis.yml | 30 ------------------------------ README.md | 2 +- travis.sh | 11 ----------- 3 files changed, 1 insertion(+), 42 deletions(-) delete mode 100755 .travis.yml delete mode 100755 travis.sh diff --git a/.travis.yml b/.travis.yml deleted file mode 100755 index e5ddaaf0a..000000000 --- a/.travis.yml +++ /dev/null @@ -1,30 +0,0 @@ -dist: focal - -env: - global: - - MOZ_HEADLESS=1 - -cache: - directories: - - $HOME/.m2 - -addons: - firefox: latest - sonarcloud: - organization: "bordertech-github" - token: $SONAR_TOKEN - -before_install: -- echo "MAVEN_OPTS='-Xmx512m -XX:MaxPermSize=128m'" > ~/.mavenrc -- mvn clean - -language: java -jdk: - - oraclejdk11 - -## Travis installs the project with the following maven command:- "mvn install -DskipTests=true -Dmaven.javadoc.skip=true -B -V" -install: - - mvn --settings ci-settings.xml install -DskipTests=true -Dmaven.javadoc.skip=true -B -V -DskipOptionalQA=true -Dpmd.verbose=false - -script: - - ./travis.sh diff --git a/README.md b/README.md index 2413ae7c9..5c472462a 100755 --- a/README.md +++ b/README.md @@ -10,7 +10,7 @@ Its goal is to enable Java developers to build AJAX enabled, WCAG 2.0 compliant ## Status -[![Build Status](https://travis-ci.com/BorderTech/wcomponents.svg?branch=georgie)](https://travis-ci.com/BorderTech/wcomponents) +[![Build Status](https://github.com/BorderTech/wcomponents/actions/workflows/github-actions-build.yml/badge.svg)](https://github.com/BorderTech/wcomponents/actions/workflows/github-actions-build.yml) [![Quality Gate Status](https://sonarcloud.io/api/project_badges/measure?project=bordertech-wcomponents&metric=alert_status)](https://sonarcloud.io/dashboard?id=bordertech-wcomponents) [![Reliability Rating](https://sonarcloud.io/api/project_badges/measure?project=bordertech-wcomponents&metric=reliability_rating)](https://sonarcloud.io/dashboard?id=bordertech-wcomponents) [![Coverage](https://sonarcloud.io/api/project_badges/measure?project=bordertech-wcomponents&metric=coverage)](https://sonarcloud.io/dashboard?id=bordertech-wcomponents) diff --git a/travis.sh b/travis.sh deleted file mode 100755 index cef4faf35..000000000 --- a/travis.sh +++ /dev/null @@ -1,11 +0,0 @@ -#!/bin/bash - -## Activate skipThemeOptionalTests until Intern and Saucelabs integration fixed - -if [[ -n ${TRAVIS_SECURE_ENV_VARS+x} && ${TRAVIS_SECURE_ENV_VARS} == true && ! -z ${SONAR_TOKEN} ]]; then - echo "Travis secure variables ARE available" - mvn --settings ci-settings.xml --batch-mode package sonar:sonar -Dsonar.projectKey="bordertech-wcomponents" -PskipCoreOptionalTests -else - echo "Travis secure variables not available" - mvn --settings ci-settings.xml --batch-mode package -PskipCoreOptionalTests -fi From 705e4560d782f4f2bfff661463821a39087c7eb9 Mon Sep 17 00:00:00 2001 From: Jonathan Austin Date: Tue, 15 Jun 2021 12:03:30 +1000 Subject: [PATCH 11/11] Remove ci-settings for old webdrivermanager dependency --- .github/workflows/github-actions-build.yml | 4 +-- ci-settings.xml | 34 ---------------------- 2 files changed, 2 insertions(+), 36 deletions(-) delete mode 100644 ci-settings.xml diff --git a/.github/workflows/github-actions-build.yml b/.github/workflows/github-actions-build.yml index 42f61fd3a..5af9290b5 100644 --- a/.github/workflows/github-actions-build.yml +++ b/.github/workflows/github-actions-build.yml @@ -17,7 +17,7 @@ jobs: java-version: '11' distribution: 'adopt' - - name: Cache Maven packages + - name: Cache Maven Repo uses: actions/cache@v2 with: path: ~/.m2 @@ -25,7 +25,7 @@ jobs: restore-keys: ${{ runner.os }}-m2 - name: Build Test and Verify - run: mvn -B -U --settings ci-settings.xml clean verify -Dmaven.javadoc.skip=true -Dpmd.verbose=false -DskipOptionalQA=true -PskipCoreOptionalTests + run: mvn -B -U clean verify -Dmaven.javadoc.skip=true -Dpmd.verbose=false -DskipOptionalQA=true -PskipCoreOptionalTests env: MOZ_HEADLESS: 1 diff --git a/ci-settings.xml b/ci-settings.xml deleted file mode 100644 index c648d5052..000000000 --- a/ci-settings.xml +++ /dev/null @@ -1,34 +0,0 @@ - - - - - - github - - - - - github - - - github - GitHub ricksbrown Apache Maven Packages - https://maven.pkg.github.com/ricksbrown/webdrivermanager - - - - - - - - github - >${env.GITHUB_USERNAME} - ${env.GITHUB_TOKEN} - - -