switch to new compare-sample inputs #2337
Workflow file for this run
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
name: iOS-E2E | |
on: | |
workflow_dispatch: | |
inputs: | |
recordVideo: | |
description: 'Record failing E2E Tests' | |
required: false | |
default: 'false' | |
screenshots: | |
description: 'Screenshot failing E2E Tests' | |
required: false | |
default: 'false' | |
push: | |
branches: | |
- 'main' | |
pull_request: | |
defaults: | |
run: | |
shell: bash | |
concurrency: | |
# Group by workflow and ref, limit to 1 for pull requests | |
group: ${{ github.workflow }}-${{ github.ref }}-${{ startsWith(github.ref, 'refs/pull/') || github.run_number }} | |
# Cancel intermediate pull request builds | |
cancel-in-progress: ${{ startsWith(github.ref, 'refs/pull/') }} | |
jobs: | |
check-dependencies: | |
runs-on: ubuntu-latest | |
if: "!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]') && !contains(github.event.ref_type, '[tag]')" | |
timeout-minutes: 5 | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: actions/setup-node@v4 | |
with: | |
node-version: 20.x | |
- name: check-dependencies | |
run: | | |
cd generators/react-native/resources/expo | |
npm run check-dependencies | |
applications: | |
name: e2e-${{ matrix.app_type }}-${{ matrix.jhipster_version }} | |
runs-on: macos-13 | |
needs: [check-dependencies] | |
timeout-minutes: 90 | |
defaults: | |
run: | |
working-directory: ${{ github.workspace }}/client | |
strategy: | |
fail-fast: false | |
matrix: | |
jhipster_version: [8] | |
node_version: [20.x] | |
app_type: | |
- JwtDtoApp | |
- JwtWebsocketsApp | |
- JwtHealthPointsApp | |
- JwtFlickrApp | |
- OauthApp | |
include: | |
- app_type: JwtDtoApp | |
auth_type: jwt | |
dto: true | |
- app_type: JwtWebsocketsApp | |
auth_type: jwt | |
dto: false | |
websockets: true | |
- app_type: JwtHealthPointsApp | |
auth_type: jwt | |
dto: false | |
entity_jdl: entities-21points.jdl | |
- app_type: JwtFlickrApp | |
auth_type: jwt | |
dto: false | |
entity_jdl: entities-flickr2.jdl | |
- app_type: OauthApp | |
auth_type: oauth2 | |
dto: false | |
env: | |
JHI_REACT_NATIVE_APP_NAME: ${{ matrix.app_type }} | |
JHI_AUTH_TYPE: ${{ matrix.auth_type }} | |
JHI_DTO: ${{ matrix.dto }} | |
JHI_WEBSOCKETS: ${{ matrix.websockets }} | |
JHI_ENTITY_JDL: ${{ matrix.entity_jdl }} | |
JHIPSTER_VERSION: ${{ matrix.jhipster_version }} | |
SCRIPT_DIR: ${{ github.workspace }}/generator-jhipster-react-native/test/scripts | |
PLATFORM: ios | |
JHI_RECORD_VIDEO: ${{ github.event.inputs.recordVideo || 'false' }} | |
JHI_SCREENSHOTS: ${{ github.event.inputs.screenshots || 'false' }} | |
steps: | |
- uses: jhipster/actions/create-app-path@v0 | |
with: | |
path: client | |
- uses: jhipster/actions/setup-git@v0 | |
- uses: jhipster/actions/restore-cache@v0 | |
with: | |
npm: true | |
- uses: actions/checkout@v4 | |
with: | |
path: generator-jhipster-react-native | |
fetch-depth: 2 | |
- uses: actions/setup-java@v4 | |
with: | |
distribution: 'temurin' | |
java-version: '21.x' | |
- uses: actions/setup-node@v4 | |
with: | |
node-version: ${{ matrix.node_version }} | |
- run: $SCRIPT_DIR/install-node-dependencies.sh | |
name: 'TOOLS: install node dependencies' | |
- uses: maxim-lobanov/setup-xcode@v1 | |
with: | |
xcode-version: latest | |
- uses: nick-invision/[email protected] | |
name: 'TOOLS: installing Detox and its dependencies' | |
with: | |
max_attempts: 3 | |
timeout_minutes: 60 | |
command: $SCRIPT_DIR/install-detox.sh | |
retry_wait_seconds: 15 | |
- run: $SCRIPT_DIR/display-tools.sh | |
name: 'TOOLS: display tools' | |
- run: npm i && npm link | |
name: 'TOOLS: npm install and link in generator-jhipster-react-native' | |
working-directory: ${{ github.workspace }}/generator-jhipster-react-native | |
- run: $SCRIPT_DIR/copy-jdl-file.sh | |
name: 'SETUP: copy the JDL file for the backend and app' | |
working-directory: ${{ github.workspace }}/generator-jhipster-react-native | |
- run: rnhipster --force --skip-install | |
name: 'GENERATING: generate react-native app' | |
- uses: jhipster/actions/compare-sample@v0 | |
continue-on-error: true | |
id: compare | |
if: >- | |
github.event.pull_request && | |
!contains(github.event.pull_request.labels.*.name, 'pr: disable-compare') | |
with: | |
generator-path: generator-jhipster-react-native | |
application-base-path: ${{ github.workspace }}/client-base | |
current-application-base-path: ${{ github.workspace }}/client | |
application-folder: . | |
compare-folder: . | |
cmd: rnhipster --force --skip-install | |
- run: $SCRIPT_DIR/generate-jhipster-backend.sh | |
name: 'GENERATING: generate jhipster backend' | |
if: steps.compare.outputs.equals != 'true' | |
- run: npm install | |
if: steps.compare.outputs.equals != 'true' | |
- run: $SCRIPT_DIR/run-detox-tests.sh | |
name: 'TESTING: run detox tests' | |
if: steps.compare.outputs.equals != 'true' | |
timeout-minutes: 35 | |
- run: $SCRIPT_DIR/rename-detox-screenshots.sh | |
name: 'TESTING: rename detox screenshots to a valid filename' | |
if: steps.compare.outputs.equals != 'true' | |
- uses: actions/upload-artifact@v4 | |
if: ${{ always() }} | |
with: | |
name: expo-app-${{ matrix.app_type }}-${{ matrix.jhipster_version }} | |
path: | | |
${{ runner.workspace }}/${{ matrix.app_type }}/ | |
!${{ runner.workspace }}/${{ matrix.app_type }}/node_modules | |
!${{ runner.workspace }}/${{ matrix.app_type }}/e2e/Exponent.app | |
ios-result: | |
permissions: | |
contents: none | |
runs-on: ubuntu-latest | |
needs: [applications] | |
if: always() | |
steps: | |
- run: | | |
echo '${{ toJSON(needs) }}' | |
if ([ 'skipped' == '${{ needs.applications.result }}' ] || [ 'success' == '${{ needs.applications.result }}' ]); then | |
exit 0 | |
fi | |
if [ 'closed' == '${{ github.event.action }}' ]; then | |
exit 0 | |
fi | |
exit 1 |