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

Container action is only supported on Linux #33

Open
NatMuel opened this issue Mar 3, 2022 · 0 comments
Open

Container action is only supported on Linux #33

NatMuel opened this issue Mar 3, 2022 · 0 comments

Comments

@NatMuel
Copy link

NatMuel commented Mar 3, 2022

We are using GitHub Actions for build testing a React Native app. We were able to setup amplify-cli-action for Ubuntu, but receive an error for the IOS build (Container action is only supported on Linux). Is there a workaround available or do you have any recommended workarounds without committing aws-exports? Using configure-aws-credentials@v1 didn't help with pulling the amplify env on IOS.

The IOS fails with this error:

Running script 'Bundle React Native code and images'
[56774](https://github.com/NatMuel/nv-app/runs/5375799701?check_suite_focus=true#step:10:56774)
    the transform cache was reset.
[56775](https://github.com/NatMuel/nv-app/runs/5375799701?check_suite_focus=true#step:10:56775)
▸ Generating 'nv.app.dSYM'
[56776](https://github.com/NatMuel/nv-app/runs/5375799701?check_suite_focus=true#step:10:56776)
** ARCHIVE FAILED **
[56777](https://github.com/NatMuel/nv-app/runs/5375799701?check_suite_focus=true#step:10:56777)

[56778](https://github.com/NatMuel/nv-app/runs/5375799701?check_suite_focus=true#step:10:56778)

[56779](https://github.com/NatMuel/nv-app/runs/5375799701?check_suite_focus=true#step:10:56779)
The following build commands failed:
[56780](https://github.com/NatMuel/nv-app/runs/5375799701?check_suite_focus=true#step:10:56780)
    PhaseScriptExecution Bundle\ React\ Native\ code\ and\ images /Users/runner/Library/Developer/Xcode/DerivedData/nv-fzyesrwyhhxkypeuggwsyqhsoket/Build/Intermediates.noindex/ArchiveIntermediates/nv/IntermediateBuildFilesPath/nv.build/Release-iphoneos/nv/Script-00DD1BFF1BD5951E006B06BC.sh (in target 'nv' from project 'nv')

build-test-ios-android.yml

name: Build Android & iOS

    Triggered when code is pushed to specified branches in a repository
    on: 
      push:
        branches:
          - main
          - release
          - dev
    
    concurrency: 
      group: ${{ github.ref }}
      cancel-in-progress: true

jobs:
    build-ios:
        runs-on: macos-latest
    
    steps:
        - uses: actions/checkout@v2
        - name: Use Node.js
          uses: actions/setup-node@v1
          with:
              node-version: 14.x
        - uses: actions/cache@v2
          with:
              path: node_modules
              key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
              restore-keys: |
                  ${{ runner.os }}-yarn-
        - uses: actions/cache@v2
          with:
              path: ~/Library/Caches/CocoaPods
              key: ${{ runner.os }}-pods-${{ hashFiles('**/Podfile.lock') }}
              restore-keys: |
                  ${{ runner.os }}-pods-
        - uses: actions/cache@v2
          with:
              path: ~/.cocoapods
              key: ${{ runner.os }}-pods-${{ hashFiles('**/Podfile.lock') }}
              restore-keys: |
                  ${{ runner.os }}-pods-
        - name: Configure AWS credentials
          id: creds
          uses: aws-actions/configure-aws-credentials@v1
          with:
            aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }}
            aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
            aws-region: eu-central-1

        - run: yarn install --frozen-lockfile --network-timeout 1000000

        - run: xcode-select -p # ensure readiness of xcode https://ariya.io/2020/12/continuous-integration-for-react-native-apps-with-github-actions

        - run: pod install
          working-directory: ios
        
        # - run: ./scripts/amplify-configure.sh
        # We need set -o pipefail; to ensure errors get propagated correctly and we still get the prettified output with xcpretty
        - run: "set -o pipefail; xcodebuild \
              clean archive \
              -workspace nv.xcworkspace \
              -scheme nv \
              -archivePath nv.xcarchive \
              CODE_SIGNING_ALLOWED=NO | xcpretty"
          working-directory: ios

  build-android:
    runs-on: ubuntu-latest
    steps:
        - uses: actions/checkout@v2

        # Gradle Cache https://github.com/actions/cache/blob/main/examples.md#java---gradle
        - uses: actions/cache@v2
          with:
              path: |
                  ~/.gradle/caches
                  ~/.gradle/wrapper
              key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle*') }}
              restore-keys: |
                  ${{ runner.os }}-gradle-
        # Yarn Cache: https://github.com/actions/cache/blob/master/examples.md#node---yarn
        - name: Get yarn cache directory path
          id: yarn-cache-dir-path
          run: echo "::set-output name=dir::$(yarn cache dir)"
        - uses: actions/cache@v2
          id: yarn-cache
          with:
              path: ${{ steps.yarn-cache-dir-path.outputs.dir }}
              key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
              restore-keys: |
                  ${{ runner.os }}-yarn-
        - name: configure amplify
          uses: ambientlight/amplify-cli-action@0.3.0
          with:
            amplify_cli_version: 7.6.22
            amplify_command: configure
            amplify_env: dev
          env:
            AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
            AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
            AWS_REGION: eu-central-1

        - name: Install node dependencies
          run: yarn install --frozen-lockfile

        # - name: Bundle *.aap & *.apk
        #   run: cd android && ./gradlew bundleRelease assembleRelease
        - run: ./gradlew -v
          working-directory: android
        - run: ./gradlew assembleRelease --no-daemon --warning-mode all
          working-directory: android
          name: Build Android apk (debug)

        - name: Upload Artifact
          uses: actions/upload-artifact@v1
          with:
              name: Apk
              path: android/app/build/outputs/apk/release/app-release.apk`
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant