Skip to content

Commit

Permalink
Merge branch 'develop' into CU/7433-Dylan-AuthMigration
Browse files Browse the repository at this point in the history
  • Loading branch information
Sparowhawk authored Dec 12, 2024
2 parents a6ea1f7 + 608bef9 commit 5211e61
Show file tree
Hide file tree
Showing 127 changed files with 2,366 additions and 1,576 deletions.
4 changes: 2 additions & 2 deletions .github/ISSUE_TEMPLATE/feature-request.yml
Original file line number Diff line number Diff line change
Expand Up @@ -92,9 +92,9 @@ body:
- type: input
id: duedate
attributes:
label: 12.) What is your ideal due date for this change request?
label: 12.) Is there a hard deadline associated with this request?
description:
placeholder: MM/DD/YYYY or Quarter
placeholder: MM/DD/YYYY
validations:
required: true

68 changes: 68 additions & 0 deletions .github/workflows/app_store_checks_apple.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
# workflow to check that PR does not break any Apple App Store max file or max character limits
name: "App Store requirement checks"

on:
pull_request:
branches:
- main
- develop
- 'release/v**'
paths:
- "VAMobile/ios/fastlane/metadata/en-US/**"
- "VAMobile/ios/fastlane/screenshots/**"

jobs:
check_ios_ipad_pro2_images:
uses: ./.github/workflows/check_max_size.yml
with:
max_size: 10
working_dir: VAMobile/ios/fastlane/screenshots/en-US
counting_function: find . -maxdepth 1 -name "ipadPro2*" -printf '.' | wc -m
check_ios_ipad_pro13_images:
uses: ./.github/workflows/check_max_size.yml
with:
max_size: 10
working_dir: VAMobile/ios/fastlane/screenshots/en-US
counting_function: find . -maxdepth 1 -name "ipadPro13*" -printf '.' | wc -m
check_ios_ipad_pro129_images:
uses: ./.github/workflows/check_max_size.yml
with:
max_size: 10
working_dir: VAMobile/ios/fastlane/screenshots/en-US
counting_function: find . -maxdepth 1 -name "ipadPro12*" -printf '.' | wc -m
check_ios_iphone55_images:
uses: ./.github/workflows/check_max_size.yml
with:
max_size: 10
working_dir: VAMobile/ios/fastlane/screenshots/en-US
counting_function: find . -maxdepth 1 -name "phone5*" -printf '.' | wc -m
check_ios_iphone67_images:
uses: ./.github/workflows/check_max_size.yml
with:
max_size: 10
working_dir: VAMobile/ios/fastlane/screenshots/en-US
counting_function: find . -maxdepth 1 -name "iphone6*" -printf '.' | wc -m
check_ios_description:
uses: ./.github/workflows/check_max_size.yml
with:
max_size: 4000
working_dir: VAMobile/ios/fastlane/metadata/en-US
counting_function: wc -c description.txt | awk '{print $1}'
check_ios_release_notes:
uses: ./.github/workflows/check_max_size.yml
with:
max_size: 4000
working_dir: VAMobile/ios/fastlane/metadata/en-US
counting_function: wc -c release_notes.txt | awk '{print $1}'
check_ios_keyword:
uses: ./.github/workflows/check_max_size.yml
with:
max_size: 1000
working_dir: VAMobile/ios/fastlane/metadata/en-US
counting_function: wc -c keywords.txt | awk '{print $1}'
check_ios_title:
uses: ./.github/workflows/check_max_size.yml
with:
max_size: 50
working_dir: VAMobile/ios/fastlane/metadata/en-US
counting_function: wc -c title.txt | awk '{print $1}'
49 changes: 49 additions & 0 deletions .github/workflows/app_store_checks_google.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
# workflow to check that PR does not break any Googke Play Store max file or max character limits
name: "App Store requirement checks"

on:
pull_request:
branches:
- main
- develop
- 'release/v**'
paths:
- "VAMobile/android/fastlane/metadata/android/en-US/**"

