Skip to content

Commit

Permalink
chore(ci): run user permissions check if job should run
Browse files Browse the repository at this point in the history
A small workflow optimization by running user permissions check
only if a job is supposed to run.
  • Loading branch information
soonum committed Jan 27, 2025
1 parent ae0dff9 commit f49630e
Show file tree
Hide file tree
Showing 13 changed files with 52 additions and 26 deletions.
6 changes: 4 additions & 2 deletions .github/workflows/aws_tfhe_fast_tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -148,9 +148,11 @@ jobs:
# Fail if the triggering actor is not part of Zama organization.
# If pull_request_target is emitted and CI files have changed, skip this job. This would skip following jobs.
check-user-permission:
needs: check-ci-files
needs: [ check-ci-files, should-run ]
if: github.event_name != 'pull_request_target' ||
(github.event_name == 'pull_request_target' && needs.check-ci-files.outputs.ci_file_changed == 'false')
(github.event_name == 'pull_request_target' &&
needs.check-ci-files.outputs.ci_file_changed == 'false' &&
needs.should-run.outputs.any_file_changed == 'true')
uses: ./.github/workflows/check_actor_permissions.yml
secrets:
TOKEN: ${{ secrets.GITHUB_TOKEN }}
Expand Down
6 changes: 4 additions & 2 deletions .github/workflows/aws_tfhe_integer_tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -86,9 +86,11 @@ jobs:
# Fail if the triggering actor is not part of Zama organization.
# If pull_request_target is emitted and CI files have changed, skip this job. This would skip following jobs.
check-user-permission:
needs: check-ci-files
needs: [ check-ci-files, should-run ]
if: github.event_name != 'pull_request_target' ||
(github.event_name == 'pull_request_target' && needs.check-ci-files.outputs.ci_file_changed == 'false')
(github.event_name == 'pull_request_target' &&
needs.check-ci-files.outputs.ci_file_changed == 'false' &&
needs.should-run.outputs.integer_test == 'true')
uses: ./.github/workflows/check_actor_permissions.yml
secrets:
TOKEN: ${{ secrets.GITHUB_TOKEN }}
Expand Down
6 changes: 4 additions & 2 deletions .github/workflows/aws_tfhe_signed_integer_tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -87,9 +87,11 @@ jobs:
# Fail if the triggering actor is not part of Zama organization.
# If pull_request_target is emitted and CI files have changed, skip this job. This would skip following jobs.
check-user-permission:
needs: check-ci-files
needs: [ check-ci-files, should-run ]
if: github.event_name != 'pull_request_target' ||
(github.event_name == 'pull_request_target' && needs.check-ci-files.outputs.ci_file_changed == 'false')
(github.event_name == 'pull_request_target' &&
needs.check-ci-files.outputs.ci_file_changed == 'false' &&
needs.should-run.outputs.integer_test == 'true')
uses: ./.github/workflows/check_actor_permissions.yml
secrets:
TOKEN: ${{ secrets.GITHUB_TOKEN }}
Expand Down
6 changes: 4 additions & 2 deletions .github/workflows/aws_tfhe_tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -158,9 +158,11 @@ jobs:
# Fail if the triggering actor is not part of Zama organization.
# If pull_request_target is emitted and CI files have changed, skip this job. This would skip following jobs.
check-user-permission:
needs: check-ci-files
needs: [ check-ci-files, should-run ]
if: github.event_name != 'pull_request_target' ||
(github.event_name == 'pull_request_target' && needs.check-ci-files.outputs.ci_file_changed == 'false')
(github.event_name == 'pull_request_target' &&
needs.check-ci-files.outputs.ci_file_changed == 'false' &&
needs.should-run.outputs.any_file_changed == 'true')
uses: ./.github/workflows/check_actor_permissions.yml
secrets:
TOKEN: ${{ secrets.GITHUB_TOKEN }}
Expand Down
6 changes: 4 additions & 2 deletions .github/workflows/gpu_fast_h100_tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -83,9 +83,11 @@ jobs:
# Fail if the triggering actor is not part of Zama organization.
# If pull_request_target is emitted and CI files have changed, skip this job. This would skip following jobs.
check-user-permission:
needs: check-ci-files
needs: [ check-ci-files, should-run ]
if: github.event_name != 'pull_request_target' ||
(github.event_name == 'pull_request_target' && needs.check-ci-files.outputs.ci_file_changed == 'false')
(github.event_name == 'pull_request_target' &&
needs.check-ci-files.outputs.ci_file_changed == 'false' &&
needs.should-run.outputs.gpu_test == 'true')
uses: ./.github/workflows/check_actor_permissions.yml
secrets:
TOKEN: ${{ secrets.GITHUB_TOKEN }}
Expand Down
6 changes: 4 additions & 2 deletions .github/workflows/gpu_fast_tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -81,9 +81,11 @@ jobs:
# Fail if the triggering actor is not part of Zama organization.
# If pull_request_target is emitted and CI files have changed, skip this job. This would skip following jobs.
check-user-permission:
needs: check-ci-files
needs: [ check-ci-files, should-run ]
if: github.event_name != 'pull_request_target' ||
(github.event_name == 'pull_request_target' && needs.check-ci-files.outputs.ci_file_changed == 'false')
(github.event_name == 'pull_request_target' &&
needs.check-ci-files.outputs.ci_file_changed == 'false' &&
needs.should-run.outputs.gpu_test == 'true')
uses: ./.github/workflows/check_actor_permissions.yml
secrets:
TOKEN: ${{ secrets.GITHUB_TOKEN }}
Expand Down
6 changes: 4 additions & 2 deletions .github/workflows/gpu_full_multi_gpu_tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -83,9 +83,11 @@ jobs:
# Fail if the triggering actor is not part of Zama organization.
# If pull_request_target is emitted and CI files have changed, skip this job. This would skip following jobs.
check-user-permission:
needs: check-ci-files
needs: [ check-ci-files, should-run ]
if: github.event_name != 'pull_request_target' ||
(github.event_name == 'pull_request_target' && needs.check-ci-files.outputs.ci_file_changed == 'false')
(github.event_name == 'pull_request_target' &&
needs.check-ci-files.outputs.ci_file_changed == 'false' &&
needs.should-run.outputs.gpu_test == 'true')
uses: ./.github/workflows/check_actor_permissions.yml
secrets:
TOKEN: ${{ secrets.GITHUB_TOKEN }}
Expand Down
6 changes: 4 additions & 2 deletions .github/workflows/gpu_signed_integer_classic_tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -83,9 +83,11 @@ jobs:
# Fail if the triggering actor is not part of Zama organization.
# If pull_request_target is emitted and CI files have changed, skip this job. This would skip following jobs.
check-user-permission:
needs: check-ci-files
needs: [ check-ci-files, should-run ]
if: github.event_name != 'pull_request_target' ||
(github.event_name == 'pull_request_target' && needs.check-ci-files.outputs.ci_file_changed == 'false')
(github.event_name == 'pull_request_target' &&
needs.check-ci-files.outputs.ci_file_changed == 'false' &&
needs.should-run.outputs.gpu_test == 'true')
uses: ./.github/workflows/check_actor_permissions.yml
secrets:
TOKEN: ${{ secrets.GITHUB_TOKEN }}
Expand Down
6 changes: 4 additions & 2 deletions .github/workflows/gpu_signed_integer_h100_tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -83,9 +83,11 @@ jobs:
# Fail if the triggering actor is not part of Zama organization.
# If pull_request_target is emitted and CI files have changed, skip this job. This would skip following jobs.
check-user-permission:
needs: check-ci-files
needs: [ check-ci-files, should-run ]
if: github.event_name != 'pull_request_target' ||
(github.event_name == 'pull_request_target' && needs.check-ci-files.outputs.ci_file_changed == 'false')
(github.event_name == 'pull_request_target' &&
needs.check-ci-files.outputs.ci_file_changed == 'false' &&
needs.should-run.outputs.gpu_test == 'true')
uses: ./.github/workflows/check_actor_permissions.yml
secrets:
TOKEN: ${{ secrets.GITHUB_TOKEN }}
Expand Down
6 changes: 4 additions & 2 deletions .github/workflows/gpu_signed_integer_tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -86,9 +86,11 @@ jobs:
# Fail if the triggering actor is not part of Zama organization.
# If pull_request_target is emitted and CI files have changed, skip this job. This would skip following jobs.
check-user-permission:
needs: check-ci-files
needs: [ check-ci-files, should-run ]
if: github.event_name != 'pull_request_target' ||
(github.event_name == 'pull_request_target' && needs.check-ci-files.outputs.ci_file_changed == 'false')
(github.event_name == 'pull_request_target' &&
needs.check-ci-files.outputs.ci_file_changed == 'false' &&
needs.should-run.outputs.gpu_test == 'true')
uses: ./.github/workflows/check_actor_permissions.yml
secrets:
TOKEN: ${{ secrets.GITHUB_TOKEN }}
Expand Down
6 changes: 4 additions & 2 deletions .github/workflows/gpu_unsigned_integer_classic_tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -83,9 +83,11 @@ jobs:
# Fail if the triggering actor is not part of Zama organization.
# If pull_request_target is emitted and CI files have changed, skip this job. This would skip following jobs.
check-user-permission:
needs: check-ci-files
needs: [ check-ci-files, should-run ]
if: github.event_name != 'pull_request_target' ||
(github.event_name == 'pull_request_target' && needs.check-ci-files.outputs.ci_file_changed == 'false')
(github.event_name == 'pull_request_target' &&
needs.check-ci-files.outputs.ci_file_changed == 'false' &&
needs.should-run.outputs.gpu_test == 'true')
uses: ./.github/workflows/check_actor_permissions.yml
secrets:
TOKEN: ${{ secrets.GITHUB_TOKEN }}
Expand Down
6 changes: 4 additions & 2 deletions .github/workflows/gpu_unsigned_integer_h100_tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -83,9 +83,11 @@ jobs:
# Fail if the triggering actor is not part of Zama organization.
# If pull_request_target is emitted and CI files have changed, skip this job. This would skip following jobs.
check-user-permission:
needs: check-ci-files
needs: [ check-ci-files, should-run ]
if: github.event_name != 'pull_request_target' ||
(github.event_name == 'pull_request_target' && needs.check-ci-files.outputs.ci_file_changed == 'false')
(github.event_name == 'pull_request_target' &&
needs.check-ci-files.outputs.ci_file_changed == 'false' &&
needs.should-run.outputs.gpu_test == 'true')
uses: ./.github/workflows/check_actor_permissions.yml
secrets:
TOKEN: ${{ secrets.GITHUB_TOKEN }}
Expand Down
6 changes: 4 additions & 2 deletions .github/workflows/gpu_unsigned_integer_tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -87,9 +87,11 @@ jobs:
# Fail if the triggering actor is not part of Zama organization.
# If pull_request_target is emitted and CI files have changed, skip this job. This would skip following jobs.
check-user-permission:
needs: check-ci-files
needs: [ check-ci-files, should-run ]
if: github.event_name != 'pull_request_target' ||
(github.event_name == 'pull_request_target' && needs.check-ci-files.outputs.ci_file_changed == 'false')
(github.event_name == 'pull_request_target' &&
needs.check-ci-files.outputs.ci_file_changed == 'false' &&
needs.should-run.outputs.gpu_test == 'true')
uses: ./.github/workflows/check_actor_permissions.yml
secrets:
TOKEN: ${{ secrets.GITHUB_TOKEN }}
Expand Down

0 comments on commit f49630e

Please sign in to comment.