Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[DO NOT MERGE] - test fix to rn built system tests #6192

Closed
wants to merge 6 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
124 changes: 124 additions & 0 deletions .github/workflows/POC-publish-next.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,124 @@
# Description: This workflow runs unit + e2e tests, then publishes UI packages
# to `@next` NPM tag.
#
# Triggered by: merge to `main`

name: POC / Test and Publish / next

concurrency:
group: e2e-${{ github.sha }}
cancel-in-progress: true

on: pull_request

permissions:
id-token: write # This is required for requesting the JWT
contents: read # This is required for actions/checkout

jobs:
# setup-cache:
# uses: aws-amplify/amplify-ui/.github/workflows/reusable-setup-cache.yml@main
# with:
# commit: ${{ github.sha }}
# repository: ${{ github.repository }}

# unit:
# uses: aws-amplify/amplify-ui/.github/workflows/reusable-unit.yml@main
# needs: setup-cache
# with:
# commit: ${{ github.sha }}
# repository: ${{ github.repository }}

# e2e:
# uses: aws-amplify/amplify-ui/.github/workflows/reusable-e2e.yml@main
# needs: unit
# with:
# commit: ${{ github.sha }}
# repository: ${{ github.repository }}
# skip-changed-packages-check: 'true' # always run e2e tests for native platform on main
# secrets:
# AUTH_E2E_ROLE_ARN: ${{ secrets.AUTH_E2E_ROLE_ARN }}
# DATASTORE_E2E_ROLE_ARN: ${{ secrets.DATASTORE_E2E_ROLE_ARN }}
# GEO_E2E_ROLE_ARN: ${{ secrets.GEO_E2E_ROLE_ARN }}
# STORAGE_E2E_ROLE_ARN: ${{ secrets.STORAGE_E2E_ROLE_ARN }}
# LIVENESS_E2E_ROLE_ARN: ${{ secrets.LIVENESS_E2E_ROLE_ARN }}
# IN_APP_MESSAGING_E2E_ROLE_ARN: ${{ secrets.IN_APP_MESSAGING_E2E_ROLE_ARN }}
# AI_E2E_ROLE_ARN: ${{ secrets.AI_E2E_ROLE_ARN }}
# DOMAIN: ${{ secrets.DOMAIN }}
# PHONE_NUMBER: ${{ secrets.PHONE_NUMBER }}
# USERNAME: ${{ secrets.USERNAME }}
# NEW_PASSWORD: ${{ secrets.NEW_PASSWORD }}
# VALID_PASSWORD: ${{ secrets.VALID_PASSWORD }}
# SITE_URL: ${{ secrets.SITE_URL }}
# DOCSEARCH_DOCS_APP_ID: ${{ secrets.DOCSEARCH_DOCS_APP_ID }}
# DOCSEARCH_DOCS_API_KEY: ${{ secrets.DOCSEARCH_DOCS_API_KEY }}
# DOCSEARCH_DOCS_INDEX_NAME: ${{ secrets.DOCSEARCH_DOCS_INDEX_NAME }}

# publish:
# uses: aws-amplify/amplify-ui/.github/workflows/reusable-tagged-publish.yml@main
# with:
# dist-tag: next
# secrets:
# NPM_TOKEN: ${{ secrets.NPM_TOKEN }}

# deploy-sample-app:
# runs-on: ubuntu-latest
# environment: deployment
# needs: publish
# steps:
# - name: Trigger build for beta liveness sample app pointing at next tag
# run: curl -X POST -d {} $ENDPOINT -H "Content-Type:application/json"
# env:
# ENDPOINT: ${{ secrets.LIVENESS_BETA_SAMPLE_APP_BUILD_TRIGGER }}

# build-test:
# uses: ./.github/workflows/reusable-build-system-test.yml
# with:
# dist-tag: next
# js-dist-tag: unstable
# secrets:
# AUTH_E2E_ROLE_ARN: ${{ secrets.AUTH_E2E_ROLE_ARN }}
# DOMAIN: ${{ secrets.DOMAIN }}
# PHONE_NUMBER: ${{ secrets.PHONE_NUMBER }}
# USERNAME: ${{ secrets.USERNAME }}
# NEW_PASSWORD: ${{ secrets.NEW_PASSWORD }}
# VALID_PASSWORD: ${{ secrets.VALID_PASSWORD }}

build-test-react-native:
uses: ./.github/workflows/reusable-build-system-test-react-native.yml
with:
dist-tag: next

# log-failure-metric:
# # Send a failure data point to metric PublishNextFailure in github-workflows@ us-east-2, if it's a failure
# runs-on: ubuntu-latest
# environment: ci
# needs:
# - build-test
# - build-test-react-native
# if: ${{ failure() }}
# steps:
# - name: Log failure data point to metric PublishNextFailure
# uses: aws-amplify/amplify-ui/.github/actions/log-metric@main
# with:
# metric-name: PublishNextFailure
# value: 1
# role-to-assume: ${{ secrets.METRIC_LOGGER_ROLE_ARN }}
# aws-region: us-east-2

# log-success-metric:
# # Send a success data point to metric PublishNextFailure in github-workflows@ us-east-2, if it's a success
# runs-on: ubuntu-latest
# environment: ci
# needs:
# - build-test
# - build-test-react-native
# if: ${{ success() }}
# steps:
# - name: Log success data point to metric PublishNextFailure
# uses: aws-amplify/amplify-ui/.github/actions/log-metric@main
# with:
# metric-name: PublishNextFailure
# value: 0
# role-to-assume: ${{ secrets.METRIC_LOGGER_ROLE_ARN }}
# aws-region: us-east-2
8 changes: 6 additions & 2 deletions build-system-tests/scripts/build-android.sh
Original file line number Diff line number Diff line change
Expand Up @@ -28,11 +28,15 @@ fi

# Run npm run android in the background
if [ $BUILD_TOOL == 'expo' ]; then
log "command" "npm run android -- -p 19000 >$LOG_FILE &"

# Bypass Expo Go by creating native artifacts
log "command" "npx expo prebuild"
npx expo prebuild

# Run npm run android in the background
log "command" "npm run android -- -p 19000 >$LOG_FILE &"
npm run android -- -p 19000 >$LOG_FILE &
npx wait-on -t 20000 tcp:19000
npx expo prebuild
else
log "command" "cd android >$LOG_FILE "
cd android >$LOG_FILE
Expand Down
Loading