ci: add distributed lock for integration tests#99
Open
dvacca-onfido wants to merge 5 commits into
Open
Conversation
4007002 to
47948bd
Compare
Replace concurrency group with onfido-actions/lock acquire/release steps to prevent parallel integration test execution across SDK repositories. The lock uses a git branch in onfido/ci-lock as an atomic mutex. A should-run-integration-tests step centralizes the condition check, keeping subsequent steps DRY. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
This commit should be reverted before merging.
47948bd to
cc7e852
Compare
Use onfido-actions/should-run-integration-tests to determine when to run integration tests. This adds support for running tests on push events from merged fork PRs (where secrets aren't available pre-merge). Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Replace CI_LOCK_TOKEN with GitHub App credentials (ONFIDO_CI_LOCK_APP_ID, ONFIDO_CI_LOCK_PRIVATE_KEY, ONFIDO_CI_LOCK_INSTALLATION_ID) for the distributed lock mechanism. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
db5a8fd to
9a69773
Compare
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
| github.event_name == 'workflow_dispatch' || | ||
| github.event_name == 'schedule') }} | ||
| github.repository_owner == 'onfido' }} | ||
| uses: onfido/onfido-actions/should-run-integration-tests@main |
| uses: onfido/onfido-actions/should-run-integration-tests@main | ||
| - name: Acquire integration test lock | ||
| if: steps.should-run-integration-tests.outputs.result == 'true' | ||
| uses: onfido/onfido-actions/lock/acquire@main |
| ONFIDO_SAMPLE_MOTION_ID_2: ${{ secrets.ONFIDO_SAMPLE_MOTION_ID_2 }} | ||
| - name: Release integration test lock | ||
| if: always() && steps.should-run-integration-tests.outputs.result == 'true' | ||
| uses: onfido/onfido-actions/lock/release@main |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Prevents integration tests from running in parallel across SDK repositories by using a distributed lock via onfido-actions/lock.
Changes:
should-run-integration-testsaction to determine when tests should run