jobs:
check_max_android_phone_screenshots:
uses: ./.github/workflows/check_max_size.yml
with:
max_size: 8
working_dir: VAMobile/android/fastlane/metadata/android/en-US/images/phoneScreenshots
counting_function: ls | wc -l
check_max_android_seven_inch_screenshots:
uses: ./.github/workflows/check_max_size.yml
with:
max_size: 8
working_dir: VAMobile/android/fastlane/metadata/android/en-US/images/sevenInchScreenshots
counting_function: ls | wc -l
check_android_long_description:
uses: ./.github/workflows/check_max_size.yml
with:
max_size: 4000
working_dir: VAMobile/android/fastlane/metadata/android/en-US
counting_function: wc -c full-description.txt | awk '{print $1}'
check_android_short_description:
uses: ./.github/workflows/check_max_size.yml
with:
max_size: 80
working_dir: VAMobile/android/fastlane/metadata/android/en-US
counting_function: wc -c short-description.txt | awk '{print $1}'
check_android_change_log:
uses: ./.github/workflows/check_max_size.yml
with:
max_size: 500
working_dir: VAMobile/android/fastlane/metadata/android/en-US/changelogs
counting_function: wc -c default.txt | awk '{print $1}'
check_android_release_name:
uses: ./.github/workflows/check_max_size.yml
with:
max_size: 50
working_dir: VAMobile/android/fastlane/metadata/android/en-US
counting_function: wc -c title.txt | awk '{print $1}'
25 changes: 25 additions & 0 deletions .github/workflows/check_max_size.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
on:
workflow_call:
inputs:
working_dir:
required: true
type: string
max_size:
required: true
type: string
counting_function:
required: true
type: string

