Skip to content

Commit

Permalink
feat(docker): Disable funTest-docker on ort-docker workflow
Browse files Browse the repository at this point in the history
funTest-docker job has an indirect race condition when in the same CI
job a new docker image is scheduled to build.

If any new tooling version depends of update test dataset, the tests
will run against docker snapshot version that is not the expected image
the new code should test.

To prevent this race conditions, funTest-docker will run only if the
docker image is scheduled to be build, handling the tests no this case
to the ort-docker workflow.

Signed-off-by: Helio Chissini de Castro <[email protected]>
  • Loading branch information
heliocastro committed Mar 10, 2024
1 parent 4590097 commit 5b60a74
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions .github/workflows/build-and-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,24 @@ jobs:
with:
token: ${{ secrets.CODECOV_TOKEN }}
flags: funTest-non-docker
docker-build-check:
runs-on: ubuntu-22.04
outputs:
skip: ${{ steps.check.outputs.skip }}
steps:
- name: Scheduled docker build
id: check
shell: bash
run: |
# Uses gh API and jq to check is docker is scheduled to run, so tests will be done there
if [[ "$(gh api repos/:owner/:repo/actions/runs --jq '.workflow_runs[] | select(.name == "docker-ort" and (.status == "in_progress" or .status == "queued"))')" != "" ]]; then
echo "::set-output name=skip::true"
else
echo "::set-output name=skip::false"
fi
funTest-docker:
needs: docker-build-check
if: needs.docker-build-check.outputs.skip == 'false'
runs-on: ubuntu-22.04
container:
image: ghcr.io/oss-review-toolkit/ort:snapshot
Expand Down

0 comments on commit 5b60a74

Please sign in to comment.