Skip to content

Commit 49e684d

Browse files
chore: Add nightly build workflow (#305)
- Add nightly build workflow.
1 parent 7d4325f commit 49e684d

File tree

1 file changed

+91
-0
lines changed

1 file changed

+91
-0
lines changed

.github/workflows/nightly.yml

Lines changed: 91 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,91 @@
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:40 AM (PT) and 08:40 PM (PT) / 04:40 AM (UTC) and 02:40 PM (UTC)
19+
# or on 'firebase_nightly_build' repository dispatch event.
20+
schedule:
21+
- cron: "40 4,14 * * *"
22+
repository_dispatch:
23+
types: [firebase_nightly_build]
24+
25+
jobs:
26+
nightly:
27+
28+
runs-on: windows-latest
29+
30+
env:
31+
DOTNET_SKIP_FIRST_TIME_EXPERIENCE: 1
32+
DOTNET_CLI_TELEMETRY_OPTOUT: 1
33+
34+
steps:
35+
- name: Checkout source for staging
36+
uses: actions/checkout@v2
37+
with:
38+
ref: ${{ github.event.client_payload.ref || github.ref }}
39+
40+
- name: Build with dotnet
41+
run: dotnet build FirebaseAdmin/FirebaseAdmin
42+
43+
- name: Run unit tests
44+
run: dotnet test FirebaseAdmin/FirebaseAdmin.Tests
45+
46+
- name: Run integration tests
47+
run: ./.github/scripts/run_integration_tests
48+
env:
49+
FIREBASE_SERVICE_ACCT_KEY: ${{ secrets.FIREBASE_SERVICE_ACCT_KEY }}
50+
FIREBASE_API_KEY: ${{ secrets.FIREBASE_API_KEY }}
51+
52+
- name: Package release artifacts
53+
run: dotnet pack -c Release FirebaseAdmin/FirebaseAdmin
54+
55+
# Attach the packaged artifacts to the workflow output. These can be manually
56+
# downloaded for later inspection if necessary.
57+
- name: Archive artifacts
58+
uses: actions/upload-artifact@v1
59+
with:
60+
name: Release
61+
path: FirebaseAdmin/FirebaseAdmin/bin/Release
62+
63+
- name: Send email on failure
64+
if: failure()
65+
uses: firebase/firebase-admin-node/.github/actions/send-email@master
66+
with:
67+
api-key: ${{ secrets.OSS_BOT_MAILGUN_KEY }}
68+
domain: ${{ secrets.OSS_BOT_MAILGUN_DOMAIN }}
69+
from: 'GitHub <admin-github@${{ secrets.OSS_BOT_MAILGUN_DOMAIN }}>'
70+
to: ${{ secrets.FIREBASE_ADMIN_GITHUB_EMAIL }}
71+
subject: 'Nightly build ${{github.run_id}} of ${{github.repository}} failed!'
72+
html: >
73+
<b>Nightly workflow ${{github.run_id}} failed on: ${{github.repository}}</b>
74+
<br /><br />Navigate to the
75+
<a href="https://github.com/firebase/firebase-admin-dotnet/actions/runs/${{github.run_id}}">failed workflow</a>.
76+
continue-on-error: true
77+
78+
- name: Send email on cancelled
79+
if: cancelled()
80+
uses: firebase/firebase-admin-node/.github/actions/send-email@master
81+
with:
82+
api-key: ${{ secrets.OSS_BOT_MAILGUN_KEY }}
83+
domain: ${{ secrets.OSS_BOT_MAILGUN_DOMAIN }}
84+
from: 'GitHub <admin-github@${{ secrets.OSS_BOT_MAILGUN_DOMAIN }}>'
85+
to: ${{ secrets.FIREBASE_ADMIN_GITHUB_EMAIL }}
86+
subject: 'Nightly build ${{github.run_id}} of ${{github.repository}} cancelled!'
87+
html: >
88+
<b>Nightly workflow ${{github.run_id}} cancelled on: ${{github.repository}}</b>
89+
<br /><br />Navigate to the
90+
<a href="https://github.com/firebase/firebase-admin-dotnet/actions/runs/${{github.run_id}}">cancelled workflow</a>.
91+
continue-on-error: true

0 commit comments

Comments
 (0)