|
| 1 | +# Copyright 2020 Google LLC |
| 2 | +# |
| 3 | +# Licensed under the Apache License, Version 2.0 (the "License"); |
| 4 | +# you may not use this file except in compliance with the License. |
| 5 | +# You may obtain a copy of the License at |
| 6 | +# |
| 7 | +# http://www.apache.org/licenses/LICENSE-2.0 |
| 8 | +# |
| 9 | +# Unless required by applicable law or agreed to in writing, software |
| 10 | +# distributed under the License is distributed on an "AS IS" BASIS, |
| 11 | +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 12 | +# See the License for the specific language governing permissions and |
| 13 | +# limitations under the License. |
| 14 | + |
| 15 | +name: firestore |
| 16 | + |
| 17 | +on: |
| 18 | + pull_request: |
| 19 | + paths: |
| 20 | + # Firestore sources |
| 21 | + - 'Firestore/**' |
| 22 | + |
| 23 | + # Podspec |
| 24 | + - 'FirebaseFirestore.podspec' |
| 25 | + |
| 26 | + # CMake |
| 27 | + - 'CMakeLists.txt' |
| 28 | + - 'cmake/**' |
| 29 | + |
| 30 | + # Build scripts |
| 31 | + # Note that this doesn't include check scripts because changing those will |
| 32 | + # already trigger the check workflow. |
| 33 | + - 'scripts/binary_to_array.py' |
| 34 | + - 'scripts/build.sh' |
| 35 | + - 'scripts/install_prereqs.sh' |
| 36 | + - 'scripts/localize_podfile.swift' |
| 37 | + - 'scripts/pod_lib_lint.rb' |
| 38 | + - 'scripts/run_firestore_emulator.sh' |
| 39 | + - 'scripts/setup_*' |
| 40 | + - 'scripts/sync_project.rb' |
| 41 | + - 'scripts/test_quickstart.sh' |
| 42 | + |
| 43 | + # This workflow |
| 44 | + - '.github/workflows/firestore.yml' |
| 45 | + |
| 46 | + schedule: |
| 47 | + # Run every day at 11pm (PST) - cron uses UTC times |
| 48 | + - cron: '0 7 * * *' |
| 49 | + |
| 50 | +jobs: |
| 51 | + check: |
| 52 | + runs-on: macos-latest |
| 53 | + steps: |
| 54 | + - uses: actions/checkout@v2 |
| 55 | + |
| 56 | + - name: Setup check |
| 57 | + run: scripts/setup_check.sh |
| 58 | + |
| 59 | + - name: Run check |
| 60 | + run: scripts/check.sh --test-only |
| 61 | + |
| 62 | + |
| 63 | + cmake: |
| 64 | + needs: check |
| 65 | + |
| 66 | + strategy: |
| 67 | + matrix: |
| 68 | + os: [macos-latest, ubuntu-latest] |
| 69 | + |
| 70 | + runs-on: ${{ matrix.os }} |
| 71 | + steps: |
| 72 | + - uses: actions/checkout@v2 |
| 73 | + |
| 74 | + - name: Prepare ccache |
| 75 | + uses: actions/cache@v1 |
| 76 | + with: |
| 77 | + path: ~/.ccache |
| 78 | + key: firestore-ccache-${{ runner.os }}-${{ github.sha }} |
| 79 | + restore-keys: | |
| 80 | + firestore-ccache-${{ runner.os }}- |
| 81 | +
|
| 82 | + - name: Setup build |
| 83 | + run: scripts/install_prereqs.sh Firestore ${{ runner.os }} cmake |
| 84 | + |
| 85 | + - name: Build and test |
| 86 | + run: scripts/third_party/travis/retry.sh scripts/build.sh Firestore ${{ runner.os }} cmake |
| 87 | + |
| 88 | + |
| 89 | + sanitizers: |
| 90 | + runs-on: macos-latest |
| 91 | + needs: check |
| 92 | + |
| 93 | + strategy: |
| 94 | + matrix: |
| 95 | + sanitizer: [asan, tsan] |
| 96 | + |
| 97 | + env: |
| 98 | + SANITIZERS: ${{ matrix.sanitizer }} |
| 99 | + |
| 100 | + steps: |
| 101 | + - uses: actions/checkout@v2 |
| 102 | + |
| 103 | + - name: Prepare ccache |
| 104 | + uses: actions/cache@v1 |
| 105 | + with: |
| 106 | + path: ~/.ccache |
| 107 | + key: firestore-ccache-${{ runner.os }}-${{ matrix.sanitizer }}-${{ github.sha }} |
| 108 | + restore-keys: | |
| 109 | + firestore-ccache-${{ runner.os }}-${{ matrix.sanitizer }}- |
| 110 | +
|
| 111 | + - name: Setup build |
| 112 | + run: scripts/install_prereqs.sh Firestore ${{ runner.os }} cmake |
| 113 | + |
| 114 | + - name: Build and test |
| 115 | + run: scripts/third_party/travis/retry.sh scripts/build.sh Firestore ${{ runner.os }} cmake |
| 116 | + |
| 117 | + |
| 118 | + xcodebuild: |
| 119 | + runs-on: macos-latest |
| 120 | + needs: check |
| 121 | + |
| 122 | + strategy: |
| 123 | + matrix: |
| 124 | + target: [iOS, tvOS, macOS] |
| 125 | + |
| 126 | + steps: |
| 127 | + - uses: actions/checkout@v2 |
| 128 | + |
| 129 | + - name: Setup build |
| 130 | + run: scripts/install_prereqs.sh Firestore ${{ matrix.target }} xcodebuild |
| 131 | + |
| 132 | + - name: Build and test |
| 133 | + run: scripts/third_party/travis/retry.sh scripts/build.sh Firestore ${{ matrix.target }} xcodebuild |
| 134 | + |
| 135 | + |
| 136 | + pod-lib-lint: |
| 137 | + runs-on: macos-latest |
| 138 | + needs: check |
| 139 | + |
| 140 | + steps: |
| 141 | + - uses: actions/checkout@v2 |
| 142 | + |
| 143 | + - name: Setup Bundler |
| 144 | + run: ./scripts/setup_bundler.sh |
| 145 | + |
| 146 | + - name: Pod lib lint |
| 147 | + run: | |
| 148 | + scripts/third_party/travis/retry.sh scripts/pod_lib_lint.rb FirebaseFirestore.podspec \ |
| 149 | + --platforms=ios \ |
| 150 | + --allow-warnings |
0 commit comments