From 886693ab21b703dfbc10a02bba02bc12b79c9a81 Mon Sep 17 00:00:00 2001 From: Gran Luo Date: Wed, 3 Feb 2021 16:51:10 -0800 Subject: [PATCH 1/5] Update to enable pod tests in post submit tests. --- .github/workflows/test_coverage.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/test_coverage.yml b/.github/workflows/test_coverage.yml index 22d7c406370..8ab76cbfa61 100644 --- a/.github/workflows/test_coverage.yml +++ b/.github/workflows/test_coverage.yml @@ -9,7 +9,7 @@ on: jobs: check: - if: github.repository == 'Firebase/firebase-ios-sdk' && github.event.action == 'synchronize' + if: github.repository == 'Firebase/firebase-ios-sdk' && github.event.action != 'closed' name: Check changed files outputs: database_run_job: ${{ steps.check_files.outputs.database_run_job }} @@ -29,7 +29,7 @@ jobs: pod-lib-lint-database: # Don't run on private repo unless it is a PR. - if: github.repository == 'Firebase/firebase-ios-sdk' && (needs.check.outputs.database_run_job == 'true' || github.event.pull_request.merged == true) + if: always() && github.repository == 'Firebase/firebase-ios-sdk' && (needs.check.outputs.database_run_job || github.event.pull_request.merged) needs: check runs-on: macOS-latest strategy: @@ -48,7 +48,7 @@ jobs: pod-lib-lint-functions: # Don't run on private repo unless it is a PR. - if: github.repository == 'Firebase/firebase-ios-sdk' && (needs.check.outputs.functions_run_job == 'true' || github.event.pull_request.merged == true) + if: always() && github.repository == 'Firebase/firebase-ios-sdk' && (needs.check.outputs.functions_run_job || github.event.pull_request.merged) needs: check runs-on: macOS-latest strategy: From bee92bd91d8e0ba63917618d51222f302d33c637 Mon Sep 17 00:00:00 2001 From: Gran Luo Date: Wed, 3 Feb 2021 17:13:31 -0800 Subject: [PATCH 2/5] Test when pr is either opened or synchronized. --- .github/workflows/test_coverage.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/test_coverage.yml b/.github/workflows/test_coverage.yml index 8ab76cbfa61..58186359c7a 100644 --- a/.github/workflows/test_coverage.yml +++ b/.github/workflows/test_coverage.yml @@ -5,11 +5,11 @@ on: # 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: [open, synchronize, closed] + types: [opened, synchronize, closed] jobs: check: - if: github.repository == 'Firebase/firebase-ios-sdk' && github.event.action != 'closed' + if: github.repository == 'Firebase/firebase-ios-sdk' && (github.event.action == 'opened' || github.event.action == 'synchronize') name: Check changed files outputs: database_run_job: ${{ steps.check_files.outputs.database_run_job }} From f45262f3954b899fe04263b8dc004d40279d16a5 Mon Sep 17 00:00:00 2001 From: Gran Luo Date: Wed, 3 Feb 2021 17:22:19 -0800 Subject: [PATCH 3/5] Test nees before if. --- .github/workflows/test_coverage.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/test_coverage.yml b/.github/workflows/test_coverage.yml index 58186359c7a..52c61e1d69f 100644 --- a/.github/workflows/test_coverage.yml +++ b/.github/workflows/test_coverage.yml @@ -28,9 +28,9 @@ jobs: run: ./scripts/code_coverage_report/get_updated_files.sh pod-lib-lint-database: + needs: check # Don't run on private repo unless it is a PR. if: always() && github.repository == 'Firebase/firebase-ios-sdk' && (needs.check.outputs.database_run_job || github.event.pull_request.merged) - needs: check runs-on: macOS-latest strategy: matrix: @@ -47,9 +47,9 @@ jobs: path: /Users/runner/*.xcresult pod-lib-lint-functions: + needs: check # Don't run on private repo unless it is a PR. if: always() && github.repository == 'Firebase/firebase-ios-sdk' && (needs.check.outputs.functions_run_job || github.event.pull_request.merged) - needs: check runs-on: macOS-latest strategy: matrix: From bddfc994448fc75f4fbce68e567be038f01c83ef Mon Sep 17 00:00:00 2001 From: Gran Luo Date: Wed, 3 Feb 2021 18:09:30 -0800 Subject: [PATCH 4/5] Update conditions. --- .github/workflows/test_coverage.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/test_coverage.yml b/.github/workflows/test_coverage.yml index 52c61e1d69f..ee67a8788b9 100644 --- a/.github/workflows/test_coverage.yml +++ b/.github/workflows/test_coverage.yml @@ -30,7 +30,7 @@ jobs: pod-lib-lint-database: needs: check # Don't run on private repo unless it is a PR. - if: always() && github.repository == 'Firebase/firebase-ios-sdk' && (needs.check.outputs.database_run_job || github.event.pull_request.merged) + if: always() && github.repository == 'Firebase/firebase-ios-sdk' && (needs.check.outputs.database_run_job == 'true' || github.event.pull_request.merged) runs-on: macOS-latest strategy: matrix: @@ -49,7 +49,7 @@ jobs: pod-lib-lint-functions: needs: check # Don't run on private repo unless it is a PR. - if: always() && github.repository == 'Firebase/firebase-ios-sdk' && (needs.check.outputs.functions_run_job || github.event.pull_request.merged) + if: always() && github.repository == 'Firebase/firebase-ios-sdk' && (needs.check.outputs.functions_run_job == 'true'|| github.event.pull_request.merged) runs-on: macOS-latest strategy: matrix: From 065e1153e5e474c97dd7aca9f8ce0c7eb1f10be3 Mon Sep 17 00:00:00 2001 From: Gran Luo Date: Wed, 3 Feb 2021 18:14:22 -0800 Subject: [PATCH 5/5] Add comments. --- .github/workflows/test_coverage.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/test_coverage.yml b/.github/workflows/test_coverage.yml index ee67a8788b9..233dbe680b5 100644 --- a/.github/workflows/test_coverage.yml +++ b/.github/workflows/test_coverage.yml @@ -30,6 +30,7 @@ jobs: pod-lib-lint-database: needs: check # Don't run on private repo unless it is a PR. + # always() will trigger this job when `needs` are skipped in a `merge` pull_request event. if: always() && github.repository == 'Firebase/firebase-ios-sdk' && (needs.check.outputs.database_run_job == 'true' || github.event.pull_request.merged) runs-on: macOS-latest strategy: