<commit_before>name: iOS Client

on:
  workflow_dispatch:
    inputs:
      releaseSimulator:
        description: 'type "release-simulator" to confirm upload'
        required: false
  pull_request:
    branches: [ master ]
    paths:
      - .github/workflows/client-ios.yml
      - ios/**
      - tools/expotools/**
      - secrets/**
      - fastlane/**
      - Gemfile.lock
      - .ruby-version
  push:
    branches: [ master, sdk-* ]
    paths:
      - .github/workflows/client-ios.yml
      - ios/**
      - tools/expotools/**
      - secrets/**
      - fastlane/**
      - Gemfile.lock
      - .ruby-version

jobs:
  build:
    runs-on: macos-10.15
    steps:
      - uses: actions/checkout@v2
        with:
          submodules: true
          lfs: true
      - run: brew install git-crypt
      - name: decrypt secrets if possible
        env:
          GIT_CRYPT_KEY_BASE64: ${{ secrets.GIT_CRYPT_KEY_BASE64 }}
        run: |
          if [[ ${GIT_CRYPT_KEY_BASE64:-unset} = unset ]]; then
            echo 'git-crypt key not present in environment'
          else
            git crypt unlock <(echo $GIT_CRYPT_KEY_BASE64 | base64 --decode)
          fi
      - run: echo "::add-path::$(pwd)/bin"
      - run: expotools ios-generate-dynamic-macros
      - uses: ruby/setup-ruby@v1
      - name: bundler cache
        uses: actions/cache@v1
        with:
          path: vendor/bundle
          key: ${{ runner.os }}-gems-${{ hashFiles('.ruby-version') }}-${{ hashFiles('Gemfile.lock') }}
          restore-keys: |
            ${{ runner.os }}-gems-
      - run: echo "::set-env name=BUNDLE_BIN::$(pwd)/.direnv/bin"
      - run: echo "::add-path::$BUNDLE_BIN"
      - name: install fastlane
        run: |
          bundle config path vendor/bundle
          bundle install --jobs 4 --retry 3
      - run: expotools client-build --platform ios
        timeout-minutes: 60
      - name: Save test results
        if: always()
        uses: actions/upload-artifact@v2
        with:
          name: fastlane-logs
          path: ~/Library/Logs/fastlane
      - run: expotools client-build --platform ios --release # should only upload already-built app
        if: ${{ github.event.inputs.releaseSimulator == 'release-simulator' }}
      - uses: 8398a7/action-slack@v3
        if: failure() && (github.event.ref == 'refs/heads/master' || startsWith(github.event.ref, 'refs/heads/sdk-'))
        env:
          GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
          SLACK_WEBHOOK_URL: ${{ secrets.slack_webhook_ios }}<commit_msg>[ci] Fix iOS client build (#9530)<commit_after>name: iOS Client

on:
  workflow_dispatch:
    inputs:
      releaseSimulator:
        description: 'type "release-simulator" to confirm upload'
        required: false
  pull_request:
    branches: [master]
    paths:
      - .github/workflows/client-ios.yml
      - ios/**
      - tools/expotools/**
      - secrets/**
      - fastlane/**
      - Gemfile.lock
      - .ruby-version
  push:
    branches: [master, sdk-*]
    paths:
      - .github/workflows/client-ios.yml
      - ios/**
      - tools/expotools/**
      - secrets/**
      - fastlane/**
      - Gemfile.lock
      - .ruby-version

jobs:
  build:
    runs-on: macos-10.15
    steps:
      - uses: actions/checkout@v2
        with:
          submodules: true
          lfs: true
      - run: brew install git-crypt
      - name: decrypt secrets if possible
        env:
          GIT_CRYPT_KEY_BASE64: ${{ secrets.GIT_CRYPT_KEY_BASE64 }}
        run: |
          if [[ ${GIT_CRYPT_KEY_BASE64:-unset} = unset ]]; then
            echo 'git-crypt key not present in environment'
          else
            git crypt unlock <(echo $GIT_CRYPT_KEY_BASE64 | base64 --decode)
          fi
      - run: echo "::add-path::$(pwd)/bin"
      - run: expotools ios-generate-dynamic-macros
      - uses: ruby/setup-ruby@v1
      - name: bundler cache
        uses: actions/cache@v1
        with:
          path: vendor/bundle
          key: ${{ runner.os }}-gems-${{ hashFiles('.ruby-version') }}-${{ hashFiles('Gemfile.lock') }}
          restore-keys: |
            ${{ runner.os }}-gems-
      - run: echo "::set-env name=BUNDLE_BIN::$(pwd)/.direnv/bin"
      - run: echo "::add-path::$BUNDLE_BIN"
      - name: install fastlane
        run: |
          bundle config path vendor/bundle
          bundle install --jobs 4 --retry 3
      - run: expotools client-build --platform ios
        timeout-minutes: 60
        env:
          AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
          AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
      - name: Save test results
        if: always()
        uses: actions/upload-artifact@v2
        with:
          name: fastlane-logs
          path: ~/Library/Logs/fastlane
      - run: expotools client-build --platform ios --release # should only upload already-built app
        if: ${{ github.event.inputs.releaseSimulator == 'release-simulator' }}
        env:
          AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
          AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
      - uses: 8398a7/action-slack@v3
        if: failure() && (github.event.ref == 'refs/heads/master' || startsWith(github.event.ref, 'refs/heads/sdk-'))
        env:
          GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
          SLACK_WEBHOOK_URL: ${{ secrets.slack_webhook_ios }}
{'fraction_non_alphanumeric': 0.13155935988090808, 'fraction_numerical': 0.011164867882396725, 'mean_word_length': 1.930752453653217, 'pattern_counts': {'":': 6, '<': 5, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3690775', 'n_tokens_mistral': 1814, 'n_tokens_neox': 1732, 'n_words': 365}