diff --git a/.github/workflows/deploy_tre.yml b/.github/workflows/deploy_tre.yml index bddea6979..600f0b751 100644 --- a/.github/workflows/deploy_tre.yml +++ b/.github/workflows/deploy_tre.yml @@ -4,11 +4,12 @@ name: Deploy Azure TRE # It also runs on a schedule, serving as the nightly build on: # yamllint disable-line rule:truthy - schedule: - # midnight every day https://crontab.guru/#0_0_*_*_* - - cron: "0 0 * * *" - push: - branches: [main] +# JR 29-11-2023 Disable push to repo and scheduled deployments (for now) +# schedule: +# # midnight every day https://crontab.guru/#0_0_*_*_* +# - cron: "0 0 * * *" +# push: +# branches: [main] workflow_dispatch: inputs: environment: @@ -23,8 +24,9 @@ concurrency: "${{ github.workflow }}-${{ github.ref }}" jobs: run-deploy-tre-main: - name: "Deploy main" - if: github.ref == 'refs/heads/main' + name: "Deploy" +# JR 29-11-2023 Disable main branch check - this is now controlled via GitHub environment protection rules (see Settings > Environments) +# if: github.ref == 'refs/heads/main' uses: ./.github/workflows/deploy_tre_reusable.yml permissions: checks: write diff --git a/.github/workflows/deploy_tre_no_e2e.yml b/.github/workflows/deploy_tre_no_e2e.yml new file mode 100644 index 000000000..65fe67fb8 --- /dev/null +++ b/.github/workflows/deploy_tre_no_e2e.yml @@ -0,0 +1,62 @@ +--- +name: Deploy Azure TRE - skip e2e tests +# This workflow is the integration build run for pushes to the main branch +# It also runs on a schedule, serving as the nightly build + +on: # yamllint disable-line rule:truthy +# JR 29-11-2023 Disable push to repo and scheduled deployments (for now) +# schedule: +# # midnight every day https://crontab.guru/#0_0_*_*_* +# - cron: "0 0 * * *" +# push: +# branches: [main] + workflow_dispatch: + inputs: + environment: + description: The environment to run this workflow in + type: environment + default: CICD + required: true + +# This will prevent multiple runs of this entire workflow. +# We should NOT cancel in progress runs as that can destabilize the environment. +concurrency: "${{ github.workflow }}-${{ github.ref }}" + +jobs: + run-deploy-tre-main: + name: "Deploy" +# JR 29-11-2023 Disable main branch check - this is now controlled via GitHub environment protection rules (see Settings > Environments) +# if: github.ref == 'refs/heads/main' + uses: ./.github/workflows/deploy_tre_reusable.yml + permissions: + checks: write + contents: read + pull-requests: write + with: + ciGitRef: ${{ github.ref }} + e2eTestsCustomSelector: >- + ${{ (github.event_name == 'push' && 'extended or extended_aad') + || 'extended or extended_aad or shared_services or airlock' }} + environmentName: ${{ github.event.inputs.environment || 'CICD' }} + E2E_TESTS_NUMBER_PROCESSES: 1 + DEVCONTAINER_TAG: 'latest' + ENABLE_E2E_TESTS: false + secrets: + AAD_TENANT_ID: ${{ secrets.AAD_TENANT_ID }} + ACR_NAME: ${{ secrets.ACR_NAME }} + AZURE_CREDENTIALS: ${{ secrets.AZURE_CREDENTIALS }} + API_CLIENT_ID: ${{ secrets.API_CLIENT_ID }} + API_CLIENT_SECRET: ${{ secrets.API_CLIENT_SECRET }} + APPLICATION_ADMIN_CLIENT_ID: ${{ secrets.APPLICATION_ADMIN_CLIENT_ID }} + APPLICATION_ADMIN_CLIENT_SECRET: ${{ secrets.APPLICATION_ADMIN_CLIENT_SECRET }} + MGMT_RESOURCE_GROUP_NAME: ${{ secrets.MGMT_RESOURCE_GROUP_NAME }} + MS_TEAMS_WEBHOOK_URI: ${{ secrets.MS_TEAMS_WEBHOOK_URI }} + MGMT_STORAGE_ACCOUNT_NAME: ${{ secrets.MGMT_STORAGE_ACCOUNT_NAME }} + SWAGGER_UI_CLIENT_ID: ${{ secrets.SWAGGER_UI_CLIENT_ID }} + TEST_APP_ID: ${{ secrets.TEST_APP_ID }} + TEST_WORKSPACE_APP_ID: ${{ secrets.TEST_WORKSPACE_APP_ID }} + TEST_WORKSPACE_APP_SECRET: "${{ secrets.TEST_WORKSPACE_APP_SECRET }}" + TEST_ACCOUNT_CLIENT_ID: "${{ secrets.TEST_ACCOUNT_CLIENT_ID }}" + TEST_ACCOUNT_CLIENT_SECRET: "${{ secrets.TEST_ACCOUNT_CLIENT_SECRET }}" + TRE_ID: ${{ secrets.TRE_ID }} + CI_CACHE_ACR_NAME: ${{ secrets.ACR_NAME }} diff --git a/.github/workflows/deploy_tre_reusable.yml b/.github/workflows/deploy_tre_reusable.yml index e775bed80..562602f20 100644 --- a/.github/workflows/deploy_tre_reusable.yml +++ b/.github/workflows/deploy_tre_reusable.yml @@ -35,6 +35,11 @@ on: # yamllint disable-line rule:truthy description: "" type: string required: true + ENABLE_E2E_TESTS: + description: Flag to enable/disable end-to-end tests. Enabled by default + type: boolean + default: true + required: false secrets: AAD_TENANT_ID: description: "" @@ -175,7 +180,7 @@ jobs: fi - name: Report check status start - if: inputs.prHeadSha != '' + if: ${{ inputs.ENABLE_E2E_TESTS && (inputs.prHeadSha != '') }} uses: LouisBrunner/checks-action@v2.0.0 with: token: ${{ secrets.GITHUB_TOKEN }} @@ -723,6 +728,7 @@ jobs: e2e_tests_smoke: name: "Run E2E Tests (Smoke)" + if: ${{ inputs.ENABLE_E2E_TESTS }} runs-on: ubuntu-latest environment: ${{ inputs.environmentName }} needs: [deploy_shared_services, register_bundles, deploy_ui] @@ -765,7 +771,7 @@ jobs: e2e_tests_custom: name: "Run E2E Tests" - if: ${{ inputs.e2eTestsCustomSelector != '' }} + if: ${{ inputs.ENABLE_E2E_TESTS && (inputs.e2eTestsCustomSelector != '') }} runs-on: ubuntu-latest environment: ${{ inputs.environmentName }} needs: [deploy_shared_services, register_bundles, register_user_resource_bundles] @@ -814,7 +820,7 @@ jobs: permissions: checks: write contents: read - if: always() + if: ${{ inputs.ENABLE_E2E_TESTS && always() }} environment: ${{ inputs.environmentName }} steps: # - uses: technote-space/workflow-conclusion-action@v3 (removed due to archived repo and deprecated node.js version)