Skip to content

Commit

Permalink
conditional matrix test
Browse files Browse the repository at this point in the history
  • Loading branch information
david-leifker committed Jan 19, 2024
1 parent badde2c commit 068d057
Showing 1 changed file with 43 additions and 29 deletions.
72 changes: 43 additions & 29 deletions .github/workflows/docker-unified.yml
Original file line number Diff line number Diff line change
Expand Up @@ -92,8 +92,6 @@ jobs:
runs-on: ubuntu-latest
needs: setup
if: ${{ needs.setup.outputs.backend_change == 'true' || needs.setup.outputs.publish == 'true' }}
outputs:
run_scan: ${{ steps.ci-optimize.outputs.backend-change == 'true' }}
steps:
- name: Set up JDK 17
uses: actions/setup-java@v3
Expand Down Expand Up @@ -767,22 +765,29 @@ jobs:
with:
sarif_file: "trivy-results.sarif"

smoke_test_matrix:
runs-on: ubuntu-latest
needs: setup
outputs:
matrix: ${{ steps.set-matrix.outputs.matrix }}
steps:
- id: set-matrix
run: |

Check failure on line 775 in .github/workflows/docker-unified.yml

View workflow job for this annotation

GitHub Actions / actionlint

[actionlint] reported by reviewdog 🐶 shellcheck reported issue in this script: SC2086:info:2:59: Double quote to prevent globbing and word splitting [shellcheck] Raw Output: .github/workflows/docker-unified.yml:775:9: shellcheck reported issue in this script: SC2086:info:2:59: Double quote to prevent globbing and word splitting [shellcheck]

Check failure on line 775 in .github/workflows/docker-unified.yml

View workflow job for this annotation

GitHub Actions / actionlint

[actionlint] reported by reviewdog 🐶 shellcheck reported issue in this script: SC2086:info:4:67: Double quote to prevent globbing and word splitting [shellcheck] Raw Output: .github/workflows/docker-unified.yml:775:9: shellcheck reported issue in this script: SC2086:info:4:67: Double quote to prevent globbing and word splitting [shellcheck]

Check failure on line 775 in .github/workflows/docker-unified.yml

View workflow job for this annotation

GitHub Actions / actionlint

[actionlint] reported by reviewdog 🐶 shellcheck reported issue in this script: SC2086:info:6:103: Double quote to prevent globbing and word splitting [shellcheck] Raw Output: .github/workflows/docker-unified.yml:775:9: shellcheck reported issue in this script: SC2086:info:6:103: Double quote to prevent globbing and word splitting [shellcheck]
if [ ${{ needs.setup.outputs.frontend_only }} == 'true' ]; then
echo "matrix=[\"cypress_suite1\",\"cypress_rest\"]" >> $GITHUB_OUTPUT
elif [ ${{ needs.setup.outputs.ingestion_only }} == 'true' ]; then
echo "matrix=[\"no_cypress_suite0\",\"no_cypress_suite1\"]" >> $GITHUB_OUTPUT
else
echo "matrix=[\"no_cypress_suite0\",\"no_cypress_suite1\",\"cypress_suite1\",\"cypress_rest\"]" >> $GITHUB_OUTPUT
fi
smoke_test:
name: Run Smoke Tests
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
test_strategy:
[
"no_cypress_suite0",
"no_cypress_suite1",
"cypress_suite1",
"cypress_rest",
]
needs:
[
setup,
smoke_test_matrix,
gms_build,
frontend_build,
kafka_setup_build,
Expand All @@ -793,6 +798,10 @@ jobs:
datahub_upgrade_build,
datahub_ingestion_slim_build,
]
strategy:
fail-fast: false
matrix:
test_strategy: ${{ fromJson(needs.smoke_test_matrix.outputs.matrix) }}
if: ${{ always() && !failure() && !cancelled() }}
steps:
- name: Disk Check
Expand Down Expand Up @@ -837,7 +846,7 @@ jobs:
image: ${{ env.DATAHUB_KAFKA_SETUP_IMAGE }}:${{ needs.setup.outputs.unique_tag }}
- name: Download Mysql Setup image
uses: ishworkh/docker-image-artifact-download@v1
if: ${{ needs.setup.outputs.publish != 'true' && needs.mysql_build.result == 'success' }}
if: ${{ needs.setup.outputs.publish != 'true' && needs.mysql_setup_build.result == 'success' }}
with:
image: ${{ env.DATAHUB_MYSQL_SETUP_IMAGE }}:${{ needs.setup.outputs.unique_tag }}
- name: Download Elastic Setup image
Expand Down Expand Up @@ -870,6 +879,9 @@ jobs:
# All image tags head, except frontend image
- name: Frontend Only Image Tag Setup
if: ${{ needs.setup.outputs.frontend_only }}
env:
TEST_VERSION_TAG: ${{ needs.setup.outputs.unique_tag }}
TEST_INGESTION_VERSION_TAG: ${{ needs.datahub_ingestion_slim_build.outputs.tag }}
run: |

