Skip to content

Commit

Permalink
feat: change ios CI (#1831)
Browse files Browse the repository at this point in the history
Added improved iOS CI jobs
  • Loading branch information
WoLewicki authored Aug 10, 2022
1 parent 4062c2e commit 7a77365
Show file tree
Hide file tree
Showing 2 changed files with 111 additions and 32 deletions.
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

0 comments on commit 7a77365

Please sign in to comment.