Skip to content

ci: add distributed lock for integration tests#183

Open
dvacca-onfido wants to merge 5 commits into
masterfrom
add-concurrency-group
Open

ci: add distributed lock for integration tests#183
dvacca-onfido wants to merge 5 commits into
masterfrom
add-concurrency-group

Conversation

@dvacca-onfido

@dvacca-onfido dvacca-onfido commented Jul 7, 2026

Copy link
Copy Markdown
Collaborator

Prevents integration tests from running in parallel across SDK repositories by using a distributed lock via onfido-actions/lock.

Changes:

  • Add should-run-integration-tests action to determine when tests should run
  • Acquire/release a cross-repo lock around integration tests

@dvacca-onfido dvacca-onfido force-pushed the add-concurrency-group branch from b7a5504 to 8a450d1 Compare July 8, 2026 07:45
Comment thread .github/workflows/maven.yml Fixed
Comment thread .github/workflows/maven.yml Fixed
dvacca-onfido and others added 2 commits July 8, 2026 09:49
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.
@dvacca-onfido dvacca-onfido force-pushed the add-concurrency-group branch from 8a450d1 to d7cd2aa Compare July 8, 2026 07:51
Comment thread .github/workflows/maven.yml Fixed
Comment thread .github/workflows/maven.yml Fixed
@dvacca-onfido dvacca-onfido changed the title ci: add concurrency group to prevent parallel integration tests [CAT-2931] ci: use distributed lock for integration tests Jul 8, 2026
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>
Comment thread .github/workflows/maven.yml Fixed
Comment thread .github/workflows/maven.yml Fixed
Comment thread .github/workflows/maven.yml Fixed
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>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
- name: Should run integration tests
id: should-run-integration-tests
if: ${{ 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
@dvacca-onfido dvacca-onfido changed the title [CAT-2931] ci: use distributed lock for integration tests ci: add distributed lock for integration tests Jul 10, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants