sync master #2745
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 debug Angular tests | |
env: | |
CHROME_PROPERTIES: "chrome.properties" | |
FIREFOX_PROPERTIES: "ff.properties" | |
WITH_PARAMS: "-ntp -Ddriver=chrome" # for Chrome: "-ntp -Ddriver=chrome" | |
UNIT: "-Punit" | |
COMMON: "-Pcommon" | |
COMPLEX: "-Pcomplex" | |
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" | |
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" | |
MATERIAL_UI: "jdi-light-material-ui-tests" | |
PERFORMANCE: "jdi-performance" | |
PERFORMANCE_PROPERTY: "test-examples/jdi-performance" | |
VUETIFY_TESTS: "jdi-light-vuetify-tests" | |
CHROME_ARGS: "--no-sandbox --headless --disable-dev-shm-usage --disable-gpu --window-size=1920,1080" | |
FIREFOX_ARGS: "-headless" | |
ALLURE_VERSION: "2.13.8" | |
on: | |
push: | |
branches: [ angular_rework_development ] # ENTER branch name there | |
pull_request: | |
branches: [ angular_rework_development ] # ENTER branch name there | |
# !!!! PLEASE do not change this file in master, as it's only template for branch debug in GitHub Actions | |
jobs: | |
build: | |
name: Degug tests run on JDK | |
runs-on: ubuntu-20.04 | |
strategy: | |
fail-fast: false | |
matrix: | |
java: [11, 13, 14, 15, 17, 18] # by default we use only 8. can be changed to any, the full list is [8, 9, 10, 11, 12, 13] | |
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 | |
# Allure download is not stable, so using local archive | |
# 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 > "./${VUETIFY_TESTS}/src/test/resources/${CHROME_PROPERTIES}" | |
echo arguments=$FIREFOX_ARGS > "./${VUETIFY_TESTS}/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 > "./${ANGULAR_TESTS}/src/test/resources/${CHROME_PROPERTIES}" | |
echo arguments=$FIREFOX_ARGS > "./${ANGULAR_TESTS}/src/test/resources/${FIREFOX_PROPERTIES}" | |
echo arguments=$CHROME_ARGS > "./${ANGULAR_TESTS_WITH_MOCKS}/src/test/resources/${CHROME_PROPERTIES}" | |
echo arguments=$FIREFOX_ARGS > "./${ANGULAR_TESTS_WITH_MOCKS}/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: 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: 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: Check angular tests are passed | |
if: ${{ steps.tests-angular-unit.outcome != 'success' || steps.tests-angular-common.outcome != 'success' || steps.tests-angular-complex.outcome != 'success' }} | |
run: | | |
echo Angular Complex tests result: ${{ steps.tests-angular-complex.outcome }} | |
echo Angular Unit tests result: ${{ steps.tests-angular-unit.outcome }} | |
echo Angular Common tests result: ${{ steps.tests-angular-common.outcome }} | |
exit 1 |