Skip to content

Commit 4d3cc69

Browse files
Add nightly build workflow (#456)
1 parent bc5eb1a commit 4d3cc69

File tree

1 file changed

+83
-0
lines changed

1 file changed

+83
-0
lines changed

.github/workflows/nightly.yml

Lines changed: 83 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,83 @@
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:30 AM (PT) and 08:30 PM (PT) / 04:30 AM (UTC) and 02:30 PM (UTC)
19+
# or on 'firebase_nightly_build' repository dispatch event.
20+
schedule:
21+
- cron: "30 4,14 * * *"
22+
repository_dispatch:
23+
types: [firebase_nightly_build]
24+
25+
jobs:
26+
nightly:
27+
28+
runs-on: ubuntu-latest
29+
30+
steps:
31+
- name: Set up Go
32+
uses: actions/setup-go@v1
33+
with:
34+
go-version: 1.12
35+
36+
- name: Install golint
37+
run: go get golang.org/x/lint/golint
38+
39+
- name: Check out code
40+
uses: actions/checkout@v2
41+
with:
42+
ref: ${{ github.event.client_payload.ref || github.ref }}
43+
44+
- name: Run Linter
45+
run: |
46+
GOLINT=`go list -f {{.Target}} golang.org/x/lint/golint`
47+
$GOLINT -set_exit_status ./...
48+
49+
- name: Run Tests
50+
run: ./.github/scripts/run_all_tests.sh
51+
env:
52+
FIREBASE_SERVICE_ACCT_KEY: ${{ secrets.FIREBASE_SERVICE_ACCT_KEY }}
53+
FIREBASE_API_KEY: ${{ secrets.FIREBASE_API_KEY }}
54+
55+
- name: Send email on failure
56+
if: failure()
57+
uses: firebase/firebase-admin-node/.github/actions/send-email@master
58+
with:
59+
api-key: ${{ secrets.OSS_BOT_MAILGUN_KEY }}
60+
domain: ${{ secrets.OSS_BOT_MAILGUN_DOMAIN }}
61+
from: 'GitHub <admin-github@${{ secrets.OSS_BOT_MAILGUN_DOMAIN }}>'
62+
to: ${{ secrets.FIREBASE_ADMIN_GITHUB_EMAIL }}
63+
subject: 'Nightly build ${{github.run_id}} of ${{github.repository}} failed!'
64+
html: >
65+
<b>Nightly workflow ${{github.run_id}} failed on: ${{github.repository}}</b>
66+
<br /><br />Navigate to the
67+
<a href="https://github.com/firebase/firebase-admin-go/actions/runs/${{github.run_id}}">failed workflow</a>.
68+
continue-on-error: true
69+
70+
- name: Send email on cancelled
71+
if: cancelled()
72+
uses: firebase/firebase-admin-node/.github/actions/send-email@master
73+
with:
74+
api-key: ${{ secrets.OSS_BOT_MAILGUN_KEY }}
75+
domain: ${{ secrets.OSS_BOT_MAILGUN_DOMAIN }}
76+
from: 'GitHub <admin-github@${{ secrets.OSS_BOT_MAILGUN_DOMAIN }}>'
77+
to: ${{ secrets.FIREBASE_ADMIN_GITHUB_EMAIL }}
78+
subject: 'Nightly build ${{github.run_id}} of ${{github.repository}} cancelled!'
79+
html: >
80+
<b>Nightly workflow ${{github.run_id}} cancelled on: ${{github.repository}}</b>
81+
<br /><br />Navigate to the
82+
<a href="https://github.com/firebase/firebase-admin-go/actions/runs/${{github.run_id}}">cancelled workflow</a>.
83+
continue-on-error: true

0 commit comments

Comments
 (0)