department-of-veterans-affairs / va-mobile-app

"If VA were a company, it would have a flagship mobile app."
https://department-of-veterans-affairs.github.io/va-mobile-app/
17 stars 2 forks source link

Add PR Status checks for App Store Requirements #10226

Open lexicalninja opened 1 day ago

lexicalninja commented 1 day ago

Description of Change

This PR adds two workflows for app store checks and a reusable workflow that checks max size/len of something with a variable bash function:

Google Play checks

checks the following limits for the store:

  1. 8 or less images in the VAMobile/android/fastlane/metadata/android/en-US/images/phoneScreenshots directory
  2. 8 or less images in the VAMobile/android/fastlane/metadata/android/en-US/images/sevenInchScreenshots
  3. LTE 4000 characters in VAMobile/android/fastlane/metadata/android/en-US/full-description.txt
  4. LTE 80 characters in VAMobile/android/fastlane/metadata/android/en-US/short-description.txt
  5. LTE 500 characters in VAMobile/android/fastlane/metadata/android/en-US/changelogs/default.txt
  6. LTE 50 characters in VAMobile/android/fastlane/metadata/android/en-US/title.txt

Apple Store checks

  1. 10 or less images in VAMobile/ios/fastlane/screenshots/en-US that start with ipadProGen2
  2. 10 or less images in VAMobile/ios/fastlane/screenshots/en-US that start with ipadPro13
  3. 10 or less images in VAMobile/ios/fastlane/screenshots/en-US that start with ipadPro129
  4. 10 or less images in VAMobile/ios/fastlane/screenshots/en-US that start with iphone55
  5. 10 or less images in VAMobile/ios/fastlane/screenshots/en-US that start with iphone67
  6. LTE 4000 characters in VAMobile/ios/fastlane/metadata/en-US/description.txt
  7. LTE 4000 characters in VAMobile/ios/fastlane/metadata/en-US/release_notes.txt
  8. LTE 1000 characters in VAMobile/ios/fastlane/metadata/en-US/keywords.txt
  9. LTE 50 characters in VAMobile/ios/fastlane/metadata/en-US/title.txt

Check Max Size workflow

This workflow will check that a bash functions results are less than an indicated amount

on:
  workflow_call:
    inputs:
      working_dir:
        required: true
        type: string
      max_size:
        required: true
        type: string
      file_counting_function:
        required: true
        type: string

jobs:
  check_max_files:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v3
      - run: |
          if [[ $(${{ inputs.file_counting_function }}) -gt ${{ inputs.max_size }} ]]
          then
            echo "PR exceeds app store limits of ${{ inputs.max_size }} for this check"
            exit 1
          fi
        working-directory: ${{ inputs.working_dir }}

counting function can be any bash function available in the base image that returns a number string.

When does this run?

I have set filters on this to only run on PRs to main, develop, and release/v** branches that touch the metadata files with the following path fileters:

I have split this up into two different workflow to just be more efficient in cases where we have not updated both paltforms metadata.

Screenshots/Video

Testing

Tested outputs with both Act CLI runners locally and with a couple of runs on the console

Reviewer Validations

Any questions or suggestions about this

PR Checklist

Reviewer: Confirm the items below as you review

For QA

Run a build for this branch