diff --git a/.github/workflows/automatic_pull_request_review.yml b/.github/workflows/automatic_pull_request_review.yml index 5c1910c4..411052c8 100644 --- a/.github/workflows/automatic_pull_request_review.yml +++ b/.github/workflows/automatic_pull_request_review.yml @@ -11,8 +11,19 @@ concurrency: jobs: review_pull_request: name: Pull request review by Danger - runs-on: macOS-latest + runs-on: self-hosted steps: + - name: Determine Runner Port + id: runner_port + run: | + last_char=$(echo "${{ runner.name }}" | tail -c 2 | head -c 1) + if [ "$last_char" = "1" ]; then + echo "runner_port=2000" >> $GITHUB_ENV + echo "test_device=iPhone 14 Pro Max" >> $GITHUB_ENV + else + echo "runner_port=2001" >> $GITHUB_ENV + echo "test_device=iPhone SE (3rd generation)" >> $GITHUB_ENV + fi - uses: actions/checkout@v3 with: fetch-depth: 0 @@ -51,12 +62,12 @@ jobs: run: bundle exec pod install - name: Build and Test - run: bundle exec fastlane buildAndTest - env: - CI: true + run: | + bundle exec fastlane buildAndTest --swift_server_port ${{ env.runner_port }} - name: Clean up previous code coverage report - run: bundle exec fastlane cleanUpOutput + run: | + bundle exec fastlane cleanUpOutput --swift_server_port ${{ env.runner_port }} - name: Review pull request by Danger env: diff --git a/.github/workflows/deploy_app_store.yml b/.github/workflows/deploy_app_store.yml index c065d75b..85b3f112 100644 --- a/.github/workflows/deploy_app_store.yml +++ b/.github/workflows/deploy_app_store.yml @@ -33,8 +33,19 @@ jobs: build: name: Build - runs-on: macOS-latest + runs-on: self-hosted steps: + - name: Determine Runner Port and Test Device + id: runner_port_test_device + run: | + last_char=$(echo "${{ runner.name }}" | tail -c 2 | head -c 1) + if [ "$last_char" = "1" ]; then + echo "runner_port=2000" >> $GITHUB_ENV + echo "test_device=iPhone 14 Pro Max" >> $GITHUB_ENV + else + echo "runner_port=2001" >> $GITHUB_ENV + echo "test_device=iPhone SE (3rd generation)" >> $GITHUB_ENV + fi - name: Checkout Repo uses: actions/checkout@v3 # Set fetch-depth (default: 1) to get whole tree @@ -73,15 +84,18 @@ jobs: shell: bash - name: Build and Test - run: bundle exec fastlane buildAndTest + run: | + bundle exec fastlane buildAndTest --swift_server_port ${{ env.runner_port }} - name: Match AppStore - run: bundle exec fastlane syncAppStoreCodeSigning + run: | + bundle exec fastlane syncAppStoreCodeSigning --swift_server_port ${{ env.runner_port }} env: MATCH_PASSWORD: ${{ secrets.MATCH_PASS }} - name: Build App and Distribute to AppStore - run: bundle exec fastlane buildAndUploadToAppStore + run: | + bundle exec fastlane buildAndUploadToAppStore --swift_server_port ${{ env.runner_port }} env: APPSTORE_CONNECT_API_KEY: ${{ secrets.APPSTORE_CONNECT_API_KEY }} API_KEY_ID: ${{ secrets.API_KEY_ID }} diff --git a/.github/workflows/deploy_production_firebase.yml b/.github/workflows/deploy_production_firebase.yml index 2b9209c9..f5a67824 100644 --- a/.github/workflows/deploy_production_firebase.yml +++ b/.github/workflows/deploy_production_firebase.yml @@ -31,9 +31,21 @@ jobs: build: name: Build - runs-on: macOS-latest + runs-on: self-hosted steps: - - uses: actions/checkout@v3 + - name: Determine Runner Port + id: runner_port + run: | + last_char=$(echo "${{ runner.name }}" | tail -c 2 | head -c 1) + if [ "$last_char" = "1" ]; then + echo "runner_port=2000" >> $GITHUB_ENV + echo "test_device=iPhone 14 Pro Max" >> $GITHUB_ENV + else + echo "runner_port=2001" >> $GITHUB_ENV + echo "test_device=iPhone SE (3rd generation)" >> $GITHUB_ENV + fi + - name: Checkout Repo + uses: actions/checkout@v3 # Set fetch-depth (default: 1) to get whole tree with: fetch-depth: 0 @@ -70,15 +82,18 @@ jobs: shell: bash - name: Build and Test - run: bundle exec fastlane buildAndTest + run: | + bundle exec fastlane buildAndTest --swift_server_port ${{ env.runner_port }} - name: Match Ad-hoc - run: bundle exec fastlane syncAdHocProductionCodeSigning + run: | + bundle exec fastlane syncAdHocProductionCodeSigning --swift_server_port ${{ env.runner_port }} env: MATCH_PASSWORD: ${{ secrets.MATCH_PASS }} - name: Build Production App and Distribute to Firebase - run: bundle exec fastlane buildProductionAndUploadToFirebase + run: | + bundle exec fastlane buildProductionAndUploadToFirebase --swift_server_port ${{ env.runner_port }} env: FIREBASE_TOKEN: ${{ secrets.FIREBASE_TOKEN }} diff --git a/.github/workflows/deploy_staging_firebase.yml b/.github/workflows/deploy_staging_firebase.yml index d5ac0b71..c21c8516 100644 --- a/.github/workflows/deploy_staging_firebase.yml +++ b/.github/workflows/deploy_staging_firebase.yml @@ -31,9 +31,21 @@ jobs: build: name: Build - runs-on: macOS-latest + runs-on: self-hosted steps: - - uses: actions/checkout@v3 + - name: Determine Runner Port + id: runner_port + run: | + last_char=$(echo "${{ runner.name }}" | tail -c 2 | head -c 1) + if [ "$last_char" = "1" ]; then + echo "runner_port=2000" >> $GITHUB_ENV + echo "test_device=iPhone 14 Pro Max" >> $GITHUB_ENV + else + echo "runner_port=2001" >> $GITHUB_ENV + echo "test_device=iPhone SE (3rd generation)" >> $GITHUB_ENV + fi + - name: Checkout Repo + uses: actions/checkout@v3 # Set fetch-depth (default: 1) to get whole tree with: fetch-depth: 0 @@ -76,15 +88,18 @@ jobs: shell: bash - name: Build and Test - run: bundle exec fastlane buildAndTest + run: | + bundle exec fastlane buildAndTest --swift_server_port ${{ env.runner_port }} - name: Match Ad-hoc - run: bundle exec fastlane syncAdHocStagingCodeSigning + run: | + bundle exec fastlane syncAdHocStagingCodeSigning --swift_server_port ${{ env.runner_port }} env: MATCH_PASSWORD: ${{ secrets.MATCH_PASS }} - name: Build App and Distribute to Firebase - run: bundle exec fastlane buildStagingAndUploadToFirebase + run: | + bundle exec fastlane buildStagingAndUploadToFirebase --swift_server_port ${{ env.runner_port }} env: FIREBASE_TOKEN: ${{ secrets.FIREBASE_TOKEN }} diff --git a/.github/workflows/test_swiftui_install_script.yml b/.github/workflows/test_swiftui_install_script.yml index 7002abae..7b791cbc 100644 --- a/.github/workflows/test_swiftui_install_script.yml +++ b/.github/workflows/test_swiftui_install_script.yml @@ -11,9 +11,21 @@ concurrency: jobs: Test: name: Test - runs-on: macOS-12 + runs-on: self-hosted steps: - - uses: actions/checkout@v3 + - name: Determine Runner Port + id: runner_port + run: | + last_char=$(echo "${{ runner.name }}" | tail -c 2 | head -c 1) + if [ "$last_char" = "1" ]; then + echo "runner_port=2000" >> $GITHUB_ENV + echo "test_device=iPhone 14 Pro Max" >> $GITHUB_ENV + else + echo "runner_port=2001" >> $GITHUB_ENV + echo "test_device=iPhone SE (3rd generation)" >> $GITHUB_ENV + fi + - name: Checkout Repo + uses: actions/checkout@v3 - name: Bundle install run: bundle install @@ -22,6 +34,5 @@ jobs: run: sh make.sh --bundle-id co.nimblehq.template --bundle-id-staging co.nimblehq.template.staging --project-name TemplateApp --interface SwiftUI - name: Build and Test - run: bundle exec fastlane buildAndTest - env: - CI: true + run: | + bundle exec fastlane buildAndTest --swift_server_port ${{ env.runner_port }} diff --git a/.github/workflows/test_uikit_install_script.yml b/.github/workflows/test_uikit_install_script.yml index d5cc86e9..80bdfde9 100644 --- a/.github/workflows/test_uikit_install_script.yml +++ b/.github/workflows/test_uikit_install_script.yml @@ -11,9 +11,21 @@ concurrency: jobs: Test: name: Test - runs-on: macOS-latest + runs-on: self-hosted steps: - - uses: actions/checkout@v3 + - name: Determine Runner Port + id: runner_port + run: | + last_char=$(echo "${{ runner.name }}" | tail -c 2 | head -c 1) + if [ "$last_char" = "1" ]; then + echo "runner_port=2000" >> $GITHUB_ENV + echo "test_device=iPhone 14 Pro Max" >> $GITHUB_ENV + else + echo "runner_port=2001" >> $GITHUB_ENV + echo "test_device=iPhone SE (3rd generation)" >> $GITHUB_ENV + fi + - name: Checkout Repo + uses: actions/checkout@v3 - name: Bundle install run: bundle install @@ -22,6 +34,5 @@ jobs: run: sh make.sh --bundle-id co.nimblehq.template --bundle-id-staging co.nimblehq.template.staging --project-name TemplateApp --interface UIKit - name: Build and Test - run: bundle exec fastlane buildAndTest - env: - CI: true + run: | + bundle exec fastlane buildAndTest --swift_server_port ${{ env.runner_port }} diff --git a/.github/workflows/test_upload_build_to_firebase.yml b/.github/workflows/test_upload_build_to_firebase.yml index 39194acd..29b16c8c 100644 --- a/.github/workflows/test_upload_build_to_firebase.yml +++ b/.github/workflows/test_upload_build_to_firebase.yml @@ -17,8 +17,19 @@ concurrency: jobs: build: name: Build - runs-on: macOS-latest + runs-on: self-hosted steps: + - name: Determine Runner Port + id: runner_port + run: | + last_char=$(echo "${{ runner.name }}" | tail -c 2 | head -c 1) + if [ "$last_char" = "1" ]; then + echo "runner_port=2000" >> $GITHUB_ENV + echo "test_device=iPhone 14 Pro Max" >> $GITHUB_ENV + else + echo "runner_port=2001" >> $GITHUB_ENV + echo "test_device=iPhone SE (3rd generation)" >> $GITHUB_ENV + fi - name: Checkout Repo uses: actions/checkout@v3 with: @@ -57,15 +68,18 @@ jobs: TEAM_ID: ${{ secrets.TEAM_ID }} - name: Set Up Test Project for Firebase - run: bundle exec fastlane setUpTestProject + run: | + bundle exec fastlane setUpTestProject --swift_server_port ${{ env.runner_port }} - name: Sync Ad Hoc Code Signing - run: bundle exec fastlane syncAdHocStagingCodeSigning + run: | + bundle exec fastlane syncAdHocStagingCodeSigning --swift_server_port ${{ env.runner_port }} env: MATCH_PASSWORD: ${{ secrets.MATCH_PASS }} - name: Build App and Distribute to Firebase - run: bundle exec fastlane buildStagingAndUploadToFirebase + run: | + bundle exec fastlane buildStagingAndUploadToFirebase --swift_server_port ${{ env.runner_port }} env: FIREBASE_TOKEN: ${{ secrets.FIREBASE_TOKEN }} diff --git a/.github/workflows/test_upload_build_to_test_flight.yml b/.github/workflows/test_upload_build_to_test_flight.yml index 1606fdab..7fbcceb2 100644 --- a/.github/workflows/test_upload_build_to_test_flight.yml +++ b/.github/workflows/test_upload_build_to_test_flight.yml @@ -19,8 +19,19 @@ concurrency: jobs: build: name: Build - runs-on: macOS-latest + runs-on: self-hosted steps: + - name: Determine Runner Port + id: runner_port + run: | + last_char=$(echo "${{ runner.name }}" | tail -c 2 | head -c 1) + if [ "$last_char" = "1" ]; then + echo "runner_port=2000" >> $GITHUB_ENV + echo "test_device=iPhone 14 Pro Max" >> $GITHUB_ENV + else + echo "runner_port=2001" >> $GITHUB_ENV + echo "test_device=iPhone SE (3rd generation)" >> $GITHUB_ENV + fi - name: Checkout Repo uses: actions/checkout@v3 with: @@ -55,15 +66,18 @@ jobs: TEAM_ID: ${{ secrets.TEAM_ID }} - name: Set Up Test Project for App Store - run: bundle exec fastlane setUpTestProject + run: | + bundle exec fastlane setUpTestProject --swift_server_port ${{ env.runner_port }} - name: Sync App Store Code Signing - run: bundle exec fastlane syncAppStoreCodeSigning + run: | + bundle exec fastlane syncAppStoreCodeSigning --swift_server_port ${{ env.runner_port }} env: MATCH_PASSWORD: ${{ secrets.MATCH_PASS }} - name: Build App and Distribute to AppStore - run: bundle exec fastlane buildAndUploadToAppStore + run: | + bundle exec fastlane buildAndUploadToAppStore --swift_server_port ${{ env.runner_port }} env: APPSTORE_CONNECT_API_KEY: ${{ secrets.APPSTORE_CONNECT_API_KEY }} API_KEY_ID: ${{ secrets.API_KEY_ID }}