Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
32 changes: 27 additions & 5 deletions .github/workflows/on-pr-comment.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,19 +39,19 @@ jobs:
pr_number: ${{ github.event.issue.number }}
message: ${{ steps.parse_commands.outputs.help_message }}

unit-test:
if: ${{ github.event.issue.pull_request && contains(github.event.comment.body, '/unit_test') }}
unit-test-python:
if: ${{ github.event.issue.pull_request && (contains(github.event.comment.body, '/unit_test_py') || endsWith(github.event.comment.body, '/unit_test')) }}
runs-on: ubuntu-latest
# TODO(kmonte): Reduce this :(
timeout-minutes: 120
steps:
- name: Run Unit Tests
- name: Run Python Unit Tests
uses: snapchat/gigl/.github/actions/run-command-on-pr@main
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
pr_number: ${{ github.event.issue.number }}
should_leave_progress_comments: "true"
descriptive_workflow_name: "Unit Test"
descriptive_workflow_name: "Python Unit Test"
setup_gcloud: "true"
# We use cloud run here instead of using github hosted runners because of limitation of tests
# using GFile library (a.k.a anything that does IO w/ Tensorflow). GFile does not understand
Expand All @@ -62,7 +62,28 @@ jobs:
workload_identity_provider: ${{ secrets.WORKLOAD_IDENTITY_PROVIDER }}
gcp_service_account_email: ${{ secrets.GCP_SERVICE_ACCOUNT_EMAIL }}
command: |
make unit_test
make unit_test_py

unit-test-scala:
if: ${{ github.event.issue.pull_request && (contains(github.event.comment.body, '/unit_test_scala') || endsWith(github.event.comment.body, '/unit_test')) }}
runs-on: ubuntu-latest
timeout-minutes: 20
steps:
- name: Run Scala Unit Tests
uses: snapchat/gigl/.github/actions/run-command-on-pr@main
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
pr_number: ${{ github.event.issue.number }}
should_leave_progress_comments: "true"
descriptive_workflow_name: "Scala Unit Test"
setup_gcloud: "true"
use_cloud_run: "true"
gcp_project_id: ${{ vars.GCP_PROJECT_ID }}
workload_identity_provider: ${{ secrets.WORKLOAD_IDENTITY_PROVIDER }}
gcp_service_account_email: ${{ secrets.GCP_SERVICE_ACCOUNT_EMAIL }}
command: |
make unit_test_scala

integration-test:
if: ${{ github.event.issue.pull_request && contains(github.event.comment.body, '/integration_test') }}
runs-on: ubuntu-latest
Expand All @@ -83,6 +104,7 @@ jobs:
gcp_service_account_email: ${{ secrets.GCP_SERVICE_ACCOUNT_EMAIL }}
command: |
make integration_test

integration-e2e-test:
if: ${{ github.event.issue.pull_request && contains(github.event.comment.body, '/e2e_test') }}
runs-on: ubuntu-latest
Expand Down
29 changes: 26 additions & 3 deletions .github/workflows/on-pr-merge.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ permissions:
issues: 'write'

jobs:
ci-unit-test:
ci-unit-test-python:
# Because of limitation discussed https://github.com/orgs/community/discussions/46757#discussioncomment-4912738
# We skip when the workflow is triggered by a pull_request event; otherwise we will run the check twice.
# Once before it gets into the merge queue and once when it is in the merge queue.
Expand All @@ -32,14 +32,37 @@ jobs:
gcp_project_id: ${{ vars.GCP_PROJECT_ID }}
workload_identity_provider: ${{ secrets.workload_identity_provider }}
gcp_service_account_email: ${{ secrets.gcp_service_account_email }}
- name: Run Unit Tests
- name: Run Python Unit Tests
# We use cloud run here instead of using github hosted runners because of limitation of tests
# using GFile library (a.k.a anything that does IO w/ Tensorflow). GFile does not understand
# how to leverage Workload Identity Federation to read assets from GCS, et al. See:
# https://github.com/tensorflow/tensorflow/issues/57104
uses: snapchat/gigl/.github/actions/run-cloud-run-command-on-active-checkout@main
with:
cmd: "make unit_test"
cmd: "make unit_test_py"
service_account: ${{ secrets.gcp_service_account_email }}
project: ${{ vars.GCP_PROJECT_ID }}

ci-unit-test-scala:
# Because of limitation discussed https://github.com/orgs/community/discussions/46757#discussioncomment-4912738
# We skip when the workflow is triggered by a pull_request event; otherwise we will run the check twice.
# Once before it gets into the merge queue and once when it is in the merge queue.
# Our tests take a long time to run, so this is not ideal.
if: github.event_name == 'merge_group'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Setup development environment
uses: snapchat/gigl/.github/actions/setup-python-tools@main
with:
setup_gcloud: "true"
gcp_project_id: ${{ vars.GCP_PROJECT_ID }}
workload_identity_provider: ${{ secrets.workload_identity_provider }}
gcp_service_account_email: ${{ secrets.gcp_service_account_email }}
- name: Run Scala Unit Tests
uses: snapchat/gigl/.github/actions/run-cloud-run-command-on-active-checkout@main
with:
cmd: "make unit_test_scala"
service_account: ${{ secrets.gcp_service_account_email }}
project: ${{ vars.GCP_PROJECT_ID }}

Expand Down