Skip to content

Commit

Permalink
ci: build new architecture for mixed templates (#614)
Browse files Browse the repository at this point in the history
  • Loading branch information
satya164 authored Aug 16, 2024
1 parent 8edf590 commit a4450d2
Show file tree
Hide file tree
Showing 2 changed files with 40 additions and 6 deletions.
44 changes: 38 additions & 6 deletions .github/workflows/build-templates.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,8 @@ jobs:
language:
- kotlin-objc
- kotlin-swift
arch:
- auto
exclude:
- type: module-new
language: kotlin-swift
Expand All @@ -52,27 +54,50 @@ jobs:
- os: ubuntu-latest
type: library
language: js
arch: auto
- os: ubuntu-latest
type: module-mixed
language: kotlin-objc
arch: new
- os: macos-14
type: module-mixed
language: kotlin-objc
arch: new
- os: ubuntu-latest
type: view-mixed
language: kotlin-objc
arch: new
- os: macos-14
type: view-mixed
language: kotlin-objc
arch: new
- os: ubuntu-latest
type: module-legacy
language: cpp
arch: auto
- os: ubuntu-latest
type: module-mixed
language: cpp
arch: auto
- os: ubuntu-latest
type: module-new
language: cpp
arch: auto
- os: macos-14
type: module-legacy
language: cpp
arch: auto
- os: macos-14
type: module-mixed
language: cpp
arch: auto
- os: macos-14
type: module-new
language: cpp
arch: auto

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

runs-on: ${{ matrix.os }}
Expand All @@ -84,13 +109,20 @@ jobs:
- name: Setup
uses: ./.github/actions/setup

- name: Set environment variables
run: |
if [[ "${{ matrix.arch }}" == "new" ]]; then
echo "RCT_NEW_ARCH_ENABLED=1" >> $GITHUB_ENV
echo "ORG_GRADLE_PROJECT_newArchEnabled=true" >> $GITHUB_ENV
fi
- name: Build package
run: |
yarn workspace create-react-native-library prepare
- name: Get working directory
run: |
echo "work_dir=${{ matrix.os }}-${{ matrix.type }}-${{ matrix.language }}" >> $GITHUB_ENV
echo "work_dir=${{ matrix.os }}-${{ matrix.type }}-${{ matrix.language }}-${{ matrix.arch }}" >> $GITHUB_ENV
- name: Create library
run: |
Expand Down Expand Up @@ -158,9 +190,9 @@ jobs:
with:
path: |
${{ env.work_dir }}/.turbo
key: ${{ runner.os }}-library-turborepo-${{ matrix.type }}-${{ matrix.language }}-${{ hashFiles(format('{0}/yarn.lock', env.work_dir)) }}
key: ${{ runner.os }}-library-turborepo-${{ matrix.type }}-${{ matrix.language }}-${{ matrix.arch }}-${{ hashFiles(format('{0}/yarn.lock', env.work_dir)) }}
restore-keys: |
${{ runner.os }}-library-turborepo-${{ matrix.type }}-${{ matrix.language }}-
${{ runner.os }}-library-turborepo-${{ matrix.type }}-${{ matrix.language }}-${{ matrix.arch }}-
- name: Check turborepo cache
if: env.android_build == 1 || env.ios_build == 1
Expand Down Expand Up @@ -248,13 +280,13 @@ jobs:
${{ runner.os }}-library-cocoapods-
- name: Install cocoapods
env:
NO_FLIPPER: 1
if: env.ios_build == 1 && env.turbo_cache_hit_ios != 1 && steps.library-cocoapods-cache.outputs.cache-hit != 'true'
working-directory: ${{ env.work_dir }}
run: |
cd example/ios
pod install
env:
NO_FLIPPER: 1
- name: Build example (iOS)
if: env.ios_build == 1
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
"pipeline": {
<% if (example !== 'expo') { -%>
"build:android": {
"env": ["ORG_GRADLE_PROJECT_newArchEnabled"],
"inputs": [
"package.json",
"android",
Expand All @@ -18,6 +19,7 @@
"outputs": []
},
"build:ios": {
"env": ["RCT_NEW_ARCH_ENABLED"],
"inputs": [
"package.json",
"*.podspec",
Expand Down

0 comments on commit a4450d2

Please sign in to comment.