Check failure on line 885 in .github/workflows/docker-unified.yml

View workflow job for this annotation

GitHub Actions / actionlint

[actionlint] reported by reviewdog 🐶 shellcheck reported issue in this script: SC2086:info:11:75: Double quote to prevent globbing and word splitting [shellcheck] Raw Output: .github/workflows/docker-unified.yml:885:9: shellcheck reported issue in this script: SC2086:info:11:75: Double quote to prevent globbing and word splitting [shellcheck]

Check failure on line 885 in .github/workflows/docker-unified.yml

View workflow job for this annotation

GitHub Actions / actionlint

[actionlint] reported by reviewdog 🐶 shellcheck reported issue in this script: SC2086:info:12:91: Double quote to prevent globbing and word splitting [shellcheck] Raw Output: .github/workflows/docker-unified.yml:885:9: shellcheck reported issue in this script: SC2086:info:12:91: Double quote to prevent globbing and word splitting [shellcheck]

Check failure on line 885 in .github/workflows/docker-unified.yml

View workflow job for this annotation

GitHub Actions / actionlint

[actionlint] reported by reviewdog 🐶 shellcheck reported issue in this script: SC2086:info:13:91: Double quote to prevent globbing and word splitting [shellcheck] Raw Output: .github/workflows/docker-unified.yml:885:9: shellcheck reported issue in this script: SC2086:info:13:91: Double quote to prevent globbing and word splitting [shellcheck]

Check failure on line 885 in .github/workflows/docker-unified.yml

View workflow job for this annotation

GitHub Actions / actionlint

[actionlint] reported by reviewdog 🐶 shellcheck reported issue in this script: SC2086:info:14:95: Double quote to prevent globbing and word splitting [shellcheck] Raw Output: .github/workflows/docker-unified.yml:885:9: shellcheck reported issue in this script: SC2086:info:14:95: Double quote to prevent globbing and word splitting [shellcheck]

Check failure on line 885 in .github/workflows/docker-unified.yml

View workflow job for this annotation

GitHub Actions / actionlint

[actionlint] reported by reviewdog 🐶 shellcheck reported issue in this script: SC2086:info:15:93: Double quote to prevent globbing and word splitting [shellcheck] Raw Output: .github/workflows/docker-unified.yml:885:9: shellcheck reported issue in this script: SC2086:info:15:93: Double quote to prevent globbing and word splitting [shellcheck]

Check failure on line 885 in .github/workflows/docker-unified.yml

View workflow job for this annotation

GitHub Actions / actionlint