jobs:
check_max_files:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- run: |
if [[ $(${{ inputs.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 }}
104 changes: 50 additions & 54 deletions .github/workflows/documentation_accessibility_checks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,77 +8,73 @@ on:

jobs:
axe-scan:
name: Acessibility Check
name: Accessibility Check
runs-on: ubuntu-latest
outputs:
pages_with_errors: ${{ steps.accessibility_check.outputs.pages_with_errors }}
total_errors: ${{ steps.accessibility_check.outputs.total_errors }}
steps:
- uses: actions/checkout@v3
- name: Setup node and restore yarn cache
uses: actions/setup-node@v3
- uses: actions/checkout@v4
- name: Install Axe CLI globally
run: |
npm install @axe-core/cli -g
- uses: actions/setup-node@v4
with:
node-version-file: 'VAMobile/.nvmrc'
cache: 'yarn'
cache-dependency-path: 'VAMobile/yarn.lock'
- name: Clean npm cache
run: npm cache clean --force
- name: Install Axe CLI globally
run: npm install -g @axe-core/cli@latest
- name: Install latest version of chromeDriver
run: npm install -g chromedriver@latest
- name: Run build to generate sitemap
cache: yarn
cache-dependency-path: VAMobile/documentation/yarn.lock
- name: Install ChromeDriver
run: npm install -g chromedriver
- name: Install mobile app modules
working-directory: VAMobile
run: |
yarn install --frozen-lockfile
cd documentation
npx update-browserslist-db@latest
yarn install --frozen-lockfile
yarn build
- name: Start web server
working-directory: VAMobile/documentation
run: npm start & npx wait-on http://localhost:3000 &
run: |
yarn install --frozen-lockfile
yarn build
yarn start &
npx wait-on http://localhost:3000 &
sleep 10
- name: Check accessibility issues
id: accessibility_check
run: |
# Path to the downloaded sitemap file
sitemap_path="VAMobile/documentation/build/sitemap.xml"
# Counter for the number of accessibility issues detected
num_issues=0

# Extract URLs from sitemap and iterate
for url in $(grep -o '<loc>[^<]*' "$sitemap_path" | sed 's/<loc>//'); do
if axe "$url" --chromedriver-path $(npm root -g)/chromedriver/bin/chromedriver --exit; then
echo "No accessibility issues found in $url"
else
echo "Accessibility issues found in $url"
echo "$url" >> accessibility_issues.txt
num_issues=$((num_issues+1))
# Counter for urls with errors
pages_with_errors=0
# Counter for total errors
total_errors=0
for url in $(grep -o '<loc>[^<]*' "$sitemap_path" | sed 's/<loc>//');
do
# save output so that we can send it to std out AND do an operation on it
output=$(axe "$url")
# send output to stdout
echo "${output}"
# regex number of issues NOTE: grep exits 1 if it finds no match. GH Actions exits the runner if anything exits 1 so we add the || true to overcome that
issues=$(echo "${output}" | grep -oP '\d+(?= Accessibility issues detected)' || true)
# If issues is not an empty string, there were issues
if [[ ! -z "$issues" ]]
then
pages_with_errors=$((pages_with_errors + 1))
total_errors=$((total_errors + issues))
fi
done
num_issues_issues=$(grep -c 'Accessibility issues found' accessibility_issues.txt)
echo "Accessibility issues detected: $num_issues"

# Fail the workflow if accessibility issues are detected
if [ "$num_issues" -gt 0 ]; then
echo "Accessibility issues were detected."
exit 1
else
echo "No accessibility issues were found."
fi
# Output to runner
echo "pages_with_errors=$pages_with_errors" >> $GITHUB_OUTPUT
echo "total_errors=$total_errors" >> $GITHUB_OUTPUT
start_slack_thread:
name: Start Slack thread
runs-on: ubuntu-latest
if: ${{ failure() }}
needs: axe-scan
steps:
- name: Notify Slack
env:
SLACK_API_TOKEN: ${{ secrets.SLACK_API_TOKEN }}
channel_name: va-mobile-build-alerts
message: 'Accessibility issues detected. See :thread: or <${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}|workflow run> for results.'
run: |
curl -X POST \
-H "Authorization: Bearer $SLACK_API_TOKEN" \
-H "Content-Type: application/json" \
-d "{\"channel\":\"$channel_name\",\"text\":\"$message\"}" \
https://slack.com/api/chat.postMessage
uses: ./.github/workflows/start_slack_thread.yml
secrets: inherit
with:
channel_name: va-mobile-build-alerts
message: 'Accessibility issues detected in the documentation site. Please review and fix. See :thread: or <${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}|workflow run> for results. Number of pages with errors: ${{ needs.axe-scan.outputs.pages_with_errors }}. Total number of accessibility issues detected: ${{ needs.axe-scan.outputs.total_errors }}'
33 changes: 25 additions & 8 deletions .github/workflows/e2e_android.yml
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@ jobs:

matrix-e2e-android:
if: (!cancelled()) && needs.output_detox_tests_to_run.outputs.output1 != ''
runs-on: macos-latest-xl
runs-on: macos-13
needs: [start_slack_thread, output_detox_tests_to_run]
strategy:
fail-fast: false
Expand Down Expand Up @@ -209,7 +209,22 @@ jobs:
force-avd-creation: false
disable-animations: true
arch: x86_64
avd-name: Pixel_4_XL_API_28
avd-name: Pixel_6_Pro_API_33
script: yarn e2e:android-test /e2e/tests/${{matrix.testsuite}} --updateSnapshot
continue-on-error: true

- name: Run e2e tests for Android - Full Test - Retry
id: run_e2e_tests_full_retry
if: steps.run_e2e_tests.outcome == 'failure'
uses: reactivecircus/android-emulator-runner@v2
with:
working-directory: VAMobile
api-level: 28
profile: pixel_6_pro
force-avd-creation: false
disable-animations: true
arch: x86_64
avd-name: Pixel_6_Pro_API_33
script: yarn e2e:android-test /e2e/tests/${{matrix.testsuite}} --updateSnapshot
continue-on-error: true

Expand All @@ -224,11 +239,13 @@ jobs:
force-avd-creation: false
disable-animations: true
arch: x86_64
avd-name: Pixel_4_XL_API_28
avd-name: Pixel_6_Pro_API_33
script: yarn e2e:android-test /e2e/tests/Navigation.e2e AvailabilityFramework.e2e ${{matrix.testsuite}}.e2e --updateSnapshot
continue-on-error: true

- name: Run e2e tests for Android on failure
if: failure() && steps.run_e2e_tests_nav_AF.outcome == 'failure'
if: steps.run_e2e_tests_nav_AF.outcome == 'failure'
id: run_e2e_tests_retry
uses: reactivecircus/android-emulator-runner@v2
with:
working-directory: VAMobile
Expand All @@ -237,9 +254,9 @@ jobs:
force-avd-creation: false
disable-animations: true
arch: x86_64
avd-name: Pixel_4_XL_API_28
avd-name: Pixel_6_Pro_API_33
script: yarn e2e:android-test /e2e/tests/Navigation.e2e AvailabilityFramework.e2e ${{matrix.testsuite}}.e2e --updateSnapshot

- name: Upload e2e-junit
if: failure() || success()
uses: actions/upload-artifact@v4
Expand All @@ -248,15 +265,15 @@ jobs:
path: VAMobile/e2e/test_reports/e2e-junit.xml

- name: Upload artifacts on failure
if: failure() || steps.run_e2e_tests.outcome == 'failure'
if: failure() || steps.run_e2e_tests_full_retry.outcome == 'failure'
uses: actions/upload-artifact@v4
with:
name: detox-artifacts-${{ runner.os }}-${{ github.run_id }}-${{matrix.testsuite}}
path: VAMobile/artifacts
retention-days: 1

- name: Fail workflow if needed(View e2e step for details)
if: steps.run_e2e_tests.outcome == 'failure'
if: steps.run_e2e_tests_full_retry.outcome == 'failure'
run: exit 1

output-slack-results-and-update-detox-failure-ticket:
Expand Down
Loading

0 comments on commit 5211e61

Please sign in to comment.