Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: use yarn with cli env #471

Closed
wants to merge 3 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 14 additions & 12 deletions .github/workflows/build-templates.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,8 @@ jobs:
fail-fast: false
matrix:
os:
- ubuntu
- macos
- ubuntu-20.04
- macos-12
type:
- module-legacy
- module-mixed
Expand All @@ -37,9 +37,9 @@ jobs:
- kotlin-objc
- kotlin-swift
exclude:
- os: macos
- os: macos-12
language: kotlin-objc
- os: macos
- os: macos-12
language: kotlin-swift
- type: module-new
language: java-swift
Expand All @@ -58,33 +58,33 @@ jobs:
- type: view-mixed
language: kotlin-swift
include:
- os: ubuntu
- os: ubuntu-20.04
type: library
language: js
- os: ubuntu
- os: ubuntu-20.04
type: module-legacy
language: cpp
- os: ubuntu
- os: ubuntu-20.04
type: module-mixed
language: cpp
- os: ubuntu
- os: ubuntu-20.04
type: module-new
language: cpp
- os: macos
- os: macos-12
type: module-legacy
language: cpp
- os: macos
- os: macos-12
type: module-mixed
language: cpp
- os: macos
- os: macos-12
type: module-new
language: cpp

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}-${{ matrix.os }}-${{ matrix.type }}-${{ matrix.language }}
cancel-in-progress: true

runs-on: ${{ matrix.os }}-latest
runs-on: ${{ matrix.os }}

steps:
- name: Checkout
Expand All @@ -102,6 +102,8 @@ jobs:
echo "work_dir=${{ matrix.os }}-${{ matrix.type }}-${{ matrix.language }}" >> $GITHUB_ENV

- name: Create library
env:
USE_YARN: 1
run: |
rm -rf ${{ env.work_dir }} # Workaround for tests failing intermittently
./packages/create-react-native-library/bin/create-react-native-library ${{ env.work_dir }} \
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -79,11 +79,19 @@ export default async function generateExampleApp({
'--version',
reactNativeVersion,
'--skip-install',
'--npm',
]
: // `npx create-expo-app example --no-install`
['create-expo-app@latest', directory, '--no-install'];

if (type === 'native') {
if (!process.env.USE_YARN) {
console.debug('Using React Native CLI with npm to create example app');
args.push('--npm');
} else {
console.debug('Using React Native CLI with Yarn to create example app');
}
}

await spawn('npx', args, {
cwd: dest,
env: { ...process.env, npm_config_yes: 'true' },
Expand Down
Loading