|
| 1 | +# Copyright 2021 Google Inc. |
| 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: Nightly Builds |
| 16 | + |
| 17 | +on: |
| 18 | + # Runs every day at 06:00 AM (PT) and 08:00 PM (PT) / 04:00 AM (UTC) and 02:00 PM (UTC) |
| 19 | + schedule: |
| 20 | + - cron: "0 4,14 * * *" |
| 21 | + |
| 22 | +jobs: |
| 23 | + nightly: |
| 24 | + |
| 25 | + runs-on: ubuntu-latest |
| 26 | + |
| 27 | + steps: |
| 28 | + - name: Checkout source for staging |
| 29 | + uses: actions/checkout@v2 |
| 30 | + with: |
| 31 | + ref: ${{ github.event.client_payload.ref || github.ref }} |
| 32 | + |
| 33 | + - name: Set up Node.js |
| 34 | + uses: actions/setup-node@v1 |
| 35 | + with: |
| 36 | + node-version: 10.x |
| 37 | + |
| 38 | + - name: Install and build |
| 39 | + run: | |
| 40 | + npm ci |
| 41 | + npm run build |
| 42 | + npm run build:tests |
| 43 | +
|
| 44 | + - name: Run unit tests |
| 45 | + run: npm test |
| 46 | + |
| 47 | + - name: Verify public API |
| 48 | + run: npm run api-extractor |
| 49 | + |
| 50 | + - name: Run integration tests |
| 51 | + run: ./.github/scripts/run_integration_tests.sh |
| 52 | + env: |
| 53 | + FIREBASE_SERVICE_ACCT_KEY: ${{ secrets.FIREBASE_SERVICE_ACCT_KEY }} |
| 54 | + FIREBASE_API_KEY: ${{ secrets.FIREBASE_API_KEY }} |
| 55 | + |
| 56 | + - name: Package release artifacts |
| 57 | + run: | |
| 58 | + npm pack |
| 59 | + mkdir -p dist |
| 60 | + cp *.tgz dist/ |
| 61 | +
|
| 62 | + # Attach the packaged artifacts to the workflow output. These can be manually |
| 63 | + # downloaded for later inspection if necessary. |
| 64 | + - name: Archive artifacts |
| 65 | + uses: actions/upload-artifact@v1 |
| 66 | + with: |
| 67 | + name: dist |
| 68 | + path: dist |
0 commit comments