Skip to content

DRAFT - Verify builds work before PRs are merged #10596

DRAFT - Verify builds work before PRs are merged

DRAFT - Verify builds work before PRs are merged #10596

Workflow file for this run

#
# Lint and Unit Test jobs that runs our lint:ci and test npm scripts
#
name: '[Code Quality] Code Checks'
on:
pull_request:
push:
branches:
- main
- develop
- 'release/v**'
defaults:
run:
working-directory: VAMobile
jobs:
lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version-file: 'VAMobile/.nvmrc'
- name: Install dependencies
uses: nick-fields/retry@v2
with:
timeout_minutes: 10
max_attempts: 3
command: cd VAMobile && yarn install --frozen-lockfile --non-interactive
- run: yarn lint:ci
test:
runs-on: ubuntu-4-cores-latest
strategy:
matrix:
chunk: [1, 2, 3, 4, 5] # Array of chunks we want to split the tests into
fail-fast: false
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version-file: 'VAMobile/.nvmrc'
- name: Install dependencies
uses: nick-fields/retry@v2
with:
timeout_minutes: 10
max_attempts: 3
command: cd VAMobile && yarn install --frozen-lockfile --non-interactive
- name: yarn test
# GHA does not have test splitting built in, so we run this script to split our tests into chunks and run
# jest with the specified files. The number at the end is the # of chunks we're splitting the tests into.
# This should match the numbers of items in the matrix chunk array above
run: bash ${GITHUB_WORKSPACE}/.github/scripts/setupTestMatrix.sh ${{ matrix.chunk }} 5
bundle_android:
runs-on: ubuntu-4-cores-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version-file: 'VAMobile/.nvmrc'
- name: Install dependencies
uses: nick-fields/retry@v2
with:
timeout_minutes: 10
max_attempts: 3
command: cd VAMobile && yarn install --frozen-lockfile --non-interactive
- run: yarn bundle:android
bundle_ios:
runs-on: macos-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version-file: 'VAMobile/.nvmrc'
- name: Install dependencies
uses: nick-fields/retry@v2
with:
timeout_minutes: 10
max_attempts: 3
command: cd VAMobile && yarn install --frozen-lockfile --non-interactive
- run: yarn pods && yarn bundle:ios