Skip to content

rework workflow

rework workflow #4

Workflow file for this run

name: iOS-E2E-OAuth2
on:
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
- name: check-dependencies
run: |
cd generators/react-native/resources/expo
npm run check-dependencies
build-matrix:
runs-on: ubuntu-latest
needs: [check-dependencies]
outputs:
matrix: ${{ steps.build.outputs.matrix }}
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 20
- id: build
run: |
npm ci --ignore-scripts --omit=dev
cli/cli.cjs github-build-matrix --samples-folder oauth2
applications:
name: ${{ matrix.sample-name }}
runs-on: ${{ matrix.os }}
needs: build-matrix
timeout-minutes: 90
defaults:
run:
working-directory: ${{ github.workspace }}/client
strategy:
fail-fast: false
matrix: ${{fromJson(needs.build-matrix.outputs.matrix)}}
env:
SCRIPT_DIR: ${{ github.workspace }}/generator-jhipster-react-native/test/scripts
FORCE_COLOR: true
steps:
- uses: jhipster/actions/create-app-path@v0
with:
path: client
- uses: jhipster/actions/create-app-path@v0
with:
path: backend
- uses: jhipster/actions/setup-runner@v0
with:
node-version: ${{ matrix.node-version }}
java-version: ${{ matrix.java-version }}
maven-cache: true
binary-dir: ${{ github.workspace }}/generator-jhipster-react-native/cli
- uses: actions/checkout@v4
with:
path: generator-jhipster-react-native
fetch-depth: 2
- 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 install
working-directory: ${{ github.workspace }}/generator-jhipster-react-native
- run: cli.cjs generate-sample ${{ matrix.sample-name }} --force --skip-commit-hook
working-directory: ${{ github.workspace }}/backend
- uses: jhipster/actions/compare-sample@v0
id: compare-backend
if: >-
github.event.pull_request &&
contains(github.event.pull_request.labels.*.name, 'pr: compare-backend')
with:
application-base-path: ${{ github.workspace }}/backend-base
application-folder: backend
compare-folder: backend
generator-path: generator-jhipster-react-native
# add --samples-folder oauth2
cmd: cli.cjs generate-sample ${{ matrix.sample-name }} --samples-folder oauth2 --force --skip-git --skip-commit-hook
- uses: jhipster/actions/compare-sample@v0
id: compare
if: >-
github.event.pull_request &&
!contains(github.event.pull_request.labels.*.name, 'pr: disable-compare') &&
steps.compare-backend.outputs.has-changes != 'true'
with:
application-folder: backend
compare-folder: client
generator-path: generator-jhipster-react-native
# add --samples-folder oauth2
cmd: cli.cjs generate-sample ${{ matrix.sample-name }} --force --skip-git --skip-commit-hook
- run: npm install
if: steps.compare.outputs.equals != 'true'
- run: npx expo prebuild -p ios
- run: git add . && git diff
- run: npm run e2e:build:ios
- run: |
npm run app:start &
npm install -g wait-on
wait-on -t 60000 http-get://127.0.0.1:8080/management/health
if: matrix.backend != 'false'
working-directory: ${{ github.workspace }}/backend
- run: npm run e2e:test:ios
- uses: actions/upload-artifact@v4
if: ${{ always() }}
with:
name: expo-app-${{ matrix.app_type }}-${{ matrix.jhipster_version }}
path: |
${{ github.workspace }}/client/
!${{ github.workspace }}/**/android
!${{ github.workspace }}/**/ios
!${{ github.workspace }}/**/node_modules
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