[ACS-7241] Fixed if structure to properly run jobs if some are skipped (#4489)

* [ACS-7241] Test changes

* [ACS-7241] Change condition to always and add additional step for proper verification

* [ACS-7241] Echo additional info

* [ACS-7241] Echo additional info

* [ACS-7241] Echo additional info

* [ACS-7241] Echo additional info

* [ACS-7241] Fixed if conditionals
This commit is contained in:
MichalKinas 2025-03-31 11:59:38 +02:00 committed by GitHub
parent af3b54129e
commit c09bfc0809
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -93,13 +93,15 @@ jobs:
- run: npm run affected:test -- --browsers=ChromeHeadless --watch=false $TEST_OPTS --base=origin/develop - run: npm run affected:test -- --browsers=ChromeHeadless --watch=false $TEST_OPTS --base=origin/develop
publish-docker-registry: publish-docker-registry:
if: | if: ${{ always() }}
always() &&
(${{ inputs.publish-to-quay == 'true' }} && (${{ needs.unit-tests.result == 'success' }} || ${{ needs.unit-tests.result == 'skipped' }}))
needs: [lint, unit-tests] needs: [lint, unit-tests]
name: "Publish to Quay" name: "Publish to Quay"
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
- name: Check previous jobs status
if: ${{ inputs.publish-to-quay == 'false' || contains(needs.*.result, 'failure') || contains(needs.*.result, 'cancelled') }}
run: exit 1
- name: Checkout - name: Checkout
uses: actions/checkout@v4 uses: actions/checkout@v4
with: with:
@ -128,13 +130,15 @@ jobs:
dry-run: ${{ inputs.dry-run-release }} dry-run: ${{ inputs.dry-run-release }}
publish-to-dockerhub: publish-to-dockerhub:
if: | if: ${{ always() }}
always() &&
(${{ inputs.publish-to-docker == 'true' }} && (${{ needs.unit-tests.result == 'success' }} || ${{ needs.unit-tests.result == 'skipped' }}))
needs: [lint, unit-tests] needs: [lint, unit-tests]
name: "Publish to Dockerhub" name: "Publish to Dockerhub"
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
- name: Check previous jobs status
if: ${{ inputs.publish-to-docker == 'false' || contains(needs.*.result, 'failure') || contains(needs.*.result, 'cancelled') }}
run: exit 1
- name: Checkout - name: Checkout
uses: actions/checkout@v4 uses: actions/checkout@v4
with: with:
@ -163,13 +167,15 @@ jobs:
dry-run: ${{ inputs.dry-run-release }} dry-run: ${{ inputs.dry-run-release }}
publish-git-tag: publish-git-tag:
if: | if: ${{ always() }}
always() &&
(${{ inputs.publish-git-tag == 'true' }} && (${{ needs.unit-tests.result == 'success' }} || ${{ needs.unit-tests.result == 'skipped' }}))
needs: [lint, unit-tests] needs: [lint, unit-tests]
name: "Publish Git Tag" name: "Publish Git Tag"
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
- name: Check previous jobs status
if: ${{ inputs.publish-git-tag == 'false' || contains(needs.*.result, 'failure') || contains(needs.*.result, 'cancelled') }}
run: exit 1
- name: Checkout - name: Checkout
uses: actions/checkout@v4 uses: actions/checkout@v4
with: with:
@ -195,15 +201,17 @@ jobs:
dry-run: ${{ inputs.dry-run-release }} dry-run: ${{ inputs.dry-run-release }}
publish-libs: publish-libs:
if: | if: ${{ always() }}
always() &&
(${{ inputs.publish-to-npm == 'true' }} && ( ${{ needs.unit-tests.result == 'success' }} || ${{ needs.unit-tests.result == 'skipped' }}))
needs: [lint, unit-tests] needs: [lint, unit-tests]
name: "Publish libs to NPM and GitHub registry" name: "Publish libs to NPM and GitHub registry"
runs-on: ubuntu-latest runs-on: ubuntu-latest
permissions: permissions:
packages: write packages: write
steps: steps:
- name: Check previous jobs status
if: ${{ inputs.publish-to-npm == 'false' || contains(needs.*.result, 'failure') || contains(needs.*.result, 'cancelled') }}
run: exit 1
- name: Checkout - name: Checkout
uses: actions/checkout@v4 uses: actions/checkout@v4
with: with: