Skip to content

Fix badfood crashes and add diagnostic #357

Fix badfood crashes and add diagnostic

Fix badfood crashes and add diagnostic #357

Workflow file for this run

name: test_coverage
on:
pull_request:
# open will be triggered when a pull request is created.
# synchronize will be triggered when a pull request has new commits.
# closed will be triggered when a pull request is closed.
types: [opened, synchronize, closed]
env:
METRICS_SERVICE_SECRET: ${{ secrets.GHASecretsGPGPassphrase1 }}
# Used to compile test-specific code in the SDK.
GDT_TEST: 1
concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.ref }}
cancel-in-progress: true
jobs:
pod_lib_lint:
if: github.repository == 'google/GoogleDataTransport' && (github.event.action == 'synchronize' || github.event.action == 'opened' || github.event.pull_request.merged)
runs-on: macos-latest
strategy:
matrix:
target: [ios]
steps:
- uses: actions/checkout@v3
- uses: ruby/setup-ruby@v1
- name: Setup Scripts Directory
run: ./setup-scripts.sh
- name: Setup Bundler
run: ./scripts/setup_bundler.sh
- name: PodLibLint DataTransport
run: |
scripts/health_metrics/pod_test_code_coverage_report.sh --sdk=GoogleDataTransport --platform=${{ matrix.target }} --test_spec=Tests-Unit,CCT-Tests-Unit
- uses: actions/upload-artifact@v2
with:
name: codecoverage
path: /Users/runner/*.xcresult
manage_test_results:
if: github.repository == 'google/GoogleDataTransport' && (github.event.action == 'synchronize' || github.event.action == 'opened' || github.event.pull_request.merged)
needs: pod_lib_lint
runs-on: macOS-latest
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
- uses: ruby/setup-ruby@v1
- uses: actions/download-artifact@v2
id: download
with:
path: /Users/runner/test
- name: Setup Scripts Directory
run: ./setup-scripts.sh
- name: Access to Metrics Service
if: ${{ env.METRICS_SERVICE_SECRET }}
run: |
# Install gcloud sdk
curl https://sdk.cloud.google.com > install.sh
bash install.sh --disable-prompts
echo "${HOME}/google-cloud-sdk/bin/" >> $GITHUB_PATH
export PATH="${HOME}/google-cloud-sdk/bin/:${PATH}"
# Activate the service account for Metrics Service.
scripts/decrypt_gha_secret.sh scripts/gha-encrypted/metrics_service_access.json.gpg \
metrics-access.json "${{ env.METRICS_SERVICE_SECRET }}"
gcloud auth activate-service-account --key-file metrics-access.json
- name: Build code coverage tool
run: |
swift build --package-path firebase-ios-sdk/scripts/health_metrics/generate_code_coverage_report/
cat $GITHUB_EVENT_PATH
- name: Generate report
if: github.event.pull_request.merged != true && env.METRICS_SERVICE_SECRET
env:
pr_branch: ${{ github.event.pull_request.head.ref }}
run: |
echo $(git merge-base remotes/origin/${pr_branch} remotes/origin/main)
common_commit=$(git merge-base remotes/origin/${pr_branch} remotes/origin/main)
GITHUB_SHA=$(cat $GITHUB_EVENT_PATH | jq -r .pull_request.head.sha)
if [ -d "${{steps.download.outputs.download-path}}" ]; then
firebase-ios-sdk/scripts/health_metrics/generate_code_coverage_report/.build/debug/CoverageReportGenerator --presubmit "google/GoogleDataTransport" --head-commit "${GITHUB_SHA}" --token $(gcloud auth print-identity-token) --xcresult-dir "${{steps.download.outputs.download-path}}/codecoverage" --log-link "https://github.com/google/GoogleDataTransport/actions/runs/${GITHUB_RUN_ID}" --pull-request-num ${{github.event.pull_request.number}} --base-commit "$common_commit"
fi
- name: Update New Coverage Data
if: github.event.pull_request.merged == true && env.METRICS_SERVICE_SECRET
run: |
if [ -d "${{steps.download.outputs.download-path}}" ]; then
firebase-ios-sdk/scripts/health_metrics/generate_code_coverage_report/.build/debug/CoverageReportGenerator --merge "google/GoogleDataTransport" --head-commit "${GITHUB_SHA}" --token $(gcloud auth print-identity-token) --xcresult-dir "${{steps.download.outputs.download-path}}/codecoverage" --log-link "https://github.com/google/GoogleDataTransport/actions/runs/${GITHUB_RUN_ID}" --source-branch "${{ github.base_ref }}"
fi