|
| 1 | +name: CI/CD |
| 2 | +on: |
| 3 | + push: |
| 4 | + branches: |
| 5 | + - main |
| 6 | + pull_request: |
| 7 | + branches: |
| 8 | + - main |
| 9 | + merge_group: |
| 10 | + types: |
| 11 | + - checks_requested |
| 12 | + |
| 13 | +concurrency: ${{ github.workflow }}-${{ github.ref }} |
| 14 | + |
| 15 | +jobs: |
| 16 | + lint: |
| 17 | + name: Lint |
| 18 | + runs-on: ubuntu-latest |
| 19 | + steps: |
| 20 | + - name: Checkout |
| 21 | + uses: actions/checkout@v4 |
| 22 | + with: |
| 23 | + submodules: 'true' |
| 24 | + |
| 25 | + - name: Setup |
| 26 | + uses: ./.github/actions/setup |
| 27 | + |
| 28 | + - name: Lint files |
| 29 | + run: pnpm run lint |
| 30 | + |
| 31 | + - name: Typecheck files |
| 32 | + run: pnpm run typecheck |
| 33 | + |
| 34 | + build-packages: |
| 35 | + name: Build packages |
| 36 | + runs-on: ubuntu-latest |
| 37 | + needs: lint |
| 38 | + steps: |
| 39 | + - name: Checkout |
| 40 | + uses: actions/checkout@v4 |
| 41 | + with: |
| 42 | + submodules: 'true' |
| 43 | + |
| 44 | + - name: Setup |
| 45 | + uses: ./.github/actions/setup |
| 46 | + |
| 47 | + - name: Build packages |
| 48 | + run: pnpm run build |
| 49 | + |
| 50 | + test: |
| 51 | + name: Run tests |
| 52 | + runs-on: ubuntu-latest |
| 53 | + needs: build-packages |
| 54 | + steps: |
| 55 | + - name: Checkout |
| 56 | + uses: actions/checkout@v4 |
| 57 | + with: |
| 58 | + submodules: 'true' |
| 59 | + |
| 60 | + - name: Setup |
| 61 | + uses: ./.github/actions/setup |
| 62 | + |
| 63 | + - name: Run unit tests |
| 64 | + run: pnpm run test --maxWorkers=2 --coverage |
| 65 | + |
| 66 | + docs: |
| 67 | + name: Build and deploy docs |
| 68 | + runs-on: ubuntu-latest |
| 69 | + needs: build-packages |
| 70 | + steps: |
| 71 | + - name: Checkout |
| 72 | + uses: actions/checkout@v4 |
| 73 | + with: |
| 74 | + submodules: 'true' |
| 75 | + |
| 76 | + - name: Setup |
| 77 | + uses: ./.github/actions/setup |
| 78 | + |
| 79 | + - name: Build docs |
| 80 | + run: pnpm run build:docs |
| 81 | + |
| 82 | + # TODO: publish docs |
| 83 | + |
| 84 | + # TODO: enable building demo apps |
| 85 | + # build-android: |
| 86 | + # name: Build Android demo app |
| 87 | + # runs-on: ubuntu-latest |
| 88 | + # needs: [build-packages] |
| 89 | + # steps: |
| 90 | + # - name: Checkout |
| 91 | + # uses: actions/checkout@v4 |
| 92 | + # with: |
| 93 | + # submodules: 'true' |
| 94 | + |
| 95 | + # - name: Setup |
| 96 | + # uses: ./.github/actions/setup |
| 97 | + |
| 98 | + # - name: Build packages |
| 99 | + # run: pnpm run build |
| 100 | + |
| 101 | + # - name: Install JDK |
| 102 | + # uses: actions/setup-java@v4 |
| 103 | + # with: |
| 104 | + # distribution: 'zulu' |
| 105 | + # java-version: '17' |
| 106 | + |
| 107 | + # - name: Finalize Android SDK |
| 108 | + # run: | |
| 109 | + # /bin/bash -c "yes | $ANDROID_HOME/cmdline-tools/latest/bin/sdkmanager --licenses > /dev/null" |
| 110 | + |
| 111 | + # - name: Cache Gradle |
| 112 | + # uses: actions/cache@v4 |
| 113 | + # with: |
| 114 | + # path: | |
| 115 | + # ~/.gradle/wrapper |
| 116 | + # ~/.gradle/caches |
| 117 | + # key: ${{ runner.os }}-gradle-${{ hashFiles('examples/rn-app/android/gradle/wrapper/gradle-wrapper.properties') }} |
| 118 | + # restore-keys: | |
| 119 | + # ${{ runner.os }}-gradle- |
| 120 | + |
| 121 | + # - name: Build example for Android |
| 122 | + # env: |
| 123 | + # JAVA_OPTS: '-XX:MaxHeapSize=6g' |
| 124 | + # run: | |
| 125 | + # pnpm run build:demo:android |
| 126 | + |
| 127 | + # build-ios: |
| 128 | + # name: Build iOS demo app |
| 129 | + # runs-on: macos-latest |
| 130 | + # needs: [build-packages] |
| 131 | + # steps: |
| 132 | + # - name: Checkout |
| 133 | + # uses: actions/checkout@v4 |
| 134 | + # with: |
| 135 | + # submodules: 'true' |
| 136 | + |
| 137 | + # - name: Setup |
| 138 | + # uses: ./.github/actions/setup |
| 139 | + |
| 140 | + # - name: Build packages |
| 141 | + # run: pnpm run build |
| 142 | + |
| 143 | + # - name: Restore Cocoapods |
| 144 | + # id: cocoapods-cache |
| 145 | + # uses: actions/cache/restore@v4 |
| 146 | + # with: |
| 147 | + # path: | |
| 148 | + # **/ios/Pods |
| 149 | + # key: ${{ runner.os }}-cocoapods-${{ hashFiles('examples/rn-app/ios/Podfile.lock') }} |
| 150 | + # restore-keys: | |
| 151 | + # ${{ runner.os }}-cocoapods- |
| 152 | + |
| 153 | + # - name: Install Cocoapods |
| 154 | + # run: | |
| 155 | + # cd examples/rn-app/ios |
| 156 | + # pod install |
| 157 | + # env: |
| 158 | + # NO_FLIPPER: 1 |
| 159 | + |
| 160 | + # - name: Cache Cocoapods |
| 161 | + # uses: actions/cache/save@v4 |
| 162 | + # with: |
| 163 | + # path: | |
| 164 | + # **/ios/Pods |
| 165 | + # key: ${{ steps.cocoapods-cache.outputs.cache-key }} |
| 166 | + |
| 167 | + # - name: Build example for iOS |
| 168 | + # run: | |
| 169 | + # pnpm run build:demo:ios |
0 commit comments