chore: fix macos ci (#2501)

# Summary

Merge `macos-build-test-paper.yml` and `macos-build-test-fabric.yml`
into one `macos-build-test.yml`
This commit is contained in:
Jakub Grzywacz
2024-10-23 12:40:10 +02:00
committed by GitHub
parent 3aebbb22fd
commit 7d083b4ef4
4 changed files with 29 additions and 92 deletions

View File

@@ -1,73 +0,0 @@
name: Test fabric macOS build
on:
pull_request:
paths:
- .github/workflows/macos-build-test.yml
- RNSVG.podspec
- apple/**
- macos-example/package.json
- macos-example/macos/**
- src/fabric/**
- package.json
push:
branches:
- main
jobs:
build:
if: github.repository == 'software-mansion/react-native-svg'
runs-on: macos-14
strategy:
matrix:
working-directory: [fabric-macos-example]
fail-fast: false
concurrency:
group: macos-${{ matrix.working-directory }}-${{ github.ref }}
cancel-in-progress: true
steps:
- name: Check out Git repository
uses: actions/checkout@v3
- name: Restore react-native-svg node_modules from cache
uses: actions/cache@v3
with:
path: node_modules
key: ${{ runner.os }}-node-modules-svg-${{ hashFiles('yarn.lock') }}
restore-keys: ${{ runner.os }}-node-modules-svg-
- name: Install react-native-svg node_modules
run: yarn install --frozen-lockfile
- name: Restore app node_modules from cache
uses: actions/cache@v3
with:
path: ${{ matrix.working-directory }}/node_modules
key: ${{ runner.os }}-node-modules-${{ matrix.working-directory }}-${{ hashFiles(format('{0}/yarn.lock', matrix.working-directory)) }}
restore-keys: ${{ runner.os }}-node-modules-${{ matrix.working-directory }}-
- name: Install app node_modules
working-directory: ${{ matrix.working-directory }}
run: yarn install --frozen-lockfile
- name: Restore Pods from cache
uses: actions/cache@v3
with:
path: |
${{ matrix.working-directory }}/macos/Pods
~/Library/Caches/CocoaPods
~/.cocoapods
key: ${{ runner.os }}-pods-${{ matrix.working-directory }}-${{ hashFiles(format('{0}/macos/Podfile.lock', matrix.working-directory)) }}
- name: Install Pods
working-directory: ${{ matrix.working-directory }}/macos
run: bundle install && RCT_NEW_ARCH_ENABLED=1 bundle exec pod install
- name: Restore build artifacts from cache
uses: actions/cache@v3
with:
path: ~/Library/Developer/Xcode/DerivedData
key: ${{ runner.os }}-macos-derived-data-${{ matrix.working-directory }}-${{ hashFiles(format('{0}/macos/Podfile.lock', matrix.working-directory)) }}
- name: Build app
working-directory: ${{ matrix.working-directory }}
run: yarn macos

View File

@@ -1,14 +1,16 @@
name: Test paper macOS build
name: Example macOS check
on:
pull_request:
paths:
- .github/workflows/macos-build-test.yml
- RNSVG.podspec
- apple/**
- macos-example/package.json
- macos-example/macos/**
- src/fabric/**
- package.json
- paper-macos-example/package.json
- paper-macos-example/ios/**
- fabric-macos-example/package.json
- fabric-macos-example/ios/**
push:
branches:
- main
@@ -19,27 +21,32 @@ jobs:
runs-on: macos-14
strategy:
matrix:
working-directory: [paper-macos-example]
working-directory: [paper-macos-example, fabric-macos-example]
fail-fast: false
concurrency:
group: macos-${{ matrix.working-directory }}-${{ github.ref }}
cancel-in-progress: true
steps:
- name: Check out Git repository
uses: actions/checkout@v3
- name: Checkout Git repository
uses: actions/checkout@v4
- name: Restore react-native-svg node_modules from cache
uses: actions/cache@v3
- name: Use latest stable Xcode
uses: maxim-lobanov/setup-xcode@v1
with:
xcode-version: latest-stable
- name: Get react-native-svg node_modules cache
uses: actions/cache@v4
with:
path: node_modules
key: ${{ runner.os }}-node-modules-svg-${{ hashFiles('yarn.lock') }}
restore-keys: ${{ runner.os }}-node-modules-svg-
- name: Install react-native-svg node_modules
run: yarn install --frozen-lockfile
run: yarn install --frozen-lockfile
- name: Restore app node_modules from cache
uses: actions/cache@v3
- name: Get app node_modules cache
uses: actions/cache@v4
with:
path: ${{ matrix.working-directory }}/node_modules
key: ${{ runner.os }}-node-modules-${{ matrix.working-directory }}-${{ hashFiles(format('{0}/yarn.lock', matrix.working-directory)) }}
@@ -49,21 +56,20 @@ jobs:
working-directory: ${{ matrix.working-directory }}
run: yarn install --frozen-lockfile
- name: Restore Pods from cache
uses: actions/cache@v3
- name: Get Pods cache
uses: actions/cache@v4
with:
path: |
${{ matrix.working-directory }}/macos/Pods
~/Library/Caches/CocoaPods
~/.cocoapods
path: ${{ matrix.working-directory }}/macos/Pods
key: ${{ runner.os }}-pods-${{ matrix.working-directory }}-${{ hashFiles(format('{0}/macos/Podfile.lock', matrix.working-directory)) }}
restore-keys: |
${{ runner.os }}-pods-${{ matrix.working-directory }}-
- name: Install Pods
working-directory: ${{ matrix.working-directory }}/macos
run: bundle install && bundle exec pod install
- name: Restore build artifacts from cache
uses: actions/cache@v3
- name: Get build artifacts cache
uses: actions/cache@v4
with:
path: ~/Library/Developer/Xcode/DerivedData
key: ${{ runner.os }}-macos-derived-data-${{ matrix.working-directory }}-${{ hashFiles(format('{0}/macos/Podfile.lock', matrix.working-directory)) }}

View File

@@ -1,6 +1,8 @@
require_relative '../node_modules/react-native-macos/scripts/react_native_pods'
require_relative '../node_modules/@react-native-community/cli-platform-ios/native_modules'
ENV['RCT_NEW_ARCH_ENABLED'] = '1'
prepare_react_native_project!
target 'FabricMacOSExample-macOS' do

View File

@@ -1,6 +1,8 @@
require_relative '../node_modules/react-native-macos/scripts/react_native_pods'
require_relative '../node_modules/@react-native-community/cli-platform-ios/native_modules'
ENV['RCT_NEW_ARCH_ENABLED'] = '0'
prepare_react_native_project!
target 'PaperMacOSExample-macOS' do