[actionlint] reported by reviewdog 🐶 shellcheck reported issue in this script: SC2086:info:16:93: Double quote to prevent globbing and word splitting [shellcheck] Raw Output: .github/workflows/docker-unified.yml:885:9: shellcheck reported issue in this script: SC2086:info:16:93: Double quote to prevent globbing and word splitting [shellcheck]
echo "Pulling head images"
docker pull ${{ env.DATAHUB_GMS_IMAGE }}:head
Expand All @@ -881,17 +893,19 @@ jobs:
docker pull ${{ env.DATAHUB_UPGRADE_IMAGE }}:head
docker pull ${{ env.DATAHUB_INGESTION_IMAGE }}:head
echo "Tagging head images"
docker tag ${{ env.DATAHUB_GMS_IMAGE }}:head ${{ env.DATAHUB_GMS_IMAGE }}:${{ needs.setup.outputs.unique_tag }}
docker tag ${{ env.DATAHUB_KAFKA_SETUP_IMAGE }}:head ${{ env.DATAHUB_KAFKA_SETUP_IMAGE }}:${{ needs.setup.outputs.unique_tag }}
docker tag ${{ env.DATAHUB_MYSQL_SETUP_IMAGE }}:head ${{ env.DATAHUB_MYSQL_SETUP_IMAGE }}:${{ needs.setup.outputs.unique_tag }}
docker tag ${{ env.DATAHUB_ELASTIC_SETUP_IMAGE }}:head ${{ env.DATAHUB_ELASTIC_SETUP_IMAGE }}:${{ needs.setup.outputs.unique_tag }}
docker tag ${{ env.DATAHUB_MCE_CONSUMER_IMAGE }}:head ${{ env.DATAHUB_MCE_CONSUMER_IMAGE }}:${{ needs.setup.outputs.unique_tag }}
docker tag ${{ env.DATAHUB_MAE_CONSUMER_IMAGE }}:head ${{ env.DATAHUB_MAE_CONSUMER_IMAGE }}:${{ needs.setup.outputs.unique_tag }}
docker tag ${{ env.DATAHUB_UPGRADE_IMAGE }}:head ${{ env.DATAHUB_UPGRADE_IMAGE }}:${{ needs.setup.outputs.unique_tag }}
docker tag ${{ env.DATAHUB_INGESTION_IMAGE }}:head ${{ env.DATAHUB_INGESTION_IMAGE }}:${{ needs.datahub_ingestion_slim_build.outputs.tag }}
docker tag ${{ env.DATAHUB_GMS_IMAGE }}:head ${{ env.DATAHUB_GMS_IMAGE }}:$TEST_VERSION_TAG
docker tag ${{ env.DATAHUB_KAFKA_SETUP_IMAGE }}:head ${{ env.DATAHUB_KAFKA_SETUP_IMAGE }}:$TEST_VERSION_TAG
docker tag ${{ env.DATAHUB_MYSQL_SETUP_IMAGE }}:head ${{ env.DATAHUB_MYSQL_SETUP_IMAGE }}:$TEST_VERSION_TAG
docker tag ${{ env.DATAHUB_ELASTIC_SETUP_IMAGE }}:head ${{ env.DATAHUB_ELASTIC_SETUP_IMAGE }}:$TEST_VERSION_TAG
docker tag ${{ env.DATAHUB_MCE_CONSUMER_IMAGE }}:head ${{ env.DATAHUB_MCE_CONSUMER_IMAGE }}:$TEST_VERSION_TAG
docker tag ${{ env.DATAHUB_MAE_CONSUMER_IMAGE }}:head ${{ env.DATAHUB_MAE_CONSUMER_IMAGE }}:$TEST_VERSION_TAG
docker tag ${{ env.DATAHUB_UPGRADE_IMAGE }}:head ${{ env.DATAHUB_UPGRADE_IMAGE }}:$TEST_VERSION_TAG
docker tag ${{ env.DATAHUB_INGESTION_IMAGE }}:head ${{ env.DATAHUB_INGESTION_IMAGE }}:$TEST_INGESTION_VERSION_TAG
# All image tags head, except for ingestion base
- name: Ingestion Only Image Tag Setup
if: ${{ needs.setup.outputs.ingestion_only }}
env:
TEST_VERSION_TAG: ${{ needs.setup.outputs.unique_tag }}
run: |
echo "Pulling head images"
docker pull ${{ env.DATAHUB_GMS_IMAGE }}:head
Expand All @@ -903,14 +917,14 @@ jobs:
docker pull ${{ env.DATAHUB_MAE_CONSUMER_IMAGE }}:head
docker pull ${{ env.DATAHUB_UPGRADE_IMAGE }}:head
echo "Tagging head images"
docker tag ${{ env.DATAHUB_GMS_IMAGE }}:head ${{ env.DATAHUB_GMS_IMAGE }}:${{ needs.setup.outputs.unique_tag }}
docker tag ${{ env.DATAHUB_FRONTEND_IMAGE }}:head ${{ env.DATAHUB_FRONTEND_IMAGE }}:${{ needs.setup.outputs.unique_tag }}
docker tag ${{ env.DATAHUB_KAFKA_SETUP_IMAGE }}:head ${{ env.DATAHUB_KAFKA_SETUP_IMAGE }}:${{ needs.setup.outputs.unique_tag }}
docker tag ${{ env.DATAHUB_MYSQL_SETUP_IMAGE }}:head ${{ env.DATAHUB_MYSQL_SETUP_IMAGE }}:${{ needs.setup.outputs.unique_tag }}
docker tag ${{ env.DATAHUB_ELASTIC_SETUP_IMAGE }}:head ${{ env.DATAHUB_ELASTIC_SETUP_IMAGE }}:${{ needs.setup.outputs.unique_tag }}
docker tag ${{ env.DATAHUB_MCE_CONSUMER_IMAGE }}:head ${{ env.DATAHUB_MCE_CONSUMER_IMAGE }}:${{ needs.setup.outputs.unique_tag }}
docker tag ${{ env.DATAHUB_MAE_CONSUMER_IMAGE }}:head ${{ env.DATAHUB_MAE_CONSUMER_IMAGE }}:${{ needs.setup.outputs.unique_tag }}
docker tag ${{ env.DATAHUB_UPGRADE_IMAGE }}:head ${{ env.DATAHUB_UPGRADE_IMAGE }}:${{ needs.setup.outputs.unique_tag }}
docker tag ${{ env.DATAHUB_GMS_IMAGE }}:head ${{ env.DATAHUB_GMS_IMAGE }}:$TEST_VERSION_TAG
docker tag ${{ env.DATAHUB_FRONTEND_IMAGE }}:head ${{ env.DATAHUB_FRONTEND_IMAGE }}:$TEST_VERSION_TAG
docker tag ${{ env.DATAHUB_KAFKA_SETUP_IMAGE }}:head ${{ env.DATAHUB_KAFKA_SETUP_IMAGE }}:$TEST_VERSION_TAG
docker tag ${{ env.DATAHUB_MYSQL_SETUP_IMAGE }}:head ${{ env.DATAHUB_MYSQL_SETUP_IMAGE }}:$TEST_VERSION_TAG
docker tag ${{ env.DATAHUB_ELASTIC_SETUP_IMAGE }}:head ${{ env.DATAHUB_ELASTIC_SETUP_IMAGE }}:$TEST_VERSION_TAG
docker tag ${{ env.DATAHUB_MCE_CONSUMER_IMAGE }}:head ${{ env.DATAHUB_MCE_CONSUMER_IMAGE }}:$TEST_VERSION_TAG
docker tag ${{ env.DATAHUB_MAE_CONSUMER_IMAGE }}:head ${{ env.DATAHUB_MAE_CONSUMER_IMAGE }}:$TEST_VERSION_TAG
docker tag ${{ env.DATAHUB_UPGRADE_IMAGE }}:head ${{ env.DATAHUB_UPGRADE_IMAGE }}:$TEST_VERSION_TAG
- name: run quickstart
env:
DATAHUB_TELEMETRY_ENABLED: false
Expand Down

0 comments on commit 068d057

Please sign in to comment.