Skip to content

Bump cypress from 5.3.0 to 13.3.1 in /generators/client/templates/common #316

Bump cypress from 5.3.0 to 13.3.1 in /generators/client/templates/common

Bump cypress from 5.3.0 to 13.3.1 in /generators/client/templates/common #316

Workflow file for this run

#
# Copyright 2013-2020 the original author or authors from the JHipster project.
#
# This file is part of the JHipster project, see https://www.jhipster.tech/
# for more information.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
name: React
on:
push:
branches-ignore:
- 'dependabot/**'
- 'skip_ci*'
paths-ignore:
- 'generators/*client/templates/angular/**'
- 'generators/*client/templates/vue/**'
pull_request:
branches:
- '*'
paths-ignore:
- 'package*.json'
- 'generators/*client/templates/angular/**'
- 'generators/*client/templates/vue/**'
env:
JHI_RUN_APP: 1
JHI_JDK: 11
JHI_LIB_REPO: https://github.com/jhipster/jhipster.git
JHI_LIB_BRANCH: master
JHI_GEN_REPO: https://github.com/jhipster/generator-finscale-hipsters.git
JHI_GEN_BRANCH: master
SPRING_OUTPUT_ANSI_ENABLED: ALWAYS
SPRING_JPA_SHOW_SQL: false
JHI_DISABLE_WEBPACK_LOGS: true
JHI_E2E_HEADLESS: true
JHI_HOME: ${{ github.workspace }}/generator-jhipster
JHI_SCRIPTS: ${{ github.workspace }}/generator-jhipster/test-integration/scripts
JHI_FOLDER_APP: ${{ github.workspace }}/app
JHI_FOLDER_UAA: ${{ github.workspace }}/uaa
NG_CLI_ANALYTICS: 'false'
JHI_GITHUB_CI: true
FORCE_COLOR: 1
jobs:
applications:
name: ${{ matrix.app-type }}
runs-on: ${{ matrix.os }}
defaults:
run:
working-directory: ${{ github.workspace }}/app
if: >-
!contains(github.event.head_commit.message, '[angular]') &&
!contains(github.event.head_commit.message, '[vue]') &&
!contains(github.event.pull_request.title, '[angular]') &&
!contains(github.event.pull_request.title, '[vue]') &&
!contains(github.event.head_commit.message, '[ci skip]') &&
!contains(github.event.head_commit.message, '[skip ci]') &&
!contains(github.event.pull_request.title, '[skip ci]') &&
!contains(github.event.pull_request.title, '[ci skip]') &&
(github.event.pull_request.draft == false || !contains(github.event.pull_request.labels.*.name, 'pr: skip-ci'))
timeout-minutes: 40
strategy:
fail-fast: false
matrix:
node_version: [12.18.3]
os: [ubuntu-20.04]
app-type:
- react-default
- react-maven-mysql-es-noi18n-mapsid
- react-maven-h2mem-memcached
- react-maven-cassandra-session-redis
# - react-maven-couchbase-caffeine
- react-gradle-mysql-es-noi18n-mapsid
- react-gradle-h2mem-memcached
- react-gradle-cassandra-session-redis
# - react-gradle-couchbase-caffeine
include:
- app-type: react-default
entity: sql
environment: prod
war: 0
e2e: 1
testcontainers: 0
- app-type: react-maven-mysql-es-noi18n-mapsid
entity: sqlfull
environment: prod
war: 0
e2e: 1
testcontainers: 1
- app-type: react-maven-h2mem-memcached
entity: sql
environment: dev
war: 0 # TODO: need change to 1, when maven+war is fixed
e2e: 1
testcontainers: 0
- app-type: react-maven-cassandra-session-redis
entity: cassandra
environment: prod
war: 0
e2e: 1
testcontainers: 1
# - app-type: react-maven-couchbase-caffeine
# entity: couchbase
# environment: prod
# war: 0
# e2e: 0
# testcontainers: 0
- app-type: react-gradle-mysql-es-noi18n-mapsid
entity: sqlfull
environment: prod
war: 0
e2e: 1
testcontainers: 0
- app-type: react-gradle-h2mem-memcached
entity: sql
environment: dev
war: 1
e2e: 1
testcontainers: 0
- app-type: react-gradle-cassandra-session-redis
entity: cassandra
environment: prod
war: 0
e2e: 1
testcontainers: 1
# - app-type: react-gradle-couchbase-caffeine
# entity: couchbase
# environment: prod
# war: 0
# e2e: 1
# testcontainers: 0
env:
JHI_ENTITY: ${{ matrix.entity }}
JHI_APP: ${{ matrix.app-type }}
JHI_PROFILE: ${{ matrix.environment }}
JHI_WAR: ${{ matrix.war }}
JHI_E2E: ${{ matrix.e2e }}
SPRING_PROFILES_ACTIVE: ${{ fromJson('["", "testcontainers"]')[matrix.testcontainers] }}
steps:
#----------------------------------------------------------------------
# Install all tools and check configuration
#----------------------------------------------------------------------
- name: 'SETUP: Checkout generator-jhipster'
uses: actions/checkout@v2
with:
path: generator-jhipster
fetch-depth: 2
- name: 'SETUP: Create required structure'
run: |
mkdir app
mkdir -p base/generator-jhipster
mkdir -p base/app
mkdir -p base/uaa
working-directory: ${{ github.workspace }}
- uses: actions/[email protected]
with:
node-version: ${{ matrix.node_version }}
- uses: actions/setup-java@v1
with:
java-version: '11.x'
- name: 'SETUP: Get chrome/chromedriver version'
id: chromedriver-version
run: |
CHROME_VERSION=$(google-chrome --version | cut -f 3 -d ' ' | cut -d '.' -f 1) \
&& CHROMEDRIVER_VERSION=$(curl --location --fail --retry 3 http://chromedriver.storage.googleapis.com/LATEST_RELEASE_${CHROME_VERSION}) \
&& echo "::set-output name=version::$CHROMEDRIVER_VERSION"
- name: 'SETUP: Get date'
id: get-date
run: |
echo "::set-output name=date::$(/bin/date -u "+%Y%m%d")"
- name: 'SETUP: load npm cache'
uses: actions/cache@v2
with:
path: ~/.npm
key: ${{ runner.os }}-node-${{ matrix.app-type }}-${{ steps.get-date.outputs.date }}-${{ hashFiles('generator-jhipster/package-lock.json', 'generator-jhipster/**/package.json.ejs') }}
restore-keys: |
${{ runner.os }}-node-${{ matrix.app-type }}-${{ steps.get-date.outputs.date }}-
- name: 'SETUP: load maven cache'
uses: actions/cache@v2
with:
path: ~/.m2/repository
key: ${{ runner.os }}-maven-${{ matrix.app-type }}-${{ steps.get-date.outputs.date }}-${{ hashFiles('generator-jhipster/**/pom.xml.ejs') }}
restore-keys: |
${{ runner.os }}-maven-${{ matrix.app-type }}-${{ steps.get-date.outputs.date }}-
- name: 'SETUP: load gradle cache'
if: contains(matrix.app-type, 'gradle')
uses: actions/cache@v2
with:
path: |
~/.gradle/caches
~/.gradle/wrapper
key: ${{ runner.os }}-gradle-${{ matrix.app-type }}-${{ hashFiles('generator-jhipster/**/build.gradle.ejs') }}
restore-keys: |
${{ runner.os }}-gradle-${{ matrix.app-type }}-
- name: 'SETUP: load e2e cache'
if: matrix.e2e == 1
uses: actions/cache@v2
with:
path: |
~/.cache/selenium/
~/.cache/Cypress/
key: ${{ runner.os }}-e2e-${{ matrix.app-type }}-${{ steps.chromedriver-version.outputs.version }}-${{ hashFiles('generator-jhipster/**/package.json.ejs') }}
restore-keys: |
${{ runner.os }}-e2e-${{ matrix.app-type }}-${{ steps.chromedriver-version.outputs.version }}-
- name: 'ENV: display variables'
run: $JHI_SCRIPTS/01-display-configuration.sh
- name: 'TOOLS: configure tools installed by the system'
run: $JHI_SCRIPTS/03-system.sh
- name: 'TOOLS: configure git'
run: $JHI_SCRIPTS/04-git-config.sh
#----------------------------------------------------------------------
# Install JHipster and generate project+entities
#----------------------------------------------------------------------
- name: 'GENERATION: install JHipster'
run: $JHI_SCRIPTS/10-install-jhipster.sh
- name: 'GENERATION: entities'
run: $JHI_SCRIPTS/11-generate-entities.sh
- name: 'GENERATION: project'
run: $JHI_SCRIPTS/12-generate-project.sh
- name: 'GENERATION: replace version in generated project'
run: $JHI_SCRIPTS/13-replace-version-generated-project.sh
- name: 'GENERATION: jhipster info'
run: $JHI_SCRIPTS/14-jhipster-info.sh
#----------------------------------------------------------------------
# Detect changes against base commit
#----------------------------------------------------------------------
- name: 'MERGE: Install base generator-jhipster'
continue-on-error: true
id: base-checkout
if: github.event.pull_request
working-directory: ${{ github.workspace }}/base/generator-jhipster
run: |
git clone ${{ github.workspace }}/generator-jhipster .
git checkout @~1
git log
npm uninstall -g generator-jhipster
npm install -g .
- name: 'MERGE: merge base project'
continue-on-error: true
id: base-app
if: steps.base-checkout.outcome == 'success'
working-directory: ${{ github.workspace }}/base/app
run: |
$JHI_SCRIPTS/11-generate-entities.sh
# 11-generate-entities.sh removes current dir, we need to switch to the new one
cd ../app
$JHI_SCRIPTS/12-generate-project.sh --skip-install --skip-git
env:
JHI_FOLDER_APP: ${{ github.workspace }}/base/app
JHI_FOLDER_UAA: ${{ github.workspace }}/base/uaa
- name: 'MERGE: merge uaa project diff'
continue-on-error: true
id: uaa-is-equal
if: steps.base-app.outcome == 'success'
working-directory: ${{ github.workspace }}/base/uaa
run: |
# Copy git repository (clone without the files)
cp -a ${{ github.workspace }}/uaa/.git ../uaa/ || exit 0
git log
# File keystore.p12 always changes
# File package-lock.json is not generated
# Verify if the generated source has changed
git add .
git -c color.ui=always diff -R --cached --exit-code -- . ':!package-lock.json' ':!src/main/resources/config/tls/keystore.p12' || echo "::set-output name=has-changes::true"
- name: 'MERGE: merge project diff'
continue-on-error: true
id: merge-is-equal
if: steps.base-app.outcome == 'success'
working-directory: ${{ github.workspace }}/base/app
run: |
# Copy git repository (clone without the files)
cp -a ${{ github.workspace }}/app/.git .
git log
# File keystore.p12 always changes
# File package-lock.json is not generated
# Verify if the generated source has changed
git add .
git -c color.ui=always diff -R --cached --exit-code -- . ':!package-lock.json' ':!src/main/resources/config/tls/keystore.p12' || echo "::set-output name=has-changes::true"
- name: 'MERGE: tests should be skipped'
id: tests-should-be-skipped
if: >
steps.uaa-is-equal.outcome == 'success' &&
steps.uaa-is-equal.outputs.has-changes != 'true' &&
steps.merge-is-equal.outcome == 'success' &&
steps.merge-is-equal.outputs.has-changes != 'true'
run: echo 'Skipping tests' && echo "::set-output name=skip-tests::true"
#----------------------------------------------------------------------
# Launch tests
#----------------------------------------------------------------------
- name: 'TESTS: Start docker-compose containers for e2e and backend tests'
if: steps.tests-should-be-skipped.outputs.skip-tests != 'true' && matrix.testcontainers != 1
run: npm run ci:e2e:prepare:docker
- name: 'TESTS: backend'
id: backend
if: steps.tests-should-be-skipped.outputs.skip-tests != 'true'
run: npm run ci:backend:test
- name: 'TESTS: frontend'
if: steps.tests-should-be-skipped.outputs.skip-tests != 'true'
run: npm run ci:frontend:test
- name: 'TESTS: packaging'
if: steps.tests-should-be-skipped.outputs.skip-tests != 'true'
run: npm run ci:e2e:package
- name: 'E2E: Synchronize chromedriver version'
if: matrix.e2e == 1 && steps.tests-should-be-skipped.outputs.skip-tests != 'true'
run: npm run e2e:update-webdriver -- --versions.chrome ${{ steps.chromedriver-version.outputs.version }}
working-directory: ${{ github.workspace }}/app
- name: 'TESTS: Start docker-compose containers for e2e tests'
if: steps.tests-should-be-skipped.outputs.skip-tests != 'true' && matrix.testcontainers == 1
run: npm run ci:e2e:prepare:docker
- name: 'E2E: Run'
id: e2e
if: steps.tests-should-be-skipped.outputs.skip-tests != 'true'
run: npm run ci:e2e:run --if-present
- name: 'BACKEND: Store failure logs'
uses: actions/upload-artifact@v2
if: always() && steps.backend.outcome == 'failure'
with:
name: log-${{ matrix.app-type }}
path: ${{ github.workspace }}/app/build/test-results/**/*.xml
- name: 'E2E: Store failure screenshots'
uses: actions/upload-artifact@v2
if: always() && steps.e2e.outcome == 'failure'
with:
name: screenshots-${{ matrix.app-type }}
path: ${{ github.workspace }}/app/*/cypress/screenshots
- name: 'ANALYSIS: Sonar analysis'
if: steps.tests-should-be-skipped.outputs.skip-tests != 'true'
run: $JHI_SCRIPTS/25-sonar-analyze.sh
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}