CLI #5
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: CLI | |
on: | |
push: | |
branches: [main, 'sdk-*'] | |
paths: | |
- .github/workflows/cli.yml | |
- packages/@expo/cli/** | |
- packages/@expo/metro-runtime/** | |
- packages/@expo/metro-config/src/** | |
- packages/@expo/config/src/** | |
- packages/@expo/config-plugins/src/** | |
- packages/@expo/env/src/** | |
- packages/@expo/json-file/src/** | |
- packages/@expo/package-manager/src/** | |
- packages/@expo/prebuild-config/src/** | |
- packages/@expo/server/src/** | |
- packages/create-expo/** | |
- packages/expo-router/** | |
- yarn.lock | |
pull_request: | |
paths: | |
- .github/workflows/cli.yml | |
- packages/@expo/cli/** | |
- packages/@expo/metro-runtime/** | |
- packages/@expo/metro-config/src/** | |
- packages/@expo/config/src/** | |
- packages/@expo/config-plugins/src/** | |
- packages/@expo/env/src/** | |
- packages/@expo/json-file/src/** | |
- packages/@expo/package-manager/src/** | |
- packages/@expo/prebuild-config/src/** | |
- packages/@expo/server/src/** | |
- packages/create-expo/** | |
- packages/expo-router/** | |
- yarn.lock | |
schedule: | |
- cron: 0 14 * * * | |
concurrency: | |
group: ${{ github.workflow }}-${{ github.event_name }}-${{ github.ref }} | |
cancel-in-progress: true | |
jobs: | |
test: | |
runs-on: ubuntu-22.04 | |
strategy: | |
fail-fast: false | |
matrix: | |
shard: [1, 2, 3] | |
steps: | |
- name: 👀 Checkout | |
uses: actions/checkout@v4 | |
with: | |
fetch-depth: 100 | |
- uses: actions/setup-node@v3 | |
with: | |
node-version: 18 | |
- name: ⬇️ Fetch commits from base branch | |
run: git fetch origin ${{ github.event.before || github.base_ref || 'main' }}:${{ github.event.before || github.base_ref || 'main' }} --depth 100 | |
if: github.event_name == 'pull_request' || github.event_name == 'workflow_dispatch' | |
- name: ♻️ Restore Yarn Cache | |
uses: actions/cache@v4 | |
with: | |
path: ~/.cache/yarn | |
key: ${{ runner.os }}-yarn-${{ hashFiles('yarn.lock') }} | |
restore-keys: | | |
${{ runner.os }}-yarn- | |
- name: 🧶 Install node modules in root dir | |
run: YARN_IGNORE_SCRIPTS=true yarn install --prefer-offline --frozen-lockfile | |
- name: Build Expo CLI | |
run: yarn workspace @expo/cli prepare | |
- name: 🏗️ Setup Bun | |
uses: oven-sh/setup-bun@v1 | |
with: | |
# Version `1.x` fails due to https://github.com/oven-sh/setup-bun/issues/37 | |
# TODO(cedric): swap `latest` back once the issue is resolved | |
bun-version: latest | |
- name: 🔎 Type Check CLI | |
run: yarn typecheck | |
working-directory: packages/@expo/cli | |
- name: E2E Test CLI | |
run: yarn test:e2e --shard ${{ matrix.shard }}/${{ strategy.job-total }} | |
working-directory: packages/@expo/cli | |
web: | |
runs-on: ubuntu-22.04 | |
steps: | |
- name: 👀 Checkout | |
uses: actions/checkout@v4 | |
with: | |
fetch-depth: 100 | |
- uses: actions/setup-node@v3 | |
with: | |
node-version: 18 | |
- name: ⬇️ Fetch commits from base branch | |
run: git fetch origin ${{ github.event.before || github.base_ref || 'main' }}:${{ github.event.before || github.base_ref || 'main' }} --depth 100 | |
if: github.event_name == 'pull_request' || github.event_name == 'workflow_dispatch' | |
- name: 🏗️ Setup Bun | |
uses: oven-sh/setup-bun@v1 | |
with: | |
bun-version: latest | |
- name: ♻️ Restore Yarn Cache | |
uses: actions/cache@v4 | |
with: | |
path: ~/.cache/yarn | |
key: ${{ runner.os }}-yarn-${{ hashFiles('yarn.lock') }} | |
restore-keys: | | |
${{ runner.os }}-yarn- | |
- name: 🧶 Install node modules in root dir | |
run: YARN_IGNORE_SCRIPTS=true yarn install --prefer-offline --frozen-lockfile | |
- name: Build Expo CLI | |
run: yarn workspace @expo/cli prepare | |
- name: 🎭 Get installed Playwright version for cache key | |
run: echo "PLAYWRIGHT_VERSION=$(npm info @playwright/test version)" >> $GITHUB_ENV | |
- name: 🎭 Cache Playwright browser binaries | |
uses: actions/cache@v4 | |
id: playwright-browser-cache | |
with: | |
path: | | |
~/.cache/ms-playwright | |
key: ${{ runner.os }}-playwright-${{ env.PLAYWRIGHT_VERSION }} | |
- name: 🎭 Install Playwright Browsers | |
run: bun playwright install --with-deps chromium | |
working-directory: packages/@expo/cli | |
if: steps.playwright-browser-cache.outputs.cache-hit != 'true' | |
- name: E2E (playwright) Test CLI | |
run: yarn test:playwright | |
working-directory: packages/@expo/cli | |
- uses: actions/upload-artifact@v4 | |
if: always() | |
with: | |
name: playwright-report | |
path: packages/@expo/cli/playwright-report/ | |
retention-days: 30 |