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

feat: change ios CI #1831

Merged
merged 1 commit into from
Aug 10, 2022
Merged
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
80 changes: 59 additions & 21 deletions .github/workflows/ios-build-test.yml
Original file line number Diff line number Diff line change
@@ -1,37 +1,75 @@
name: Test iOS build
on:
pull_request:
branches:
- main
paths:
- '.github/workflows/ios-build-test.yml'
- 'RNSVG.podspec'
- 'apple/**'
- 'Example/ios/**'
push:
branches:
- main
workflow_dispatch:

jobs:
build:
runs-on: macos-latest
env:
WORKING_DIRECTORY: Example
runs-on: macos-12
strategy:
matrix:
working-directory: [Example]
concurrency:
group: ios-${{ github.ref }}
cancel-in-progress: true
group: ios-${{ matrix.working-directory }}-${{ github.ref }}
steps:
- name: checkout
- name: Check out Git repository
uses: actions/checkout@v2
- name: Use Node.js 14
uses: actions/setup-node@v2

- name: Restore svg node_modules from cache
uses: actions/cache@v2
id: cache-node-modules-svg
with:
path: |
node_modules
key: ${{ runner.os }}-node-modules-svg-${{ hashFiles('yarn.lock') }}
restore-keys: |
${{ runner.os }}-node-modules-svg
- name: Install svg node_modules
run: yarn install --frozen-lockfile

- name: Restore app node_modules from cache
uses: actions/cache@v2
id: cache-node-modules-app
with:
node-version: 14
cache: 'yarn'
cache-dependency-path: 'Example/yarn.lock'
- name: Install node dependencies
working-directory: ${{ env.WORKING_DIRECTORY }}
run: yarn
- name: Install pods
working-directory: ${{ env.WORKING_DIRECTORY }}/ios
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@v2
id: cache-pods
with:
path: |
${{ matrix.working-directory }}/ios/Pods
~/Library/Caches/CocoaPods
~/.cocoapods
key: ${{ runner.os }}-pods3-${{ matrix.working-directory }}-${{ hashFiles('yarn.lock', format('{0}/yarn.lock', matrix.working-directory), format('{0}/ios/Podfile.lock', matrix.working-directory)) }}

- name: Install Pods
working-directory: ${{ matrix.working-directory }}/ios
run: pod install

- name: Restore build artifacts from cache
uses: actions/cache@v2
id: cache-build
with:
path: |
${{ matrix.working-directory }}/ios/build
~/Library/Developer/Xcode/DerivedData
key: ${{ runner.os }}-build3-${{ matrix.working-directory }}-${{ hashFiles(format('{0}/ios/Podfile.lock', matrix.working-directory)) }}

- name: Build app
working-directory: ${{ env.WORKING_DIRECTORY }}
run: yarn ios
working-directory: ${{ matrix.working-directory }}
run: npx react-native run-ios
63 changes: 52 additions & 11 deletions .github/workflows/macos-build-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,34 +4,75 @@ on:
branches:
- main
paths:
- '.github/workflows/macos-build-test.yml'
- 'RNSVG.podspec'
- 'apple/**'
- 'Example/macos/**'
push:
branches:
- main
workflow_dispatch:
jobs:
build:
runs-on: macos-latest
runs-on: macos-12
env:
WORKING_DIRECTORY: Example
concurrency:
group: macos-${{ github.ref }}
cancel-in-progress: true
steps:
- name: checkout
- name: Check out Git repository
uses: actions/checkout@v2
- name: Use Node.js 14
uses: actions/setup-node@v2

- name: Restore svg node_modules from cache
uses: actions/cache@v2
id: cache-node-modules-svg
with:
node-version: 14
cache: 'yarn'
cache-dependency-path: 'Example/yarn.lock'
- name: Install node dependencies
path: |
node_modules
key: ${{ runner.os }}-node-modules-svg-${{ hashFiles('yarn.lock') }}
restore-keys: |
${{ runner.os }}-node-modules-svg
- name: Install svg dependencies
run: yarn install --frozen-lockfile

- name: Restore app node_modules from cache
uses: actions/cache@v2
id: cache-node-modules-app
with:
path: |
${{ env.WORKING_DIRECTORY }}/node_modules
key: ${{ runner.os }}-node-modules-${{ env.WORKING_DIRECTORY }}-${{ hashFiles('${{ env.WORKING_DIRECTORY }}/yarn.lock') }}
restore-keys: |
${{ runner.os }}-node-modules-${{ env.WORKING_DIRECTORY }}-
- name: Install app dependencies
working-directory: ${{ env.WORKING_DIRECTORY }}
run: yarn
- name: Install pods
run: yarn install --frozen-lockfile

- name: Restore Pods from cache
uses: actions/cache@v2
id: cache-pods
with:
path: |
${{ env.WORKING_DIRECTORY }}/macos/Pods
~/Library/Caches/CocoaPods
~/.cocoapods
key: ${{ runner.os }}-pods-${{ env.WORKING_DIRECTORY }}-${{ hashFiles('${{ env.WORKING_DIRECTORY }}/macos/Podfile.lock') }}
restore-keys: |
${{ runner.os }}-pods-${{ env.WORKING_DIRECTORY }}-
- name: Install Pods
working-directory: ${{ env.WORKING_DIRECTORY }}/macos
run: pod install

- name: Restore build artifacts from cache
uses: actions/cache@v2
id: cache-build
with:
path: |
${{ env.WORKING_DIRECTORY }}/macos/build
~/Library/Developer/Xcode/DerivedData
key: ${{ runner.os }}-build-${{ env.WORKING_DIRECTORY }}-${{ hashFiles('${{ env.WORKING_DIRECTORY }}/macos/Podfile.lock') }}
restore-keys: |
${{ runner.os }}-build-${{ env.WORKING_DIRECTORY }}-
- name: Build app
working-directory: ${{ env.WORKING_DIRECTORY }}
run: yarn macos