Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: add prerlease check before prod deploy, split regression into selfserve/internal steps #534

Merged
merged 8 commits into from
Jan 7, 2025
72 changes: 61 additions & 11 deletions .github/workflows/cd.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -341,12 +341,30 @@ jobs:
pull-requests: write
secrets: inherit

test_int:
test_int_selfserve:
if: ${{ always() && !cancelled() && !failure() && needs.terraform_env_int.result == 'success' }}
name: Run Tests on INT
name: Run Selfserve Regression Tests on INT
needs:
- terraform_env_int
uses: dvsa/vol-functional-tests/.github/workflows/e2eSmoke.yaml@main
uses: dvsa/vol-functional-tests/.github/workflows/e2eSelfServeRegression.yaml@main
with:
platform_env: int
aws_role: ${{ vars.ACCOUNT_NONPROD_TEST_OIDC_ROLE }}
bucket_name: ${{ vars.ACCOUNT_NONPROD_S3_REPORT_BUCKET }}
bucket_key: ${{ vars.S3_REPORT_BUCKET_KEY }}
batch_job_queue: ${{ vars.ACCOUNT_NONPROD_BATCH_JOB_QUEUE }}
batch_job_definition: ${{ vars.ACCOUNT_NONPROD_BATCH_JOB_DEFINITION }}
permissions:
contents: write
id-token: write
checks: write

test_int_internal:
if: ${{ always() && !cancelled() && !failure() && needs.terraform_env_int.result == 'success' }}
name: Run Internal Regression Tests on INT
needs:
- terraform_env_int
uses: dvsa/vol-functional-tests/.github/workflows/e2eInternalRegression.yaml@main
with:
platform_env: int
aws_role: ${{ vars.ACCOUNT_NONPROD_TEST_OIDC_ROLE }}
Expand All @@ -363,10 +381,12 @@ jobs:
name: Rollback INT Deployment
if: |
always() &&
(needs.test_int.result == 'failure' || needs.test_int.result == 'cancelled') &&
needs.terraform_env_int.result == 'success'
(needs.test_int_selfserve.result == 'failure' || needs.test_int_selfserve.result == 'cancelled' ||
needs.test_int_internal.result == 'failure' || needs.test_int_internal.result == 'cancelled') &&
needs.terraform_env_int.result == 'success'
needs:
- test_int
- test_int_selfserve
- test_int_internal
- terraform_env_int
uses: ./.github/workflows/deploy-environment.yaml
with:
Expand Down Expand Up @@ -410,7 +430,8 @@ jobs:
- release-please
- orchestrator
- terraform_env_int
- test_int
- test_int_internal
- test_int_selfserve
uses: ./.github/workflows/deploy-account.yaml
with:
account: prod
Expand Down Expand Up @@ -446,12 +467,30 @@ jobs:
pull-requests: write
secrets: inherit

test_prep:
name: Run Tests on PREP
test_prep_selfserve:
name: Run Selfserve Regression Tests on PREP
if: ${{ always() && !cancelled() && !failure() && needs.terraform_env_prep.result == 'success' }}
needs:
- terraform_env_prep
uses: dvsa/vol-functional-tests/.github/workflows/e2eSmoke.yaml@main
uses: dvsa/vol-functional-tests/.github/workflows/e2eSelfServeRegression.yaml@main
with:
platform_env: prep
aws_role: ${{ vars.ACCOUNT_PROD_TEST_OIDC_ROLE }}
bucket_name: ${{ vars.ACCOUNT_PROD_S3_REPORT_BUCKET }}
bucket_key: ${{ vars.S3_REPORT_BUCKET_KEY }}
batch_job_queue: ${{ vars.ACCOUNT_PROD_BATCH_JOB_QUEUE }}
batch_job_definition: ${{ vars.ACCOUNT_PROD_BATCH_JOB_DEFINITION }}
permissions:
contents: write
id-token: write
checks: write

test_prep_internal:
name: Run Internal Regression Tests on PREP
if: ${{ always() && !cancelled() && !failure() && needs.terraform_env_prep.result == 'success' }}
needs:
- terraform_env_prep
uses: dvsa/vol-functional-tests/.github/workflows/e2eInternalRegression.yaml@main
with:
platform_env: prep
aws_role: ${{ vars.ACCOUNT_PROD_TEST_OIDC_ROLE }}
Expand All @@ -466,14 +505,25 @@ jobs:

terraform_env_prod:
name: Environment (prod)
if: ${{ always() && !cancelled() && !failure() && needs.release-please.outputs.release_created }}
if: |
always() &&
!cancelled() &&
!failure() &&
needs.release-please.outputs.release_created &&
!contains(needs.get-version.outputs.api, '-') &&
!contains(needs.get-version.outputs.cli, '-') &&
!contains(needs.get-version.outputs.selfserve, '-') &&
!contains(needs.get-version.outputs.internal, '-') &&
!contains(needs.get-version.outputs.assets, '-')
concurrency:
group: terraform-environment-prod
needs:
- release-please
- get-version
- orchestrator
- terraform_env_prep
- test_prep_selfserve
- test_prep_internal
uses: ./.github/workflows/deploy-environment.yaml
with:
environment: prod
Expand Down
2 changes: 2 additions & 0 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,8 @@ jobs:
dir_names: true
files: |
infra/docker/**
files_ignore: |
infra/docker/liquibase/**
# since_last_remote_commit: true
- uses: tj-actions/changed-files@v45
id: changed-accounts-terraform-files
Expand Down
2 changes: 2 additions & 0 deletions .github/workflows/php.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ jobs:
defaults:
run:
working-directory: app/${{ inputs.project }}
if: ${{ needs.orchestrator.outputs.should-build-app }}
steps:
- uses: actions/checkout@v4
with:
Expand Down Expand Up @@ -56,6 +57,7 @@ jobs:
name: Test
needs:
- warm-cache
if: ${{ needs.orchestrator.outputs.should-build-app }}
runs-on: ubuntu-latest
defaults:
run:
Expand Down
2 changes: 1 addition & 1 deletion infra/docker/liquibase/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM liquibase/liquibase
FROM liquibase/liquibase:4.30
USER root
COPY changelog /liquibase/changelog
COPY entrypoint.sh /liquibase/
Expand Down
Loading