|
| 1 | +# Copyright 2023 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_nightly |
| 16 | + |
| 17 | +on: |
| 18 | + pull_request: |
| 19 | + workflow_dispatch: |
| 20 | + schedule: |
| 21 | + # Run every day at 2am (PST) - cron uses UTC times |
| 22 | + - cron: '0 10 * * *' |
| 23 | + |
| 24 | +concurrency: |
| 25 | + group: ${{ github.workflow }}-${{ github.head_ref || github.ref }} |
| 26 | + cancel-in-progress: true |
| 27 | + |
| 28 | +jobs: |
| 29 | + check: |
| 30 | + runs-on: macos-12 |
| 31 | + steps: |
| 32 | + - uses: actions/checkout@v3 |
| 33 | + |
| 34 | + - uses: actions/setup-python@v4 |
| 35 | + with: |
| 36 | + python-version: 3.11 |
| 37 | + |
| 38 | + - name: Setup check |
| 39 | + run: scripts/setup_check.sh |
| 40 | + |
| 41 | + - name: Run check |
| 42 | + run: scripts/check.sh --test-only |
| 43 | + |
| 44 | + cmake-prod-db: |
| 45 | + needs: check |
| 46 | + |
| 47 | + strategy: |
| 48 | + matrix: |
| 49 | + os: [macos-12] |
| 50 | + databaseId: [(default)] |
| 51 | + |
| 52 | + env: |
| 53 | + plist_secret: ${{ secrets.GHASecretsGPGPassphrase1 }} |
| 54 | + MINT_PATH: ${{ github.workspace }}/mint |
| 55 | + TARGET_DATABASE_ID: ${{ matrix.databaseId }} |
| 56 | + |
| 57 | + runs-on: ${{ matrix.os }} |
| 58 | + steps: |
| 59 | + - uses: actions/checkout@v3 |
| 60 | + |
| 61 | + - name: Prepare ccache |
| 62 | + uses: actions/cache@v3 |
| 63 | + with: |
| 64 | + path: ${{ runner.temp }}/ccache |
| 65 | + key: firestore-ccache-${{ matrix.databaseId }}-${{ runner.os }}-${{ github.sha }} |
| 66 | + restore-keys: | |
| 67 | + firestore-ccache-${{ matrix.databaseId }}-${{ runner.os }}- |
| 68 | +
|
| 69 | + - name: Cache Mint packages |
| 70 | + uses: actions/cache@v3 |
| 71 | + with: |
| 72 | + path: ${{ env.MINT_PATH }} |
| 73 | + key: ${{ runner.os }}-mint-${{ hashFiles('**/Mintfile') }} |
| 74 | + restore-keys: ${{ runner.os }}-mint- |
| 75 | + |
| 76 | + - uses: actions/setup-python@v4 |
| 77 | + with: |
| 78 | + python-version: '3.7' |
| 79 | + |
| 80 | + - name: Install Secret GoogleService-Info.plist |
| 81 | + run: scripts/decrypt_gha_secret.sh scripts/gha-encrypted/firestore-nightly.plist.gpg \ |
| 82 | + Firestore/Example/App/GoogleService-Info.plist "$plist_secret" |
| 83 | + |
| 84 | + # Skipping terraform index creation because we are not allowed to download SA key json. |
| 85 | + |
| 86 | + - name: Setup build |
| 87 | + run: scripts/install_prereqs.sh Firestore ${{ runner.os }} cmake |
| 88 | + |
| 89 | + - name: Build and test |
| 90 | + run: | |
| 91 | + export CCACHE_DIR=${{ runner.temp }}/ccache |
| 92 | + export TARGET_BACKEND=nightly |
| 93 | + scripts/third_party/travis/retry.sh scripts/build.sh Firestore ${{ runner.os }} cmake |
0 commit comments