|
| 1 | +name: Test macOS build |
| 2 | +on: |
| 3 | + pull_request: |
| 4 | + paths: |
| 5 | + - .github/workflows/macos-build-test.yml |
| 6 | + - RNSVG.podspec |
| 7 | + - apple/** |
| 8 | + - Example/package.json |
| 9 | + - Example/macos/** |
| 10 | + - src/fabric/** |
| 11 | + - package.json |
| 12 | + push: |
| 13 | + branches: |
| 14 | + - main |
| 15 | + |
| 16 | +jobs: |
| 17 | + build: |
| 18 | + runs-on: macos-12 |
| 19 | + strategy: |
| 20 | + matrix: |
| 21 | + working-directory: [Example] |
| 22 | + fail-fast: false |
| 23 | + concurrency: |
| 24 | + group: macos-${{ matrix.working-directory }}-${{ github.ref }} |
| 25 | + cancel-in-progress: true |
| 26 | + steps: |
| 27 | + - name: Check out Git repository |
| 28 | + uses: actions/checkout@v3 |
| 29 | + |
| 30 | + - name: Restore react-native-svg node_modules from cache |
| 31 | + uses: actions/cache@v3 |
| 32 | + with: |
| 33 | + path: node_modules |
| 34 | + key: ${{ runner.os }}-node-modules-svg-${{ hashFiles('yarn.lock') }} |
| 35 | + restore-keys: ${{ runner.os }}-node-modules-svg- |
| 36 | + |
| 37 | + - name: Install react-native-svg node_modules |
| 38 | + run: yarn install --frozen-lockfile |
| 39 | + |
| 40 | + - name: Restore app node_modules from cache |
| 41 | + uses: actions/cache@v3 |
| 42 | + with: |
| 43 | + path: ${{ matrix.working-directory }}/node_modules |
| 44 | + key: ${{ runner.os }}-node-modules-${{ matrix.working-directory }}-${{ hashFiles(format('{0}/yarn.lock', matrix.working-directory)) }} |
| 45 | + restore-keys: ${{ runner.os }}-node-modules-${{ matrix.working-directory }}- |
| 46 | + |
| 47 | + - name: Install app node_modules |
| 48 | + working-directory: ${{ matrix.working-directory }} |
| 49 | + run: yarn install --frozen-lockfile |
| 50 | + |
| 51 | + - name: Restore Pods from cache |
| 52 | + uses: actions/cache@v3 |
| 53 | + with: |
| 54 | + path: | |
| 55 | + ${{ matrix.working-directory }}/macos/Pods |
| 56 | + ~/Library/Caches/CocoaPods |
| 57 | + ~/.cocoapods |
| 58 | + key: ${{ runner.os }}-pods-${{ matrix.working-directory }}-${{ hashFiles(format('{0}/macos/Podfile.lock', matrix.working-directory)) }} |
| 59 | + |
| 60 | + - name: Install Pods |
| 61 | + working-directory: ${{ matrix.working-directory }}/macos |
| 62 | + run: pod install |
| 63 | + |
| 64 | + - name: Restore build artifacts from cache |
| 65 | + uses: actions/cache@v3 |
| 66 | + with: |
| 67 | + path: ~/Library/Developer/Xcode/DerivedData |
| 68 | + key: ${{ runner.os }}-macos-derived-data-${{ matrix.working-directory }}-${{ hashFiles(format('{0}/macos/Podfile.lock', matrix.working-directory)) }} |
| 69 | + |
| 70 | + - name: Build app |
| 71 | + working-directory: ${{ matrix.working-directory }} |
| 72 | + run: npx react-native run-macos |
0 commit comments