firebase/quickstart-cpp

Add build verification using GitHub Actions

samtstern opened this issue · 3 comments

Since this repository is used for snippets that are included in docs, the code here should have some automated verification that it compiles. Travis CI would be ideal as it's consistent with other Firebase Github projects.

Unit testing is not required but is a nice-to-have.

+1 please add Travis configuration for Android and iOS

import (
"fmt"
"context"

firebase "firebase.google.com/go"
"firebase.google.com/go/auth"

"google.golang.org/api/option"
)

opt := option.WithCredentialsFile("path/to/serviceAccountKey.json")
app, err := firebase.NewApp(context.Background(), nil, opt)
if err != nil {
return nil, fmt.Errorf("error initializing app: %v", err)
}

import firebase_admin
from firebase_admin import credentials

cred = credentials.Certificate("path/to/serviceAccountKey.json")
firebase_admin.initialize_app(cred)

FileInputStream serviceAccount =
new FileInputStream("path/to/serviceAccountKey.json");

FirebaseOptions options = new FirebaseOptions.Builder()
.setCredentials(GoogleCredentials.fromStream(serviceAccount))
.build();

FirebaseApp.initializeApp(options);

var admin = require("firebase-admin");

var serviceAccount = require("path/to/serviceAccountKey.json");

admin.initializeApp({
credential: admin.credential.cert(serviceAccount)
});

Working on this, but using Github Actions instead of Travis CI.