Skip to content

Commit

Permalink
Merge branch 'main' into ep/spotless-format
Browse files Browse the repository at this point in the history
  • Loading branch information
emilypgoogle committed Jul 16, 2024
2 parents c1e28dc + 4db5dc8 commit 10e880d
Show file tree
Hide file tree
Showing 108 changed files with 1,495 additions and 428 deletions.
120 changes: 7 additions & 113 deletions .github/workflows/ci_tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,11 @@ jobs:
./gradlew :common:updateVersion common:publishToMavenLocal
cd ..
- name: Clone mock responses
if: matrix.module == ':firebase-vertexai'
run: |
firebase-vertexai/update_responses.sh
- name: Add google-services.json
env:
INTEG_TESTS_GOOGLE_SERVICES: ${{ secrets.INTEG_TESTS_GOOGLE_SERVICES }}
Expand Down Expand Up @@ -112,6 +117,8 @@ jobs:
fail-fast: false
matrix:
module: ${{ fromJSON(needs.determine_changed.outputs.modules) }}
exclude:
- module: :firebase-firestore

steps:
- uses: actions/checkout@v4.1.1
Expand Down Expand Up @@ -144,119 +151,6 @@ jobs:
run: |
./gradlew ${{matrix.module}}:deviceCheck withErrorProne -PtargetBackend="prod"
firestore_custom_integ_tests:
name: "Firestore Custom Instrumentation Tests Against Named DB"
runs-on: ubuntu-22.04
needs:
- determine_changed
# only run on post submit or PRs not originating from forks.
if: ((github.repository == 'Firebase/firebase-android-sdk' && github.event_name == 'push') || (github.event_name == 'pull_request' && github.event.pull_request.head.repo.full_name == github.repository)) && contains(fromJSON(needs.determine_changed.outputs.modules), ':firebase-firestore')
strategy:
fail-fast: false

steps:
- uses: actions/checkout@v4.1.1
with:
fetch-depth: 2
submodules: true

- name: Set up JDK 17
uses: actions/setup-java@v4.1.0
with:
java-version: 17
distribution: temurin
cache: gradle

- name: Add google-services.json
env:
INTEG_TESTS_GOOGLE_SERVICES: ${{ secrets.INTEG_TESTS_GOOGLE_SERVICES }}
run: |
echo $INTEG_TESTS_GOOGLE_SERVICES | base64 -d > google-services.json
- uses: google-github-actions/auth@v2
with:
credentials_json: ${{ secrets.GCP_SERVICE_ACCOUNT }}
- uses: google-github-actions/setup-gcloud@v2

# create composite indexes with Terraform
- name: Setup Terraform
uses: hashicorp/setup-terraform@v2
- name: Terraform Init
run: |
cd firebase-firestore
terraform init
continue-on-error: true
- name: Terraform Apply
if: github.event_name == 'pull_request'
run: |
cd firebase-firestore
# Define a temporary file, redirect both stdout and stderr to the file
output_file=$(mktemp)
if ! terraform apply -var-file=../google-services.json -auto-approve > "$output_file" 2>&1 ; then
cat "$output_file"
if cat "$output_file" | grep -q "index already exists"; then
echo "==================================================================================="
echo -e "\e[93m\e[1mTerraform apply failed due to index already exists; We can safely ignore this error.\e[0m"
echo "==================================================================================="
fi
exit 1
fi
rm -f "$output_file"
continue-on-error: true

- name: Firestore Named DB Integ Tests
env:
FIREBASE_CI: 1
FTL_RESULTS_BUCKET: android-ci
FTL_RESULTS_DIR: ${{ github.event_name == 'pull_request' && format('pr-logs/pull/{0}/{1}/{2}/{3}_{4}/artifacts/', github.repository, github.event.pull_request.number, github.job, github.run_id, github.run_attempt) || format('logs/{0}/{1}_{2}/artifacts/', github.workflow, github.run_id, github.run_attempt)}}
FIREBASE_APP_CHECK_DEBUG_SECRET: ${{ secrets.FIREBASE_APP_CHECK_DEBUG_SECRET }}
run: |
./gradlew firebase-firestore:deviceCheck withErrorProne -PtargetBackend="prod" -PtargetDatabaseId="test-db"
firestore_nightly_integ_tests:
name: "Firestore Instrumentation Tests Against Nightly Environment"
runs-on: ubuntu-22.04
needs:
- determine_changed
# only run on post submit or PRs not originating from forks.
if: ((github.repository == 'Firebase/firebase-android-sdk' && github.event_name == 'push') || (github.event_name == 'pull_request' && github.event.pull_request.head.repo.full_name == github.repository)) && contains(fromJSON(needs.determine_changed.outputs.modules), ':firebase-firestore')
strategy:
fail-fast: false

steps:
- uses: actions/checkout@v4.1.1
with:
fetch-depth: 2
submodules: true

- name: Set up JDK 17
uses: actions/setup-java@v4.1.0
with:
java-version: 17
distribution: temurin
cache: gradle

- name: Add google-services.json
env:
INTEG_TESTS_GOOGLE_SERVICES: ${{ secrets.NIGHTLY_INTEG_TESTS_GOOGLE_SERVICES }}
run: |
echo $INTEG_TESTS_GOOGLE_SERVICES > google-services.json
- uses: google-github-actions/auth@v2
with:
credentials_json: ${{ secrets.GCP_SERVICE_ACCOUNT }}
- uses: google-github-actions/setup-gcloud@v2

- name: Firestore Nightly Integ Tests
env:
FIREBASE_CI: 1
FTL_RESULTS_BUCKET: android-ci
FTL_RESULTS_DIR: ${{ github.event_name == 'pull_request' && format('pr-logs/pull/{0}/{1}/{2}/{3}_{4}/artifacts/', github.repository, github.event.pull_request.number, github.job, github.run_id, github.run_attempt) || format('logs/{0}/{1}_{2}/artifacts/', github.workflow, github.run_id, github.run_attempt)}}
FIREBASE_APP_CHECK_DEBUG_SECRET: ${{ secrets.FIREBASE_APP_CHECK_DEBUG_SECRET }}
run: |
./gradlew firebase-firestore:deviceCheck withErrorProne -PtargetBackend="nightly"
publish-test-results:
name: "Publish Tests Results"
needs:
Expand Down
Loading

0 comments on commit 10e880d

Please sign in to comment.