Merge pull request #5430 from jdi-testing/5341 #1486
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# This workflow will build a Java project with Maven | |
# For more information see: https://help.github.com/actions/language-and-framework-guides/building-and-testing-java-with-maven | |
name: JDI auto-tests | |
env: | |
CHROME_PROPERTIES: "chrome.properties" | |
FIREFOX_PROPERTIES: "ff.properties" | |
WITH_PARAMS: "-ntp -Ddriver=chrome" # for Chrome: "-ntp -Ddriver=chrome", for FF: "-ntp -Ddriver=firefox" | |
UNIT: "-Punit" | |
COMMON: "-Pcommon" | |
COMPLEX: "-Pcomplex" | |
PERF: "-Pperformance" | |
FUNC: "-Pfunctional" | |
GROUP_ID: "com.epam.jdi" | |
NOPO_TESTS: "jdi-bdd-no-po-tests" | |
NOPO_TESTS_PROPERTY: "test-examples/jdi-bdd-no-po-tests" | |
BDD_TESTS: "jdi-bdd-tests" | |
BOOTSTRAP_TESTS: "jdi-light-bootstrap-tests" | |
HTML_TESTS: "jdi-light-html-tests" | |
VUETIFY_TESTS: "jdi-light-vuetify-tests" | |
# ANGULAR_TESTS: "jdi-light-angular-tests" | |
# ANGULAR_TESTS_WITH_MOCKS: "jdi-light-angular-tests-with-mocks" | |
EXAMPLES: "jdi-light-examples" | |
EXAMPLES_PROPERTY: "test-examples/jdi-light-examples" | |
PERFORMANCE: "jdi-performance" | |
MATERIAL_UI: "jdi-light-material-ui-tests" | |
PERFORMANCE_PROPERTY: "test-examples/jdi-performance" | |
CHROME_ARGS: "--no-sandbox --headless --disable-dev-shm-usage --disable-gpu --window-size=1920,1080 --remote-allow-origins=*" | |
FIREFOX_ARGS: "-headless" | |
ALLURE_VERSION: "2.13.8" | |
SUREFIRE_ARGS: "--add-opens java.base/java.lang=ALL-UNNAMED" | |
SUREFIRE_ARGS_BDD: "--add-opens java.base/java.lang=ALL-UNNAMED --add-opens java.base/java.util=ALL-UNNAMED --add-opens=java.base/java.lang.reflect=ALL-UNNAMED --add-opens=java.base/java.text=ALL-UNNAMED --add-opens=java.desktop/java.awt.font=ALL-UNNAMED" | |
on: | |
push: | |
paths-ignore: [ '*.md' ] | |
branches: | |
- master | |
pull_request: | |
paths-ignore: [ '*.md' ] | |
branches: | |
- master | |
release: | |
types: # This configuration does not affect the page_build event above | |
- created | |
jobs: | |
build: | |
name: Tests on JDK | |
runs-on: ubuntu-20.04 | |
strategy: | |
fail-fast: false | |
matrix: | |
java: [11, 15, 17, 18] # all [11, 12, 13, 14, 15, 16, 17, 18, 21] | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Set up JDK ${{ matrix.java }} | |
uses: actions/setup-java@v4 | |
with: | |
java-version: ${{ matrix.java }} | |
java-package: jdk | |
distribution: 'zulu' | |
cache: 'maven' | |
- name: Prepare environment | |
run: | | |
sudo apt install zip | |
java -Xmx32m -version | |
ls -lah | |
env | |
id | |
# run cann't start from comment | |
# curl -o allure-${ALLURE_VERSION}.tgz -Ls https://dl.bintray.com/qameta/generic/io/qameta/allure/allure/${ALLURE_VERSION}/allure-${ALLURE_VERSION}.tgz | |
- name: Install Allure | |
run: | | |
sudo tar -zxvf allure.tgz -C /opt/ | |
sudo ln -s /opt/allure-${ALLURE_VERSION}/bin/allure /usr/bin/allure | |
allure --version | |
# - name: Install Netlify | |
# run: sudo npm install -g netlify-cli | |
- name: Welcome to JDI | |
run: | | |
echo ------------------- WELCOME TO JDI ----------------------- | |
mvn --version | |
- name: Prepare configs | |
run: | | |
echo arguments=$CHROME_ARGS > "./${BDD_TESTS}/src/test/resources/${CHROME_PROPERTIES}" | |
echo arguments=$FIREFOX_ARGS > "./${BDD_TESTS}/src/test/resources/${FIREFOX_PROPERTIES}" | |
echo arguments=$CHROME_ARGS > "./${BOOTSTRAP_TESTS}/src/test/resources/${CHROME_PROPERTIES}" | |
echo arguments=$FIREFOX_ARGS > "./${BOOTSTRAP_TESTS}/src/test/resources/${FIREFOX_PROPERTIES}" | |
echo arguments=$CHROME_ARGS > "./${HTML_TESTS}/src/test/resources/${CHROME_PROPERTIES}" | |
echo arguments=$FIREFOX_ARGS > "./${HTML_TESTS}/src/test/resources/${FIREFOX_PROPERTIES}" | |
echo arguments=$CHROME_ARGS > "./${EXAMPLES_PROPERTY}/src/test/resources/${CHROME_PROPERTIES}" | |
echo arguments=$FIREFOX_ARGS > "./${EXAMPLES_PROPERTY}/src/test/resources/${FIREFOX_PROPERTIES}" | |
echo arguments=$CHROME_ARGS > "./${PERFORMANCE_PROPERTY}/src/test/resources/${CHROME_PROPERTIES}" | |
echo arguments=$FIREFOX_ARGS > "./${PERFORMANCE_PROPERTY}/src/test/resources/${FIREFOX_PROPERTIES}" | |
echo arguments=$CHROME_ARGS > "./${MATERIAL_UI}/src/test/resources/${CHROME_PROPERTIES}" | |
echo arguments=$FIREFOX_ARGS > "./${MATERIAL_UI}/src/test/resources/${FIREFOX_PROPERTIES}" | |
echo arguments=$CHROME_ARGS > "./${VUETIFY_TESTS}/src/test/resources/${CHROME_PROPERTIES}" | |
echo arguments=$FIREFOX_ARGS > "./${VUETIFY_TESTS}/src/test/resources/${FIREFOX_PROPERTIES}" | |
- name: Compile jdi code | |
id: jdi-compile | |
run: mvn -ntp install -DskipTests -Dsource.skip -Dmaven.source.skip -Dmaven.javadoc.skip=true | |
# ========== steps before required for all tasks ================== | |
- name: Tests BDD | |
id: tests-bdd | |
if: steps.jdi-compile.outcome == 'success' | |
timeout-minutes: 30 # prevent blocking | |
continue-on-error: true | |
run: mvn verify $WITH_PARAMS -Dchrome.capabilities.path=${CHROME_PROPERTIES} -Dff.capabilities.path=${FIREFOX_PROPERTIES} -pl $GROUP_ID:$BDD_TESTS --fail-at-end | |
- name: Tests BDD Firefox | |
id: tests-bdd-firefox | |
if: steps.jdi-compile.outcome == 'success' | |
timeout-minutes: 30 # prevent blocking | |
continue-on-error: true | |
run: mvn verify -ntp -Ddriver=firefox -Dcucumber.filter.tags="not @ignore_for_firefox" -Dff.capabilities.path=${FIREFOX_PROPERTIES} -pl $GROUP_ID:$BDD_TESTS --fail-at-end | |
##### Example for original allure data upload | |
# - name: 'Upload BDD results' | |
# uses: actions/upload-artifact@v2 | |
# with: | |
# name: bdd-results-sdk${{ matrix.java }} | |
# path: ./${BDD_TESTS}/target/allure-results/ | |
# retention-days: 1 | |
- name: Tests bootstrap Unit | |
id: tests-bootstrap | |
if: steps.jdi-compile.outcome == 'success' | |
timeout-minutes: 20 # prevent blocking | |
continue-on-error: true | |
run: mvn verify $WITH_PARAMS -Dchrome.capabilities.path=${CHROME_PROPERTIES} -Dff.capabilities.path=${FIREFOX_PROPERTIES} -pl $GROUP_ID:$BOOTSTRAP_TESTS --fail-at-end | |
# - name: Run tests - Angular Unit tests | |
# id: tests-angular-unit | |
# if: steps.jdi-compile.outcome == 'success' | |
# timeout-minutes: 40 # prevent blocking | |
# continue-on-error: true | |
# run: mvn verify $WITH_PARAMS -Dchrome.capabilities.path=${CHROME_PROPERTIES} -Dff.capabilities.path=${FIREFOX_PROPERTIES} $UNIT -pl $GROUP_ID:$ANGULAR_TESTS --fail-at-end | |
# - name: Run tests - Angular Common tests | |
# id: tests-angular-common | |
# if: steps.jdi-compile.outcome == 'success' | |
# timeout-minutes: 30 # prevent blocking | |
# continue-on-error: true | |
# run: mvn verify $WITH_PARAMS -Dchrome.capabilities.path=${CHROME_PROPERTIES} -Dff.capabilities.path=${FIREFOX_PROPERTIES} $COMMON -pl $GROUP_ID:$ANGULAR_TESTS --fail-at-end | |
# - name: Run tests - Angular Complex tests | |
# id: tests-angular-complex | |
# if: steps.jdi-compile.outcome == 'success' | |
# timeout-minutes: 60 # prevent blocking | |
# continue-on-error: true | |
# run: mvn verify $WITH_PARAMS -Dchrome.capabilities.path=${CHROME_PROPERTIES} -Dff.capabilities.path=${FIREFOX_PROPERTIES} $COMPLEX -pl $GROUP_ID:$ANGULAR_TESTS --fail-at-end | |
- name: Run tests - HTML functional | |
id: tests-html-func | |
if: steps.jdi-compile.outcome == 'success' | |
timeout-minutes: 90 # prevent blocking | |
continue-on-error: true | |
run: mvn verify $WITH_PARAMS -Dchrome.capabilities.path=${CHROME_PROPERTIES} -Dff.capabilities.path=${FIREFOX_PROPERTIES} $FUNC -pl $GROUP_ID:$HTML_TESTS --fail-at-end | |
- name: Run tests - HTML performance | |
id: tests-html-perf | |
if: steps.jdi-compile.outcome == 'success' | |
timeout-minutes: 90 # prevent blocking | |
continue-on-error: true | |
run: mvn verify $WITH_PARAMS -Dchrome.capabilities.path=${CHROME_PROPERTIES} -Dff.capabilities.path=${FIREFOX_PROPERTIES} $PERF -pl $GROUP_ID:$HTML_TESTS --fail-at-end | |
- name: Run tests - Test Examples | |
id: tests-examples | |
if: steps.jdi-compile.outcome == 'success' | |
timeout-minutes: 20 # prevent blocking | |
continue-on-error: true | |
run: mvn verify $WITH_PARAMS -Dchrome.capabilities.path=${CHROME_PROPERTIES} -Dff.capabilities.path=${FIREFOX_PROPERTIES} -pl $GROUP_ID:$EXAMPLES --fail-at-end | |
- name: Run tests - Material UI | |
id: tests-material-ui | |
if: steps.jdi-compile.outcome == 'success' | |
timeout-minutes: 40 # prevent blocking | |
continue-on-error: true | |
run: mvn verify $WITH_PARAMS -Dchrome.capabilities.path=${CHROME_PROPERTIES} -Dff.capabilities.path=${FIREFOX_PROPERTIES} $FUNC -pl $GROUP_ID:$MATERIAL_UI --fail-at-end | |
- name: Run tests - Vuetify | |
id: tests-vuetify | |
if: ${{ steps.jdi-compile.outcome == 'success' }} | |
continue-on-error: true | |
timeout-minutes: 30 # prevent blocking | |
run: mvn verify $WITH_PARAMS -Dchrome.capabilities.path=${CHROME_PROPERTIES} -Dff.capabilities.path=${FIREFOX_PROPERTIES} -pl $GROUP_ID:$VUETIFY_TESTS --fail-at-end | |
- name: Run tests - Performance | |
id: tests-perf | |
if: steps.jdi-compile.outcome == 'success' | |
timeout-minutes: 20 # prevent blocking | |
continue-on-error: true | |
run: mvn verify $WITH_PARAMS -Dchrome.capabilities.path=${CHROME_PROPERTIES} -Dff.capabilities.path=${FIREFOX_PROPERTIES} -pl $GROUP_ID:$PERFORMANCE --fail-at-end | |
- name: Collect reports | |
if: steps.jdi-compile.outcome == 'success' | |
run: | | |
echo --------------- Collecting Allure Reports.... ------------------ | |
sudo chmod +x reporting.sh | |
source reporting.sh | |
generateAllureReports | |
printAllureSummary ${{ matrix.java }} | |
zip -r allure-report.zip ./allure-report/ | |
- name: 'Upload allure report' | |
if: steps.jdi-compile.outcome == 'success' | |
uses: actions/upload-artifact@v4 | |
with: | |
name: allure-report-jdk${{ matrix.java }} | |
path: ./allure-report.zip | |
retention-days: 1 | |
- name: 'All statuses of the tests' | |
if: steps.jdi-compile.outcome == 'success' | |
run: | | |
echo BDD tests result: ${{ steps.tests-bdd.outcome }} | |
echo BDD Firefox tests result: ${{ steps.tests-bdd-firefox.outcome }} | |
echo HTML tests result: ${{ steps.tests-html-func.outcome }} | |
echo Example tests result: ${{ steps.tests-examples.outcome }} | |
echo Material ui tests result: ${{ steps.tests-material-ui.outcome }} | |
echo HTML Performance tests result: ${{ steps.tests-html-perf.outcome }} | |
echo Performance tests result: ${{ steps.tests-perf.outcome }} | |
echo Vuetify tests result: ${{ steps.tests-vuetify.outcome }} | |
- name: Check BDD are passed | |
if: ${{ steps.tests-bdd.outcome != 'success' || steps.tests-bdd-firefox.outcome != 'success' }} | |
run: | | |
echo BDD tests result: ${{ steps.tests-bdd.outcome }} | |
echo BDD Firefox tests result: ${{ steps.tests-bdd-firefox.outcome }} | |
exit 1 | |
- name: Check Bootstrap are passed | |
if: ${{ steps.tests-bootstrap.outcome != 'success' }} | |
run: | | |
echo bootstrap tests result: ${{ steps.tests-bootstrap.outcome }} | |
exit 1 | |
- name: Check html tests are passed | |
if: ${{ steps.tests-html-func.outcome != 'success' || steps.tests-examples.outcome != 'success' }} | |
run: | | |
echo HTML tests result: ${{ steps.tests-html-func.outcome }} | |
echo Example tests result: ${{ steps.tests-examples.outcome }} | |
exit 1 | |
- name: Check Material-ui tests are passed | |
if: ${{ steps.tests-material-ui.outcome != 'success' }} | |
run: | | |
echo Material ui tests result: ${{ steps.tests-material-ui.outcome }} | |
exit 1 | |
# - name: Check angular tests are passed | |
# if: ${{ steps.tests-angular-common.outcome != 'success' }} | |
# for full angular should be | |
# if: ${{ steps.tests-angular-unit.outcome != 'success' || steps.tests-angular-common.outcome != 'success' || steps.tests-angular-complex.outcome != 'success' }} | |
# echo Angular Complex tests result: ${{ steps.tests-angular-complex.outcome }} | |
# echo Angular Unit tests result: ${{ steps.tests-angular-unit.outcome }} | |
# run: | | |
# echo Angular Common tests result: ${{ steps.tests-angular-common.outcome }} | |
# exit 1 | |
- name: Check performance tests are passed | |
if: ${{ steps.tests-html-perf.outcome != 'success' || steps.tests-perf.outcome != 'success' }} | |
run: | | |
echo HTML Performance tests result: ${{ steps.tests-html-perf.outcome }} | |
echo Performance tests result: ${{ steps.tests-perf.outcome }} | |
exit 1 | |
- name: Check Vuetify tests are passed | |
if: ${{ steps.tests-vuetify.outcome != 'success' }} | |
run: | | |
echo Vuetify tests result: ${{ steps.tests-vuetify.outcome }} | |
exit 1 |