diff --git a/.github/workflows/ms.aad.domainservices.yml b/.github/workflows/ms.aad.domainservices.yml index 268f7e579a..be2af0f3b7 100644 --- a/.github/workflows/ms.aad.domainservices.yml +++ b/.github/workflows/ms.aad.domainservices.yml @@ -1,4 +1,4 @@ -name: 'AAD: DomainServices' +name: 'AAD - DomainServices' on: workflow_dispatch: @@ -28,6 +28,7 @@ on: - main paths: - '.github/actions/templates/**' + - '.github/workflows/template.module.yml' - '.github/workflows/ms.aad.domainservices.yml' - 'modules/Microsoft.AAD/DomainServices/**' - 'utilities/pipelines/**' @@ -35,14 +36,8 @@ on: - '!*/**/readme.md' env: - variablesPath: 'settings.yml' modulePath: 'modules/Microsoft.AAD/DomainServices' workflowPath: '.github/workflows/ms.aad.domainservices.yml' - AZURE_CREDENTIALS: ${{ secrets.AZURE_CREDENTIALS }} - ARM_SUBSCRIPTION_ID: '${{ secrets.ARM_SUBSCRIPTION_ID }}' - ARM_MGMTGROUP_ID: '${{ secrets.ARM_MGMTGROUP_ID }}' - ARM_TENANT_ID: '${{ secrets.ARM_TENANT_ID }}' - TOKEN_NAMEPREFIX: '${{ secrets.TOKEN_NAMEPREFIX }}' concurrency: group: ${{ github.workflow }} @@ -72,94 +67,19 @@ jobs: outputs: workflowInput: ${{ steps.get-workflow-param.outputs.workflowInput }} moduleTestFilePaths: ${{ steps.get-module-test-file-paths.outputs.moduleTestFilePaths }} + modulePath: '${{ env.modulePath }}' - ######################### - # Static validation # - ######################### - job_module_static_validation: - runs-on: ubuntu-20.04 - name: 'Static validation' - if: (fromJson(needs.job_initialize_pipeline.outputs.workflowInput)).staticValidation == 'true' - needs: - - job_initialize_pipeline - steps: - - name: 'Checkout' - uses: actions/checkout@v3 - with: - fetch-depth: 0 - - name: Set environment variables - uses: ./.github/actions/templates/setEnvironmentVariables - with: - variablesPath: ${{ env.variablesPath }} - - name: 'Run tests' - uses: ./.github/actions/templates/validateModulePester - with: - modulePath: '${{ env.modulePath }}' - moduleTestFilePath: '${{ env.moduleTestFilePath }}' - ############################# - # Deployment validation # - ############################# - job_module_deploy_validation: - runs-on: ubuntu-20.04 - name: 'Deploying' - if: | - !cancelled() && - (fromJson(needs.job_initialize_pipeline.outputs.workflowInput)).deploymentValidation == 'true' && - needs.job_module_static_validation.result != 'failure' + ############################## + # Call reusable workflow # + ############################## + call-workflow-passing-data: + name: 'Module' needs: - job_initialize_pipeline - - job_module_static_validation - strategy: - fail-fast: false - matrix: - moduleTestFilePaths: ${{ fromJson(needs.job_initialize_pipeline.outputs.moduleTestFilePaths) }} - steps: - - name: 'Checkout' - uses: actions/checkout@v3 - with: - fetch-depth: 0 - - name: Set environment variables - uses: ./.github/actions/templates/setEnvironmentVariables - with: - variablesPath: ${{ env.variablesPath }} - - name: 'Using test file [${{ matrix.moduleTestFilePaths }}]' - uses: ./.github/actions/templates/validateModuleDeployment - with: - templateFilePath: '${{ env.modulePath }}/${{ matrix.moduleTestFilePaths }}' - location: '${{ env.location }}' - subscriptionId: '${{ secrets.ARM_SUBSCRIPTION_ID }}' - managementGroupId: '${{ secrets.ARM_MGMTGROUP_ID }}' - removeDeployment: '${{ (fromJson(needs.job_initialize_pipeline.outputs.workflowInput)).removeDeployment }}' - - ################## - # Publishing # - ################## - job_publish_module: - name: 'Publishing' - if: github.ref == 'refs/heads/main' || github.ref == 'refs/heads/master' || github.event.inputs.prerelease == 'true' - runs-on: ubuntu-20.04 - needs: - - job_module_deploy_validation - steps: - - name: 'Checkout' - uses: actions/checkout@v3 - with: - fetch-depth: 0 - - name: Set environment variables - uses: ./.github/actions/templates/setEnvironmentVariables - with: - variablesPath: ${{ env.variablesPath }} - - name: 'Publishing' - uses: ./.github/actions/templates/publishModule - with: - templateFilePath: '${{ env.modulePath }}/deploy.bicep' - templateSpecsRGName: '${{ env.templateSpecsRGName }}' - templateSpecsRGLocation: '${{ env.templateSpecsRGLocation }}' - templateSpecsDescription: '${{ env.templateSpecsDescription }}' - templateSpecsDoPublish: '${{ env.templateSpecsDoPublish }}' - bicepRegistryName: '${{ env.bicepRegistryName }}' - bicepRegistryRGName: '${{ env.bicepRegistryRGName }}' - bicepRegistryRgLocation: '${{ env.bicepRegistryRgLocation }}' - bicepRegistryDoPublish: '${{ env.bicepRegistryDoPublish }}' - publishLatest: '${{ env.publishLatest }}' + uses: ./.github/workflows/template.module.yml + with: + workflowInput: '${{ needs.job_initialize_pipeline.outputs.workflowInput }}' + moduleTestFilePaths: '${{ needs.job_initialize_pipeline.outputs.moduleTestFilePaths }}' + modulePath: '${{ needs.job_initialize_pipeline.outputs.modulePath}}' + secrets: inherit diff --git a/.github/workflows/ms.analysisservices.servers.yml b/.github/workflows/ms.analysisservices.servers.yml index 62b7d1309a..b11b286f75 100644 --- a/.github/workflows/ms.analysisservices.servers.yml +++ b/.github/workflows/ms.analysisservices.servers.yml @@ -1,4 +1,4 @@ -name: 'AnalysisServices: Servers' +name: 'AnalysisServices - Servers' on: workflow_dispatch: @@ -28,6 +28,7 @@ on: - main paths: - '.github/actions/templates/**' + - '.github/workflows/template.module.yml' - '.github/workflows/ms.analysisservices.servers.yml' - 'modules/Microsoft.AnalysisServices/servers/**' - 'utilities/pipelines/**' @@ -35,14 +36,8 @@ on: - '!*/**/readme.md' env: - variablesPath: 'settings.yml' modulePath: 'modules/Microsoft.AnalysisServices/servers' workflowPath: '.github/workflows/ms.analysisservices.servers.yml' - AZURE_CREDENTIALS: ${{ secrets.AZURE_CREDENTIALS }} - ARM_SUBSCRIPTION_ID: '${{ secrets.ARM_SUBSCRIPTION_ID }}' - ARM_MGMTGROUP_ID: '${{ secrets.ARM_MGMTGROUP_ID }}' - ARM_TENANT_ID: '${{ secrets.ARM_TENANT_ID }}' - TOKEN_NAMEPREFIX: '${{ secrets.TOKEN_NAMEPREFIX }}' concurrency: group: ${{ github.workflow }} @@ -72,95 +67,19 @@ jobs: outputs: workflowInput: ${{ steps.get-workflow-param.outputs.workflowInput }} moduleTestFilePaths: ${{ steps.get-module-test-file-paths.outputs.moduleTestFilePaths }} + modulePath: '${{ env.modulePath }}' - ######################### - # Static validation # - ######################### - job_module_static_validation: - runs-on: ubuntu-20.04 - name: 'Static validation' - if: (fromJson(needs.job_initialize_pipeline.outputs.workflowInput)).staticValidation == 'true' - needs: - - job_initialize_pipeline - steps: - - name: 'Checkout' - uses: actions/checkout@v3 - with: - fetch-depth: 0 - - name: Set environment variables - uses: ./.github/actions/templates/setEnvironmentVariables - with: - variablesPath: ${{ env.variablesPath }} - - name: 'Run tests' - uses: ./.github/actions/templates/validateModulePester - with: - modulePath: '${{ env.modulePath }}' - moduleTestFilePath: '${{ env.moduleTestFilePath }}' - ############################# - # Deployment validation # - ############################# - job_module_deploy_validation: - runs-on: ubuntu-20.04 - name: 'Deploying' - if: | - !cancelled() && - (fromJson(needs.job_initialize_pipeline.outputs.workflowInput)).deploymentValidation == 'true' && - needs.job_module_static_validation.result != 'failure' + ############################## + # Call reusable workflow # + ############################## + call-workflow-passing-data: + name: 'Module' needs: - job_initialize_pipeline - - job_module_static_validation - strategy: - fail-fast: false - matrix: - moduleTestFilePaths: ${{ fromJson(needs.job_initialize_pipeline.outputs.moduleTestFilePaths) }} - steps: - - name: 'Checkout' - uses: actions/checkout@v3 - with: - fetch-depth: 0 - - name: Set environment variables - uses: ./.github/actions/templates/setEnvironmentVariables - with: - variablesPath: ${{ env.variablesPath }} - - name: 'Using test file [${{ matrix.moduleTestFilePaths }}]' - uses: ./.github/actions/templates/validateModuleDeployment - with: - templateFilePath: '${{ env.modulePath }}/${{ matrix.moduleTestFilePaths }}' - location: '${{ env.location }}' - subscriptionId: '${{ secrets.ARM_SUBSCRIPTION_ID }}' - managementGroupId: '${{ secrets.ARM_MGMTGROUP_ID }}' - removeDeployment: '${{ (fromJson(needs.job_initialize_pipeline.outputs.workflowInput)).removeDeployment }}' - - ################## - # Publishing # - ################## - job_publish_module: - name: 'Publishing' - if: github.ref == 'refs/heads/main' || github.ref == 'refs/heads/master' || github.event.inputs.prerelease == 'true' - runs-on: ubuntu-20.04 - needs: - - job_module_static_validation - - job_module_deploy_validation - steps: - - name: 'Checkout' - uses: actions/checkout@v3 - with: - fetch-depth: 0 - - name: Set environment variables - uses: ./.github/actions/templates/setEnvironmentVariables - with: - variablesPath: ${{ env.variablesPath }} - - name: 'Publishing' - uses: ./.github/actions/templates/publishModule - with: - templateFilePath: '${{ env.modulePath }}/deploy.bicep' - templateSpecsRGName: '${{ env.templateSpecsRGName }}' - templateSpecsRGLocation: '${{ env.templateSpecsRGLocation }}' - templateSpecsDescription: '${{ env.templateSpecsDescription }}' - templateSpecsDoPublish: '${{ env.templateSpecsDoPublish }}' - bicepRegistryName: '${{ env.bicepRegistryName }}' - bicepRegistryRGName: '${{ env.bicepRegistryRGName }}' - bicepRegistryRgLocation: '${{ env.bicepRegistryRgLocation }}' - bicepRegistryDoPublish: '${{ env.bicepRegistryDoPublish }}' - publishLatest: '${{ env.publishLatest }}' + uses: ./.github/workflows/template.module.yml + with: + workflowInput: '${{ needs.job_initialize_pipeline.outputs.workflowInput }}' + moduleTestFilePaths: '${{ needs.job_initialize_pipeline.outputs.moduleTestFilePaths }}' + modulePath: '${{ needs.job_initialize_pipeline.outputs.modulePath}}' + secrets: inherit diff --git a/.github/workflows/ms.apimanagement.service.yml b/.github/workflows/ms.apimanagement.service.yml index ee7a683190..e6b08726da 100644 --- a/.github/workflows/ms.apimanagement.service.yml +++ b/.github/workflows/ms.apimanagement.service.yml @@ -1,4 +1,4 @@ -name: 'ApiManagement: Service' +name: 'ApiManagement - Service' on: workflow_dispatch: @@ -28,6 +28,7 @@ on: - main paths: - '.github/actions/templates/**' + - '.github/workflows/template.module.yml' - '.github/workflows/ms.apimanagement.service.yml' - 'modules/Microsoft.ApiManagement/service/**' - 'utilities/pipelines/**' @@ -35,14 +36,8 @@ on: - '!*/**/readme.md' env: - variablesPath: 'settings.yml' modulePath: 'modules/Microsoft.ApiManagement/service' workflowPath: '.github/workflows/ms.apimanagement.service.yml' - AZURE_CREDENTIALS: ${{ secrets.AZURE_CREDENTIALS }} - ARM_SUBSCRIPTION_ID: '${{ secrets.ARM_SUBSCRIPTION_ID }}' - ARM_MGMTGROUP_ID: '${{ secrets.ARM_MGMTGROUP_ID }}' - ARM_TENANT_ID: '${{ secrets.ARM_TENANT_ID }}' - TOKEN_NAMEPREFIX: '${{ secrets.TOKEN_NAMEPREFIX }}' concurrency: group: ${{ github.workflow }} @@ -72,94 +67,19 @@ jobs: outputs: workflowInput: ${{ steps.get-workflow-param.outputs.workflowInput }} moduleTestFilePaths: ${{ steps.get-module-test-file-paths.outputs.moduleTestFilePaths }} + modulePath: '${{ env.modulePath }}' - ######################### - # Static validation # - ######################### - job_module_static_validation: - runs-on: ubuntu-20.04 - name: 'Static validation' - if: (fromJson(needs.job_initialize_pipeline.outputs.workflowInput)).staticValidation == 'true' - needs: - - job_initialize_pipeline - steps: - - name: 'Checkout' - uses: actions/checkout@v3 - with: - fetch-depth: 0 - - name: Set environment variables - uses: ./.github/actions/templates/setEnvironmentVariables - with: - variablesPath: ${{ env.variablesPath }} - - name: 'Run tests' - uses: ./.github/actions/templates/validateModulePester - with: - modulePath: '${{ env.modulePath }}' - moduleTestFilePath: '${{ env.moduleTestFilePath }}' - ############################# - # Deployment validation # - ############################# - job_module_deploy_validation: - runs-on: ubuntu-20.04 - name: 'Deploying' - if: | - !cancelled() && - (fromJson(needs.job_initialize_pipeline.outputs.workflowInput)).deploymentValidation == 'true' && - needs.job_module_static_validation.result != 'failure' + ############################## + # Call reusable workflow # + ############################## + call-workflow-passing-data: + name: 'Module' needs: - job_initialize_pipeline - - job_module_static_validation - strategy: - fail-fast: false - matrix: - moduleTestFilePaths: ${{ fromJson(needs.job_initialize_pipeline.outputs.moduleTestFilePaths) }} - steps: - - name: 'Checkout' - uses: actions/checkout@v3 - with: - fetch-depth: 0 - - name: Set environment variables - uses: ./.github/actions/templates/setEnvironmentVariables - with: - variablesPath: ${{ env.variablesPath }} - - name: 'Using test file [${{ matrix.moduleTestFilePaths }}]' - uses: ./.github/actions/templates/validateModuleDeployment - with: - templateFilePath: '${{ env.modulePath }}/${{ matrix.moduleTestFilePaths }}' - location: '${{ env.location }}' - subscriptionId: '${{ secrets.ARM_SUBSCRIPTION_ID }}' - managementGroupId: '${{ secrets.ARM_MGMTGROUP_ID }}' - removeDeployment: '${{ (fromJson(needs.job_initialize_pipeline.outputs.workflowInput)).removeDeployment }}' - - ################## - # Publishing # - ################## - job_publish_module: - name: 'Publishing' - if: github.ref == 'refs/heads/main' || github.ref == 'refs/heads/master' || github.event.inputs.prerelease == 'true' - runs-on: ubuntu-20.04 - needs: - - job_module_deploy_validation - steps: - - name: 'Checkout' - uses: actions/checkout@v3 - with: - fetch-depth: 0 - - name: Set environment variables - uses: ./.github/actions/templates/setEnvironmentVariables - with: - variablesPath: ${{ env.variablesPath }} - - name: 'Publishing' - uses: ./.github/actions/templates/publishModule - with: - templateFilePath: '${{ env.modulePath }}/deploy.bicep' - templateSpecsRGName: '${{ env.templateSpecsRGName }}' - templateSpecsRGLocation: '${{ env.templateSpecsRGLocation }}' - templateSpecsDescription: '${{ env.templateSpecsDescription }}' - templateSpecsDoPublish: '${{ env.templateSpecsDoPublish }}' - bicepRegistryName: '${{ env.bicepRegistryName }}' - bicepRegistryRGName: '${{ env.bicepRegistryRGName }}' - bicepRegistryRgLocation: '${{ env.bicepRegistryRgLocation }}' - bicepRegistryDoPublish: '${{ env.bicepRegistryDoPublish }}' - publishLatest: '${{ env.publishLatest }}' + uses: ./.github/workflows/template.module.yml + with: + workflowInput: '${{ needs.job_initialize_pipeline.outputs.workflowInput }}' + moduleTestFilePaths: '${{ needs.job_initialize_pipeline.outputs.moduleTestFilePaths }}' + modulePath: '${{ needs.job_initialize_pipeline.outputs.modulePath}}' + secrets: inherit diff --git a/.github/workflows/ms.appconfiguration.configurationstores.yml b/.github/workflows/ms.appconfiguration.configurationstores.yml index cda364e299..723e1e3793 100644 --- a/.github/workflows/ms.appconfiguration.configurationstores.yml +++ b/.github/workflows/ms.appconfiguration.configurationstores.yml @@ -1,4 +1,4 @@ -name: 'AppConfiguration: ConfigurationStores' +name: 'AppConfiguration - ConfigurationStores' on: workflow_dispatch: @@ -28,6 +28,7 @@ on: - main paths: - '.github/actions/templates/**' + - '.github/workflows/template.module.yml' - '.github/workflows/ms.appconfiguration.configurationstores.yml' - 'modules/Microsoft.AppConfiguration/configurationStores/**' - 'utilities/pipelines/**' @@ -35,14 +36,8 @@ on: - '!*/**/readme.md' env: - variablesPath: 'settings.yml' modulePath: 'modules/Microsoft.AppConfiguration/configurationStores' workflowPath: '.github/workflows/ms.appconfiguration.configurationstores.yml' - AZURE_CREDENTIALS: ${{ secrets.AZURE_CREDENTIALS }} - ARM_SUBSCRIPTION_ID: '${{ secrets.ARM_SUBSCRIPTION_ID }}' - ARM_MGMTGROUP_ID: '${{ secrets.ARM_MGMTGROUP_ID }}' - ARM_TENANT_ID: '${{ secrets.ARM_TENANT_ID }}' - TOKEN_NAMEPREFIX: '${{ secrets.TOKEN_NAMEPREFIX }}' concurrency: group: ${{ github.workflow }} @@ -72,94 +67,19 @@ jobs: outputs: workflowInput: ${{ steps.get-workflow-param.outputs.workflowInput }} moduleTestFilePaths: ${{ steps.get-module-test-file-paths.outputs.moduleTestFilePaths }} + modulePath: '${{ env.modulePath }}' - ######################### - # Static validation # - ######################### - job_module_static_validation: - runs-on: ubuntu-20.04 - name: 'Static validation' - if: (fromJson(needs.job_initialize_pipeline.outputs.workflowInput)).staticValidation == 'true' - needs: - - job_initialize_pipeline - steps: - - name: 'Checkout' - uses: actions/checkout@v3 - with: - fetch-depth: 0 - - name: Set environment variables - uses: ./.github/actions/templates/setEnvironmentVariables - with: - variablesPath: ${{ env.variablesPath }} - - name: 'Run tests' - uses: ./.github/actions/templates/validateModulePester - with: - modulePath: '${{ env.modulePath }}' - moduleTestFilePath: '${{ env.moduleTestFilePath }}' - ############################# - # Deployment validation # - ############################# - job_module_deploy_validation: - runs-on: ubuntu-20.04 - name: 'Deploying' - if: | - !cancelled() && - (fromJson(needs.job_initialize_pipeline.outputs.workflowInput)).deploymentValidation == 'true' && - needs.job_module_static_validation.result != 'failure' + ############################## + # Call reusable workflow # + ############################## + call-workflow-passing-data: + name: 'Module' needs: - job_initialize_pipeline - - job_module_static_validation - strategy: - fail-fast: false - matrix: - moduleTestFilePaths: ${{ fromJson(needs.job_initialize_pipeline.outputs.moduleTestFilePaths) }} - steps: - - name: 'Checkout' - uses: actions/checkout@v3 - with: - fetch-depth: 0 - - name: Set environment variables - uses: ./.github/actions/templates/setEnvironmentVariables - with: - variablesPath: ${{ env.variablesPath }} - - name: 'Using test file [${{ matrix.moduleTestFilePaths }}]' - uses: ./.github/actions/templates/validateModuleDeployment - with: - templateFilePath: '${{ env.modulePath }}/${{ matrix.moduleTestFilePaths }}' - location: '${{ env.location }}' - subscriptionId: '${{ secrets.ARM_SUBSCRIPTION_ID }}' - managementGroupId: '${{ secrets.ARM_MGMTGROUP_ID }}' - removeDeployment: '${{ (fromJson(needs.job_initialize_pipeline.outputs.workflowInput)).removeDeployment }}' - - ################## - # Publishing # - ################## - job_publish_module: - name: 'Publishing' - if: github.ref == 'refs/heads/main' || github.ref == 'refs/heads/master' || github.event.inputs.prerelease == 'true' - runs-on: ubuntu-20.04 - needs: - - job_module_deploy_validation - steps: - - name: 'Checkout' - uses: actions/checkout@v3 - with: - fetch-depth: 0 - - name: Set environment variables - uses: ./.github/actions/templates/setEnvironmentVariables - with: - variablesPath: ${{ env.variablesPath }} - - name: 'Publishing' - uses: ./.github/actions/templates/publishModule - with: - templateFilePath: '${{ env.modulePath }}/deploy.bicep' - templateSpecsRGName: '${{ env.templateSpecsRGName }}' - templateSpecsRGLocation: '${{ env.templateSpecsRGLocation }}' - templateSpecsDescription: '${{ env.templateSpecsDescription }}' - templateSpecsDoPublish: '${{ env.templateSpecsDoPublish }}' - bicepRegistryName: '${{ env.bicepRegistryName }}' - bicepRegistryRGName: '${{ env.bicepRegistryRGName }}' - bicepRegistryRgLocation: '${{ env.bicepRegistryRgLocation }}' - bicepRegistryDoPublish: '${{ env.bicepRegistryDoPublish }}' - publishLatest: '${{ env.publishLatest }}' + uses: ./.github/workflows/template.module.yml + with: + workflowInput: '${{ needs.job_initialize_pipeline.outputs.workflowInput }}' + moduleTestFilePaths: '${{ needs.job_initialize_pipeline.outputs.moduleTestFilePaths }}' + modulePath: '${{ needs.job_initialize_pipeline.outputs.modulePath}}' + secrets: inherit diff --git a/.github/workflows/ms.authorization.locks.yml b/.github/workflows/ms.authorization.locks.yml index 8c50c07c19..27b6b08d9d 100644 --- a/.github/workflows/ms.authorization.locks.yml +++ b/.github/workflows/ms.authorization.locks.yml @@ -1,4 +1,4 @@ -name: 'Authorization: Locks' +name: 'Authorization - Locks' on: workflow_dispatch: @@ -28,6 +28,7 @@ on: - main paths: - '.github/actions/templates/**' + - '.github/workflows/template.module.yml' - '.github/workflows/ms.authorization.locks.yml' - 'modules/Microsoft.Authorization/locks/**' - 'utilities/pipelines/**' @@ -35,14 +36,8 @@ on: - '!*/**/readme.md' env: - variablesPath: 'settings.yml' modulePath: 'modules/Microsoft.Authorization/locks' workflowPath: '.github/workflows/ms.authorization.locks.yml' - AZURE_CREDENTIALS: ${{ secrets.AZURE_CREDENTIALS }} - ARM_SUBSCRIPTION_ID: '${{ secrets.ARM_SUBSCRIPTION_ID }}' - ARM_MGMTGROUP_ID: '${{ secrets.ARM_MGMTGROUP_ID }}' - ARM_TENANT_ID: '${{ secrets.ARM_TENANT_ID }}' - TOKEN_NAMEPREFIX: '${{ secrets.TOKEN_NAMEPREFIX }}' concurrency: group: ${{ github.workflow }} @@ -72,97 +67,19 @@ jobs: outputs: workflowInput: ${{ steps.get-workflow-param.outputs.workflowInput }} moduleTestFilePaths: ${{ steps.get-module-test-file-paths.outputs.moduleTestFilePaths }} + modulePath: '${{ env.modulePath }}' - ######################### - # Static validation # - ######################### - job_module_static_validation: - runs-on: ubuntu-20.04 - name: 'Static validation' - if: (fromJson(needs.job_initialize_pipeline.outputs.workflowInput)).staticValidation == 'true' - needs: - - job_initialize_pipeline - steps: - - name: 'Checkout' - uses: actions/checkout@v3 - with: - fetch-depth: 0 - - name: Set environment variables - uses: ./.github/actions/templates/setEnvironmentVariables - with: - variablesPath: ${{ env.variablesPath }} - - name: 'Run tests' - uses: ./.github/actions/templates/validateModulePester - with: - modulePath: '${{ env.modulePath }}' - moduleTestFilePath: '${{ env.moduleTestFilePath }}' - ############################# - # Deployment validation # - ############################# - job_module_deploy_validation: - runs-on: ubuntu-20.04 - name: 'Deploying' - if: | - !cancelled() && - (fromJson(needs.job_initialize_pipeline.outputs.workflowInput)).deploymentValidation == 'true' && - needs.job_module_static_validation.result != 'failure' + ############################## + # Call reusable workflow # + ############################## + call-workflow-passing-data: + name: 'Module' needs: - job_initialize_pipeline - - job_module_static_validation - strategy: - fail-fast: false - matrix: - moduleTestFilePaths: ${{ fromJson(needs.job_initialize_pipeline.outputs.moduleTestFilePaths) }} - steps: - - name: 'Checkout' - uses: actions/checkout@v3 - with: - fetch-depth: 0 - - name: Set environment variables - uses: ./.github/actions/templates/setEnvironmentVariables - with: - variablesPath: ${{ env.variablesPath }} - # ------------------- # - ## Deploy & Remove ## - # ------------------- # - - name: 'Using test file [${{ matrix.moduleTestFilePaths }}]' - uses: ./.github/actions/templates/validateModuleDeployment - with: - templateFilePath: '${{ env.modulePath }}/${{ matrix.moduleTestFilePaths }}' - location: '${{ env.location }}' - subscriptionId: '${{ secrets.ARM_SUBSCRIPTION_ID }}' - managementGroupId: '${{ secrets.ARM_MGMTGROUP_ID }}' - removeDeployment: '${{ (fromJson(needs.job_initialize_pipeline.outputs.workflowInput)).removeDeployment }}' - - ################## - # Publishing # - ################## - job_publish_module: - name: 'Publishing' - if: github.ref == 'refs/heads/main' || github.ref == 'refs/heads/master' || github.event.inputs.prerelease == 'true' - runs-on: ubuntu-20.04 - needs: - - job_module_deploy_validation - steps: - - name: 'Checkout' - uses: actions/checkout@v3 - with: - fetch-depth: 0 - - name: Set environment variables - uses: ./.github/actions/templates/setEnvironmentVariables - with: - variablesPath: ${{ env.variablesPath }} - - name: 'Publishing' - uses: ./.github/actions/templates/publishModule - with: - templateFilePath: '${{ env.modulePath }}/deploy.bicep' - templateSpecsRGName: '${{ env.templateSpecsRGName }}' - templateSpecsRGLocation: '${{ env.templateSpecsRGLocation }}' - templateSpecsDescription: '${{ env.templateSpecsDescription }}' - templateSpecsDoPublish: '${{ env.templateSpecsDoPublish }}' - bicepRegistryName: '${{ env.bicepRegistryName }}' - bicepRegistryRGName: '${{ env.bicepRegistryRGName }}' - bicepRegistryRgLocation: '${{ env.bicepRegistryRgLocation }}' - bicepRegistryDoPublish: '${{ env.bicepRegistryDoPublish }}' - publishLatest: '${{ env.publishLatest }}' + uses: ./.github/workflows/template.module.yml + with: + workflowInput: '${{ needs.job_initialize_pipeline.outputs.workflowInput }}' + moduleTestFilePaths: '${{ needs.job_initialize_pipeline.outputs.moduleTestFilePaths }}' + modulePath: '${{ needs.job_initialize_pipeline.outputs.modulePath}}' + secrets: inherit diff --git a/.github/workflows/ms.authorization.policyassignments.yml b/.github/workflows/ms.authorization.policyassignments.yml index 3f0e723750..1a2a03d43c 100644 --- a/.github/workflows/ms.authorization.policyassignments.yml +++ b/.github/workflows/ms.authorization.policyassignments.yml @@ -1,4 +1,4 @@ -name: 'Authorization: PolicyAssignments' +name: 'Authorization - PolicyAssignments' on: workflow_dispatch: @@ -28,6 +28,7 @@ on: - main paths: - '.github/actions/templates/**' + - '.github/workflows/template.module.yml' - '.github/workflows/ms.authorization.policyassignments.yml' - 'modules/Microsoft.Authorization/policyAssignments/**' - 'utilities/pipelines/**' @@ -35,14 +36,8 @@ on: - '!*/**/readme.md' env: - variablesPath: 'settings.yml' modulePath: 'modules/Microsoft.Authorization/policyAssignments' workflowPath: '.github/workflows/ms.authorization.policyassignments.yml' - AZURE_CREDENTIALS: ${{ secrets.AZURE_CREDENTIALS }} - ARM_SUBSCRIPTION_ID: '${{ secrets.ARM_SUBSCRIPTION_ID }}' - ARM_MGMTGROUP_ID: '${{ secrets.ARM_MGMTGROUP_ID }}' - ARM_TENANT_ID: '${{ secrets.ARM_TENANT_ID }}' - TOKEN_NAMEPREFIX: '${{ secrets.TOKEN_NAMEPREFIX }}' concurrency: group: ${{ github.workflow }} @@ -72,97 +67,19 @@ jobs: outputs: workflowInput: ${{ steps.get-workflow-param.outputs.workflowInput }} moduleTestFilePaths: ${{ steps.get-module-test-file-paths.outputs.moduleTestFilePaths }} + modulePath: '${{ env.modulePath }}' - ######################### - # Static validation # - ######################### - job_module_static_validation: - runs-on: ubuntu-20.04 - name: 'Static validation' - if: (fromJson(needs.job_initialize_pipeline.outputs.workflowInput)).staticValidation == 'true' - needs: - - job_initialize_pipeline - steps: - - name: 'Checkout' - uses: actions/checkout@v3 - with: - fetch-depth: 0 - - name: Set environment variables - uses: ./.github/actions/templates/setEnvironmentVariables - with: - variablesPath: ${{ env.variablesPath }} - - name: 'Run tests' - uses: ./.github/actions/templates/validateModulePester - with: - modulePath: '${{ env.modulePath }}' - moduleTestFilePath: '${{ env.moduleTestFilePath }}' - ############################# - # Deployment validation # - ############################# - job_module_deploy_validation: - runs-on: ubuntu-20.04 - name: 'Deploying' - if: | - !cancelled() && - (fromJson(needs.job_initialize_pipeline.outputs.workflowInput)).deploymentValidation == 'true' && - needs.job_module_static_validation.result != 'failure' + ############################## + # Call reusable workflow # + ############################## + call-workflow-passing-data: + name: 'Module' needs: - job_initialize_pipeline - - job_module_static_validation - strategy: - fail-fast: false - matrix: - moduleTestFilePaths: ${{ fromJson(needs.job_initialize_pipeline.outputs.moduleTestFilePaths) }} - steps: - - name: 'Checkout' - uses: actions/checkout@v3 - with: - fetch-depth: 0 - - name: Set environment variables - uses: ./.github/actions/templates/setEnvironmentVariables - with: - variablesPath: ${{ env.variablesPath }} - # ------------------- # - ## Deploy & Remove ## - # ------------------- # - - name: 'Using test file [${{ matrix.moduleTestFilePaths }}]' - uses: ./.github/actions/templates/validateModuleDeployment - with: - templateFilePath: '${{ env.modulePath }}/${{ matrix.moduleTestFilePaths }}' - location: '${{ env.location }}' - subscriptionId: '${{ secrets.ARM_SUBSCRIPTION_ID }}' - managementGroupId: '${{ secrets.ARM_MGMTGROUP_ID }}' - removeDeployment: '${{ (fromJson(needs.job_initialize_pipeline.outputs.workflowInput)).removeDeployment }}' - - ################## - # Publishing # - ################## - job_publish_module: - name: 'Publishing' - if: github.ref == 'refs/heads/main' || github.ref == 'refs/heads/master' || github.event.inputs.prerelease == 'true' - runs-on: ubuntu-20.04 - needs: - - job_module_deploy_validation - steps: - - name: 'Checkout' - uses: actions/checkout@v3 - with: - fetch-depth: 0 - - name: Set environment variables - uses: ./.github/actions/templates/setEnvironmentVariables - with: - variablesPath: ${{ env.variablesPath }} - - name: 'Publishing' - uses: ./.github/actions/templates/publishModule - with: - templateFilePath: '${{ env.modulePath }}/deploy.bicep' - templateSpecsRGName: '${{ env.templateSpecsRGName }}' - templateSpecsRGLocation: '${{ env.templateSpecsRGLocation }}' - templateSpecsDescription: '${{ env.templateSpecsDescription }}' - templateSpecsDoPublish: '${{ env.templateSpecsDoPublish }}' - bicepRegistryName: '${{ env.bicepRegistryName }}' - bicepRegistryRGName: '${{ env.bicepRegistryRGName }}' - bicepRegistryRgLocation: '${{ env.bicepRegistryRgLocation }}' - bicepRegistryDoPublish: '${{ env.bicepRegistryDoPublish }}' - publishLatest: '${{ env.publishLatest }}' + uses: ./.github/workflows/template.module.yml + with: + workflowInput: '${{ needs.job_initialize_pipeline.outputs.workflowInput }}' + moduleTestFilePaths: '${{ needs.job_initialize_pipeline.outputs.moduleTestFilePaths }}' + modulePath: '${{ needs.job_initialize_pipeline.outputs.modulePath}}' + secrets: inherit diff --git a/.github/workflows/ms.authorization.policydefinitions.yml b/.github/workflows/ms.authorization.policydefinitions.yml index 8e127c025b..b5a3ed17e0 100644 --- a/.github/workflows/ms.authorization.policydefinitions.yml +++ b/.github/workflows/ms.authorization.policydefinitions.yml @@ -1,4 +1,4 @@ -name: 'Authorization: PolicyDefinitions' +name: 'Authorization - PolicyDefinitions' on: workflow_dispatch: @@ -28,6 +28,7 @@ on: - main paths: - '.github/actions/templates/**' + - '.github/workflows/template.module.yml' - '.github/workflows/ms.authorization.policydefinitions.yml' - 'modules/Microsoft.Authorization/policyDefinitions/**' - 'utilities/pipelines/**' @@ -35,14 +36,8 @@ on: - '!*/**/readme.md' env: - variablesPath: 'settings.yml' modulePath: 'modules/Microsoft.Authorization/policyDefinitions' workflowPath: '.github/workflows/ms.authorization.policydefinitions.yml' - AZURE_CREDENTIALS: ${{ secrets.AZURE_CREDENTIALS }} - ARM_SUBSCRIPTION_ID: '${{ secrets.ARM_SUBSCRIPTION_ID }}' - ARM_MGMTGROUP_ID: '${{ secrets.ARM_MGMTGROUP_ID }}' - ARM_TENANT_ID: '${{ secrets.ARM_TENANT_ID }}' - TOKEN_NAMEPREFIX: '${{ secrets.TOKEN_NAMEPREFIX }}' concurrency: group: ${{ github.workflow }} @@ -72,97 +67,19 @@ jobs: outputs: workflowInput: ${{ steps.get-workflow-param.outputs.workflowInput }} moduleTestFilePaths: ${{ steps.get-module-test-file-paths.outputs.moduleTestFilePaths }} + modulePath: '${{ env.modulePath }}' - ######################### - # Static validation # - ######################### - job_module_static_validation: - runs-on: ubuntu-20.04 - name: 'Static validation' - if: (fromJson(needs.job_initialize_pipeline.outputs.workflowInput)).staticValidation == 'true' - needs: - - job_initialize_pipeline - steps: - - name: 'Checkout' - uses: actions/checkout@v3 - with: - fetch-depth: 0 - - name: Set environment variables - uses: ./.github/actions/templates/setEnvironmentVariables - with: - variablesPath: ${{ env.variablesPath }} - - name: 'Run tests' - uses: ./.github/actions/templates/validateModulePester - with: - modulePath: '${{ env.modulePath }}' - moduleTestFilePath: '${{ env.moduleTestFilePath }}' - ############################# - # Deployment validation # - ############################# - job_module_deploy_validation: - runs-on: ubuntu-20.04 - name: 'Deploying' - if: | - !cancelled() && - (fromJson(needs.job_initialize_pipeline.outputs.workflowInput)).deploymentValidation == 'true' && - needs.job_module_static_validation.result != 'failure' + ############################## + # Call reusable workflow # + ############################## + call-workflow-passing-data: + name: 'Module' needs: - job_initialize_pipeline - - job_module_static_validation - strategy: - fail-fast: false - matrix: - moduleTestFilePaths: ${{ fromJson(needs.job_initialize_pipeline.outputs.moduleTestFilePaths) }} - steps: - - name: 'Checkout' - uses: actions/checkout@v3 - with: - fetch-depth: 0 - - name: Set environment variables - uses: ./.github/actions/templates/setEnvironmentVariables - with: - variablesPath: ${{ env.variablesPath }} - # ------------------- # - ## Deploy & Remove ## - # ------------------- # - - name: 'Using test file [${{ matrix.moduleTestFilePaths }}]' - uses: ./.github/actions/templates/validateModuleDeployment - with: - templateFilePath: '${{ env.modulePath }}/${{ matrix.moduleTestFilePaths }}' - location: '${{ env.location }}' - subscriptionId: '${{ secrets.ARM_SUBSCRIPTION_ID }}' - managementGroupId: '${{ secrets.ARM_MGMTGROUP_ID }}' - removeDeployment: '${{ (fromJson(needs.job_initialize_pipeline.outputs.workflowInput)).removeDeployment }}' - - ################## - # Publishing # - ################## - job_publish_module: - name: 'Publishing' - if: github.ref == 'refs/heads/main' || github.ref == 'refs/heads/master' || github.event.inputs.prerelease == 'true' - runs-on: ubuntu-20.04 - needs: - - job_module_deploy_validation - steps: - - name: 'Checkout' - uses: actions/checkout@v3 - with: - fetch-depth: 0 - - name: Set environment variables - uses: ./.github/actions/templates/setEnvironmentVariables - with: - variablesPath: ${{ env.variablesPath }} - - name: 'Publishing' - uses: ./.github/actions/templates/publishModule - with: - templateFilePath: '${{ env.modulePath }}/deploy.bicep' - templateSpecsRGName: '${{ env.templateSpecsRGName }}' - templateSpecsRGLocation: '${{ env.templateSpecsRGLocation }}' - templateSpecsDescription: '${{ env.templateSpecsDescription }}' - templateSpecsDoPublish: '${{ env.templateSpecsDoPublish }}' - bicepRegistryName: '${{ env.bicepRegistryName }}' - bicepRegistryRGName: '${{ env.bicepRegistryRGName }}' - bicepRegistryRgLocation: '${{ env.bicepRegistryRgLocation }}' - bicepRegistryDoPublish: '${{ env.bicepRegistryDoPublish }}' - publishLatest: '${{ env.publishLatest }}' + uses: ./.github/workflows/template.module.yml + with: + workflowInput: '${{ needs.job_initialize_pipeline.outputs.workflowInput }}' + moduleTestFilePaths: '${{ needs.job_initialize_pipeline.outputs.moduleTestFilePaths }}' + modulePath: '${{ needs.job_initialize_pipeline.outputs.modulePath}}' + secrets: inherit diff --git a/.github/workflows/ms.authorization.policyexemptions.yml b/.github/workflows/ms.authorization.policyexemptions.yml index 6385cf7a54..48734003c2 100644 --- a/.github/workflows/ms.authorization.policyexemptions.yml +++ b/.github/workflows/ms.authorization.policyexemptions.yml @@ -1,4 +1,4 @@ -name: 'Authorization: PolicyExemptions' +name: 'Authorization - PolicyExemptions' on: workflow_dispatch: @@ -28,6 +28,7 @@ on: - main paths: - '.github/actions/templates/**' + - '.github/workflows/template.module.yml' - '.github/workflows/ms.authorization.policyexemptions.yml' - 'modules/Microsoft.Authorization/policyExemptions/**' - 'utilities/pipelines/**' @@ -35,14 +36,8 @@ on: - '!*/**/readme.md' env: - variablesPath: 'settings.yml' modulePath: 'modules/Microsoft.Authorization/policyExemptions' workflowPath: '.github/workflows/ms.authorization.policyexemptions.yml' - AZURE_CREDENTIALS: ${{ secrets.AZURE_CREDENTIALS }} - ARM_SUBSCRIPTION_ID: '${{ secrets.ARM_SUBSCRIPTION_ID }}' - ARM_MGMTGROUP_ID: '${{ secrets.ARM_MGMTGROUP_ID }}' - ARM_TENANT_ID: '${{ secrets.ARM_TENANT_ID }}' - TOKEN_NAMEPREFIX: '${{ secrets.TOKEN_NAMEPREFIX }}' concurrency: group: ${{ github.workflow }} @@ -72,97 +67,19 @@ jobs: outputs: workflowInput: ${{ steps.get-workflow-param.outputs.workflowInput }} moduleTestFilePaths: ${{ steps.get-module-test-file-paths.outputs.moduleTestFilePaths }} + modulePath: '${{ env.modulePath }}' - ######################### - # Static validation # - ######################### - job_module_static_validation: - runs-on: ubuntu-20.04 - name: 'Static validation' - if: (fromJson(needs.job_initialize_pipeline.outputs.workflowInput)).staticValidation == 'true' - needs: - - job_initialize_pipeline - steps: - - name: 'Checkout' - uses: actions/checkout@v3 - with: - fetch-depth: 0 - - name: Set environment variables - uses: ./.github/actions/templates/setEnvironmentVariables - with: - variablesPath: ${{ env.variablesPath }} - - name: 'Run tests' - uses: ./.github/actions/templates/validateModulePester - with: - modulePath: '${{ env.modulePath }}' - moduleTestFilePath: '${{ env.moduleTestFilePath }}' - ############################# - # Deployment validation # - ############################# - job_module_deploy_validation: - runs-on: ubuntu-20.04 - name: 'Deploying' - if: | - !cancelled() && - (fromJson(needs.job_initialize_pipeline.outputs.workflowInput)).deploymentValidation == 'true' && - needs.job_module_static_validation.result != 'failure' + ############################## + # Call reusable workflow # + ############################## + call-workflow-passing-data: + name: 'Module' needs: - job_initialize_pipeline - - job_module_static_validation - strategy: - fail-fast: false - matrix: - moduleTestFilePaths: ${{ fromJson(needs.job_initialize_pipeline.outputs.moduleTestFilePaths) }} - steps: - - name: 'Checkout' - uses: actions/checkout@v3 - with: - fetch-depth: 0 - - name: Set environment variables - uses: ./.github/actions/templates/setEnvironmentVariables - with: - variablesPath: ${{ env.variablesPath }} - # ------------------- # - ## Deploy & Remove ## - # ------------------- # - - name: 'Using test file [${{ matrix.moduleTestFilePaths }}]' - uses: ./.github/actions/templates/validateModuleDeployment - with: - templateFilePath: '${{ env.modulePath }}/${{ matrix.moduleTestFilePaths }}' - location: '${{ env.location }}' - subscriptionId: '${{ secrets.ARM_SUBSCRIPTION_ID }}' - managementGroupId: '${{ secrets.ARM_MGMTGROUP_ID }}' - removeDeployment: '${{ (fromJson(needs.job_initialize_pipeline.outputs.workflowInput)).removeDeployment }}' - - ################## - # Publishing # - ################## - job_publish_module: - name: 'Publishing' - if: github.ref == 'refs/heads/main' || github.ref == 'refs/heads/master' || github.event.inputs.prerelease == 'true' - runs-on: ubuntu-20.04 - needs: - - job_module_deploy_validation - steps: - - name: 'Checkout' - uses: actions/checkout@v3 - with: - fetch-depth: 0 - - name: Set environment variables - uses: ./.github/actions/templates/setEnvironmentVariables - with: - variablesPath: ${{ env.variablesPath }} - - name: 'Publishing' - uses: ./.github/actions/templates/publishModule - with: - templateFilePath: '${{ env.modulePath }}/deploy.bicep' - templateSpecsRGName: '${{ env.templateSpecsRGName }}' - templateSpecsRGLocation: '${{ env.templateSpecsRGLocation }}' - templateSpecsDescription: '${{ env.templateSpecsDescription }}' - templateSpecsDoPublish: '${{ env.templateSpecsDoPublish }}' - bicepRegistryName: '${{ env.bicepRegistryName }}' - bicepRegistryRGName: '${{ env.bicepRegistryRGName }}' - bicepRegistryRgLocation: '${{ env.bicepRegistryRgLocation }}' - bicepRegistryDoPublish: '${{ env.bicepRegistryDoPublish }}' - publishLatest: '${{ env.publishLatest }}' + uses: ./.github/workflows/template.module.yml + with: + workflowInput: '${{ needs.job_initialize_pipeline.outputs.workflowInput }}' + moduleTestFilePaths: '${{ needs.job_initialize_pipeline.outputs.moduleTestFilePaths }}' + modulePath: '${{ needs.job_initialize_pipeline.outputs.modulePath}}' + secrets: inherit diff --git a/.github/workflows/ms.authorization.policysetdefinitions.yml b/.github/workflows/ms.authorization.policysetdefinitions.yml index cf7853fc4d..6e0eb12b2f 100644 --- a/.github/workflows/ms.authorization.policysetdefinitions.yml +++ b/.github/workflows/ms.authorization.policysetdefinitions.yml @@ -1,4 +1,4 @@ -name: 'Authorization: PolicySetDefinitions' +name: 'Authorization - PolicySetDefinitions' on: workflow_dispatch: @@ -28,6 +28,7 @@ on: - main paths: - '.github/actions/templates/**' + - '.github/workflows/template.module.yml' - '.github/workflows/ms.authorization.policysetdefinitions.yml' - 'modules/Microsoft.Authorization/policySetDefinitions/**' - 'utilities/pipelines/**' @@ -35,14 +36,8 @@ on: - '!*/**/readme.md' env: - variablesPath: 'settings.yml' modulePath: 'modules/Microsoft.Authorization/policySetDefinitions' workflowPath: '.github/workflows/ms.authorization.policysetdefinitions.yml' - AZURE_CREDENTIALS: ${{ secrets.AZURE_CREDENTIALS }} - ARM_SUBSCRIPTION_ID: '${{ secrets.ARM_SUBSCRIPTION_ID }}' - ARM_MGMTGROUP_ID: '${{ secrets.ARM_MGMTGROUP_ID }}' - ARM_TENANT_ID: '${{ secrets.ARM_TENANT_ID }}' - TOKEN_NAMEPREFIX: '${{ secrets.TOKEN_NAMEPREFIX }}' concurrency: group: ${{ github.workflow }} @@ -72,97 +67,19 @@ jobs: outputs: workflowInput: ${{ steps.get-workflow-param.outputs.workflowInput }} moduleTestFilePaths: ${{ steps.get-module-test-file-paths.outputs.moduleTestFilePaths }} + modulePath: '${{ env.modulePath }}' - ######################### - # Static validation # - ######################### - job_module_static_validation: - runs-on: ubuntu-20.04 - name: 'Static validation' - if: (fromJson(needs.job_initialize_pipeline.outputs.workflowInput)).staticValidation == 'true' - needs: - - job_initialize_pipeline - steps: - - name: 'Checkout' - uses: actions/checkout@v3 - with: - fetch-depth: 0 - - name: Set environment variables - uses: ./.github/actions/templates/setEnvironmentVariables - with: - variablesPath: ${{ env.variablesPath }} - - name: 'Run tests' - uses: ./.github/actions/templates/validateModulePester - with: - modulePath: '${{ env.modulePath }}' - moduleTestFilePath: '${{ env.moduleTestFilePath }}' - ############################# - # Deployment validation # - ############################# - job_module_deploy_validation: - runs-on: ubuntu-20.04 - name: 'Deploying' - if: | - !cancelled() && - (fromJson(needs.job_initialize_pipeline.outputs.workflowInput)).deploymentValidation == 'true' && - needs.job_module_static_validation.result != 'failure' + ############################## + # Call reusable workflow # + ############################## + call-workflow-passing-data: + name: 'Module' needs: - job_initialize_pipeline - - job_module_static_validation - strategy: - fail-fast: false - matrix: - moduleTestFilePaths: ${{ fromJson(needs.job_initialize_pipeline.outputs.moduleTestFilePaths) }} - steps: - - name: 'Checkout' - uses: actions/checkout@v3 - with: - fetch-depth: 0 - - name: Set environment variables - uses: ./.github/actions/templates/setEnvironmentVariables - with: - variablesPath: ${{ env.variablesPath }} - # ------------------- # - ## Deploy & Remove ## - # ------------------- # - - name: 'Using test file [${{ matrix.moduleTestFilePaths }}]' - uses: ./.github/actions/templates/validateModuleDeployment - with: - templateFilePath: '${{ env.modulePath }}/${{ matrix.moduleTestFilePaths }}' - location: '${{ env.location }}' - subscriptionId: '${{ secrets.ARM_SUBSCRIPTION_ID }}' - managementGroupId: '${{ secrets.ARM_MGMTGROUP_ID }}' - removeDeployment: '${{ (fromJson(needs.job_initialize_pipeline.outputs.workflowInput)).removeDeployment }}' - - ################## - # Publishing # - ################## - job_publish_module: - name: 'Publishing' - if: github.ref == 'refs/heads/main' || github.ref == 'refs/heads/master' || github.event.inputs.prerelease == 'true' - runs-on: ubuntu-20.04 - needs: - - job_module_deploy_validation - steps: - - name: 'Checkout' - uses: actions/checkout@v3 - with: - fetch-depth: 0 - - name: Set environment variables - uses: ./.github/actions/templates/setEnvironmentVariables - with: - variablesPath: ${{ env.variablesPath }} - - name: 'Publishing' - uses: ./.github/actions/templates/publishModule - with: - templateFilePath: '${{ env.modulePath }}/deploy.bicep' - templateSpecsRGName: '${{ env.templateSpecsRGName }}' - templateSpecsRGLocation: '${{ env.templateSpecsRGLocation }}' - templateSpecsDescription: '${{ env.templateSpecsDescription }}' - templateSpecsDoPublish: '${{ env.templateSpecsDoPublish }}' - bicepRegistryName: '${{ env.bicepRegistryName }}' - bicepRegistryRGName: '${{ env.bicepRegistryRGName }}' - bicepRegistryRgLocation: '${{ env.bicepRegistryRgLocation }}' - bicepRegistryDoPublish: '${{ env.bicepRegistryDoPublish }}' - publishLatest: '${{ env.publishLatest }}' + uses: ./.github/workflows/template.module.yml + with: + workflowInput: '${{ needs.job_initialize_pipeline.outputs.workflowInput }}' + moduleTestFilePaths: '${{ needs.job_initialize_pipeline.outputs.moduleTestFilePaths }}' + modulePath: '${{ needs.job_initialize_pipeline.outputs.modulePath}}' + secrets: inherit diff --git a/.github/workflows/ms.authorization.roleassignments.yml b/.github/workflows/ms.authorization.roleassignments.yml index 5f3a35688c..64bbe3ce0e 100644 --- a/.github/workflows/ms.authorization.roleassignments.yml +++ b/.github/workflows/ms.authorization.roleassignments.yml @@ -1,4 +1,4 @@ -name: 'Authorization: RoleAssignments' +name: 'Authorization - RoleAssignments' on: workflow_dispatch: @@ -28,6 +28,7 @@ on: - main paths: - '.github/actions/templates/**' + - '.github/workflows/template.module.yml' - '.github/workflows/ms.authorization.roleassignments.yml' - 'modules/Microsoft.Authorization/roleAssignments/**' - 'utilities/pipelines/**' @@ -35,14 +36,8 @@ on: - '!*/**/readme.md' env: - variablesPath: 'settings.yml' modulePath: 'modules/Microsoft.Authorization/roleAssignments' workflowPath: '.github/workflows/ms.authorization.roleassignments.yml' - AZURE_CREDENTIALS: ${{ secrets.AZURE_CREDENTIALS }} - ARM_SUBSCRIPTION_ID: '${{ secrets.ARM_SUBSCRIPTION_ID }}' - ARM_MGMTGROUP_ID: '${{ secrets.ARM_MGMTGROUP_ID }}' - ARM_TENANT_ID: '${{ secrets.ARM_TENANT_ID }}' - TOKEN_NAMEPREFIX: '${{ secrets.TOKEN_NAMEPREFIX }}' concurrency: group: ${{ github.workflow }} @@ -72,97 +67,19 @@ jobs: outputs: workflowInput: ${{ steps.get-workflow-param.outputs.workflowInput }} moduleTestFilePaths: ${{ steps.get-module-test-file-paths.outputs.moduleTestFilePaths }} + modulePath: '${{ env.modulePath }}' - ######################### - # Static validation # - ######################### - job_module_static_validation: - runs-on: ubuntu-20.04 - name: 'Static validation' - if: (fromJson(needs.job_initialize_pipeline.outputs.workflowInput)).staticValidation == 'true' - needs: - - job_initialize_pipeline - steps: - - name: 'Checkout' - uses: actions/checkout@v3 - with: - fetch-depth: 0 - - name: Set environment variables - uses: ./.github/actions/templates/setEnvironmentVariables - with: - variablesPath: ${{ env.variablesPath }} - - name: 'Run tests' - uses: ./.github/actions/templates/validateModulePester - with: - modulePath: '${{ env.modulePath }}' - moduleTestFilePath: '${{ env.moduleTestFilePath }}' - ############################# - # Deployment validation # - ############################# - job_module_deploy_validation: - runs-on: ubuntu-20.04 - name: 'Deploying' - if: | - !cancelled() && - (fromJson(needs.job_initialize_pipeline.outputs.workflowInput)).deploymentValidation == 'true' && - needs.job_module_static_validation.result != 'failure' + ############################## + # Call reusable workflow # + ############################## + call-workflow-passing-data: + name: 'Module' needs: - job_initialize_pipeline - - job_module_static_validation - strategy: - fail-fast: false - matrix: - moduleTestFilePaths: ${{ fromJson(needs.job_initialize_pipeline.outputs.moduleTestFilePaths) }} - steps: - - name: 'Checkout' - uses: actions/checkout@v3 - with: - fetch-depth: 0 - - name: Set environment variables - uses: ./.github/actions/templates/setEnvironmentVariables - with: - variablesPath: ${{ env.variablesPath }} - # ------------------- # - ## Deploy & Remove ## - # ------------------- # - - name: 'Using test file [${{ matrix.moduleTestFilePaths }}]' - uses: ./.github/actions/templates/validateModuleDeployment - with: - templateFilePath: '${{ env.modulePath }}/${{ matrix.moduleTestFilePaths }}' - location: '${{ env.location }}' - subscriptionId: '${{ secrets.ARM_SUBSCRIPTION_ID }}' - managementGroupId: '${{ secrets.ARM_MGMTGROUP_ID }}' - removeDeployment: '${{ (fromJson(needs.job_initialize_pipeline.outputs.workflowInput)).removeDeployment }}' - - ################## - # Publishing # - ################## - job_publish_module: - name: 'Publishing' - if: github.ref == 'refs/heads/main' || github.ref == 'refs/heads/master' || github.event.inputs.prerelease == 'true' - runs-on: ubuntu-20.04 - needs: - - job_module_deploy_validation - steps: - - name: 'Checkout' - uses: actions/checkout@v3 - with: - fetch-depth: 0 - - name: Set environment variables - uses: ./.github/actions/templates/setEnvironmentVariables - with: - variablesPath: ${{ env.variablesPath }} - - name: 'Publishing' - uses: ./.github/actions/templates/publishModule - with: - templateFilePath: '${{ env.modulePath }}/deploy.bicep' - templateSpecsRGName: '${{ env.templateSpecsRGName }}' - templateSpecsRGLocation: '${{ env.templateSpecsRGLocation }}' - templateSpecsDescription: '${{ env.templateSpecsDescription }}' - templateSpecsDoPublish: '${{ env.templateSpecsDoPublish }}' - bicepRegistryName: '${{ env.bicepRegistryName }}' - bicepRegistryRGName: '${{ env.bicepRegistryRGName }}' - bicepRegistryRgLocation: '${{ env.bicepRegistryRgLocation }}' - bicepRegistryDoPublish: '${{ env.bicepRegistryDoPublish }}' - publishLatest: '${{ env.publishLatest }}' + uses: ./.github/workflows/template.module.yml + with: + workflowInput: '${{ needs.job_initialize_pipeline.outputs.workflowInput }}' + moduleTestFilePaths: '${{ needs.job_initialize_pipeline.outputs.moduleTestFilePaths }}' + modulePath: '${{ needs.job_initialize_pipeline.outputs.modulePath}}' + secrets: inherit diff --git a/.github/workflows/ms.authorization.roledefinitions.yml b/.github/workflows/ms.authorization.roledefinitions.yml index 02402cd434..4b0600d5de 100644 --- a/.github/workflows/ms.authorization.roledefinitions.yml +++ b/.github/workflows/ms.authorization.roledefinitions.yml @@ -1,4 +1,4 @@ -name: 'Authorization: RoleDefinitions' +name: 'Authorization - RoleDefinitions' on: workflow_dispatch: @@ -28,6 +28,7 @@ on: - main paths: - '.github/actions/templates/**' + - '.github/workflows/template.module.yml' - '.github/workflows/ms.authorization.roledefinitions.yml' - 'modules/Microsoft.Authorization/roleDefinitions/**' - 'utilities/pipelines/**' @@ -35,14 +36,8 @@ on: - '!*/**/readme.md' env: - variablesPath: 'settings.yml' modulePath: 'modules/Microsoft.Authorization/roleDefinitions' workflowPath: '.github/workflows/ms.authorization.roledefinitions.yml' - AZURE_CREDENTIALS: ${{ secrets.AZURE_CREDENTIALS }} - ARM_SUBSCRIPTION_ID: '${{ secrets.ARM_SUBSCRIPTION_ID }}' - ARM_MGMTGROUP_ID: '${{ secrets.ARM_MGMTGROUP_ID }}' - ARM_TENANT_ID: '${{ secrets.ARM_TENANT_ID }}' - TOKEN_NAMEPREFIX: '${{ secrets.TOKEN_NAMEPREFIX }}' concurrency: group: ${{ github.workflow }} @@ -72,97 +67,19 @@ jobs: outputs: workflowInput: ${{ steps.get-workflow-param.outputs.workflowInput }} moduleTestFilePaths: ${{ steps.get-module-test-file-paths.outputs.moduleTestFilePaths }} + modulePath: '${{ env.modulePath }}' - ######################### - # Static validation # - ######################### - job_module_static_validation: - runs-on: ubuntu-20.04 - name: 'Static validation' - if: (fromJson(needs.job_initialize_pipeline.outputs.workflowInput)).staticValidation == 'true' - needs: - - job_initialize_pipeline - steps: - - name: 'Checkout' - uses: actions/checkout@v3 - with: - fetch-depth: 0 - - name: Set environment variables - uses: ./.github/actions/templates/setEnvironmentVariables - with: - variablesPath: ${{ env.variablesPath }} - - name: 'Run tests' - uses: ./.github/actions/templates/validateModulePester - with: - modulePath: '${{ env.modulePath }}' - moduleTestFilePath: '${{ env.moduleTestFilePath }}' - ############################# - # Deployment validation # - ############################# - job_module_deploy_validation: - runs-on: ubuntu-20.04 - name: 'Deploying' - if: | - !cancelled() && - (fromJson(needs.job_initialize_pipeline.outputs.workflowInput)).deploymentValidation == 'true' && - needs.job_module_static_validation.result != 'failure' + ############################## + # Call reusable workflow # + ############################## + call-workflow-passing-data: + name: 'Module' needs: - job_initialize_pipeline - - job_module_static_validation - strategy: - fail-fast: false - matrix: - moduleTestFilePaths: ${{ fromJson(needs.job_initialize_pipeline.outputs.moduleTestFilePaths) }} - steps: - - name: 'Checkout' - uses: actions/checkout@v3 - with: - fetch-depth: 0 - - name: Set environment variables - uses: ./.github/actions/templates/setEnvironmentVariables - with: - variablesPath: ${{ env.variablesPath }} - # ------------------- # - ## Deploy & Remove ## - # ------------------- # - - name: 'Using test file [${{ matrix.moduleTestFilePaths }}]' - uses: ./.github/actions/templates/validateModuleDeployment - with: - templateFilePath: '${{ env.modulePath }}/${{ matrix.moduleTestFilePaths }}' - location: '${{ env.location }}' - subscriptionId: '${{ secrets.ARM_SUBSCRIPTION_ID }}' - managementGroupId: '${{ secrets.ARM_MGMTGROUP_ID }}' - removeDeployment: '${{ (fromJson(needs.job_initialize_pipeline.outputs.workflowInput)).removeDeployment }}' - - ################## - # Publishing # - ################## - job_publish_module: - name: 'Publishing' - if: github.ref == 'refs/heads/main' || github.ref == 'refs/heads/master' || github.event.inputs.prerelease == 'true' - runs-on: ubuntu-20.04 - needs: - - job_module_deploy_validation - steps: - - name: 'Checkout' - uses: actions/checkout@v3 - with: - fetch-depth: 0 - - name: Set environment variables - uses: ./.github/actions/templates/setEnvironmentVariables - with: - variablesPath: ${{ env.variablesPath }} - - name: 'Publishing' - uses: ./.github/actions/templates/publishModule - with: - templateFilePath: '${{ env.modulePath }}/deploy.bicep' - templateSpecsRGName: '${{ env.templateSpecsRGName }}' - templateSpecsRGLocation: '${{ env.templateSpecsRGLocation }}' - templateSpecsDescription: '${{ env.templateSpecsDescription }}' - templateSpecsDoPublish: '${{ env.templateSpecsDoPublish }}' - bicepRegistryName: '${{ env.bicepRegistryName }}' - bicepRegistryRGName: '${{ env.bicepRegistryRGName }}' - bicepRegistryRgLocation: '${{ env.bicepRegistryRgLocation }}' - bicepRegistryDoPublish: '${{ env.bicepRegistryDoPublish }}' - publishLatest: '${{ env.publishLatest }}' + uses: ./.github/workflows/template.module.yml + with: + workflowInput: '${{ needs.job_initialize_pipeline.outputs.workflowInput }}' + moduleTestFilePaths: '${{ needs.job_initialize_pipeline.outputs.moduleTestFilePaths }}' + modulePath: '${{ needs.job_initialize_pipeline.outputs.modulePath}}' + secrets: inherit diff --git a/.github/workflows/ms.automation.automationaccounts.yml b/.github/workflows/ms.automation.automationaccounts.yml index 03b14a387b..e94aae8da0 100644 --- a/.github/workflows/ms.automation.automationaccounts.yml +++ b/.github/workflows/ms.automation.automationaccounts.yml @@ -1,8 +1,18 @@ -name: 'Automation: AutomationAccounts' +name: 'Automation - AutomationAccounts' on: workflow_dispatch: inputs: + staticValidation: + type: boolean + description: 'Execute static validation' + required: false + default: true + deploymentValidation: + type: boolean + description: 'Execute deployment validation' + required: false + default: true removeDeployment: type: boolean description: 'Remove deployed module' @@ -19,6 +29,7 @@ on: - main paths: - '.github/actions/templates/**' + - '.github/workflows/template.module.yml' - '.github/workflows/ms.automation.automationaccounts.yml' - 'modules/Microsoft.Automation/automationAccounts/**' - 'utilities/pipelines/**' @@ -26,14 +37,8 @@ on: - '!*/**/readme.md' env: - variablesPath: 'settings.yml' modulePath: 'modules/Microsoft.Automation/automationAccounts' workflowPath: '.github/workflows/ms.automation.automationaccounts.yml' - AZURE_CREDENTIALS: ${{ secrets.AZURE_CREDENTIALS }} - ARM_SUBSCRIPTION_ID: ${{ secrets.ARM_SUBSCRIPTION_ID }} - ARM_MGMTGROUP_ID: ${{ secrets.ARM_MGMTGROUP_ID }} - ARM_TENANT_ID: '${{ secrets.ARM_TENANT_ID }}' - TOKEN_NAMEPREFIX: '${{ secrets.TOKEN_NAMEPREFIX }}' concurrency: group: ${{ github.workflow }} @@ -63,94 +68,19 @@ jobs: outputs: workflowInput: ${{ steps.get-workflow-param.outputs.workflowInput }} moduleTestFilePaths: ${{ steps.get-module-test-file-paths.outputs.moduleTestFilePaths }} + modulePath: '${{ env.modulePath }}' - ######################### - # Static validation # - ######################### - job_module_static_validation: - runs-on: ubuntu-20.04 - name: 'Static validation' - if: (fromJson(needs.job_initialize_pipeline.outputs.workflowInput)).staticValidation == 'true' - needs: - - job_initialize_pipeline - steps: - - name: 'Checkout' - uses: actions/checkout@v3 - with: - fetch-depth: 0 - - name: Set environment variables - uses: ./.github/actions/templates/setEnvironmentVariables - with: - variablesPath: ${{ env.variablesPath }} - - name: 'Run tests' - uses: ./.github/actions/templates/validateModulePester - with: - modulePath: '${{ env.modulePath }}' - moduleTestFilePath: '${{ env.moduleTestFilePath }}' - ############################# - # Deployment validation # - ############################# - job_module_deploy_validation: - runs-on: ubuntu-20.04 - name: 'Deploying' - if: | - !cancelled() && - (fromJson(needs.job_initialize_pipeline.outputs.workflowInput)).deploymentValidation == 'true' && - needs.job_module_static_validation.result != 'failure' + ############################## + # Call reusable workflow # + ############################## + call-workflow-passing-data: + name: 'Module' needs: - job_initialize_pipeline - - job_module_static_validation - strategy: - fail-fast: false - matrix: - moduleTestFilePaths: ${{ fromJson(needs.job_initialize_pipeline.outputs.moduleTestFilePaths) }} - steps: - - name: 'Checkout' - uses: actions/checkout@v3 - with: - fetch-depth: 0 - - name: Set environment variables - uses: ./.github/actions/templates/setEnvironmentVariables - with: - variablesPath: ${{ env.variablesPath }} - - name: 'Using test file [${{ matrix.moduleTestFilePaths }}]' - uses: ./.github/actions/templates/validateModuleDeployment - with: - templateFilePath: '${{ env.modulePath }}/${{ matrix.moduleTestFilePaths }}' - location: '${{ env.location }}' - subscriptionId: '${{ secrets.ARM_SUBSCRIPTION_ID }}' - managementGroupId: '${{ secrets.ARM_MGMTGROUP_ID }}' - removeDeployment: '${{ (fromJson(needs.job_initialize_pipeline.outputs.workflowInput)).removeDeployment }}' - - ################## - # Publishing # - ################## - job_publish_module: - name: 'Publishing' - if: github.ref == 'refs/heads/main' || github.ref == 'refs/heads/master' || github.event.inputs.prerelease == 'true' - runs-on: ubuntu-20.04 - needs: - - job_module_deploy_validation - steps: - - name: 'Checkout' - uses: actions/checkout@v3 - with: - fetch-depth: 0 - - name: Set environment variables - uses: ./.github/actions/templates/setEnvironmentVariables - with: - variablesPath: ${{ env.variablesPath }} - - name: 'Publishing' - uses: ./.github/actions/templates/publishModule - with: - templateFilePath: '${{ env.modulePath }}/deploy.bicep' - templateSpecsRGName: '${{ env.templateSpecsRGName }}' - templateSpecsRGLocation: '${{ env.templateSpecsRGLocation }}' - templateSpecsDescription: '${{ env.templateSpecsDescription }}' - templateSpecsDoPublish: '${{ env.templateSpecsDoPublish }}' - bicepRegistryName: '${{ env.bicepRegistryName }}' - bicepRegistryRGName: '${{ env.bicepRegistryRGName }}' - bicepRegistryRgLocation: '${{ env.bicepRegistryRgLocation }}' - bicepRegistryDoPublish: '${{ env.bicepRegistryDoPublish }}' - publishLatest: '${{ env.publishLatest }}' + uses: ./.github/workflows/template.module.yml + with: + workflowInput: '${{ needs.job_initialize_pipeline.outputs.workflowInput }}' + moduleTestFilePaths: '${{ needs.job_initialize_pipeline.outputs.moduleTestFilePaths }}' + modulePath: '${{ needs.job_initialize_pipeline.outputs.modulePath}}' + secrets: inherit diff --git a/.github/workflows/ms.batch.batchaccounts.yml b/.github/workflows/ms.batch.batchaccounts.yml index 904902b6fd..374fd920b5 100644 --- a/.github/workflows/ms.batch.batchaccounts.yml +++ b/.github/workflows/ms.batch.batchaccounts.yml @@ -1,4 +1,4 @@ -name: 'Batch: BatchAccounts' +name: 'Batch - BatchAccounts' on: workflow_dispatch: @@ -28,6 +28,7 @@ on: - main paths: - '.github/actions/templates/**' + - '.github/workflows/template.module.yml' - '.github/workflows/ms.batch.batchaccounts.yml' - 'modules/Microsoft.Batch/batchAccounts/**' - 'utilities/pipelines/**' @@ -35,14 +36,8 @@ on: - '!*/**/readme.md' env: - variablesPath: 'settings.yml' modulePath: 'modules/Microsoft.Batch/batchAccounts' workflowPath: '.github/workflows/ms.batch.batchaccounts.yml' - AZURE_CREDENTIALS: ${{ secrets.AZURE_CREDENTIALS }} - ARM_SUBSCRIPTION_ID: '${{ secrets.ARM_SUBSCRIPTION_ID }}' - ARM_MGMTGROUP_ID: '${{ secrets.ARM_MGMTGROUP_ID }}' - ARM_TENANT_ID: '${{ secrets.ARM_TENANT_ID }}' - TOKEN_NAMEPREFIX: '${{ secrets.TOKEN_NAMEPREFIX }}' concurrency: group: ${{ github.workflow }} @@ -72,94 +67,19 @@ jobs: outputs: workflowInput: ${{ steps.get-workflow-param.outputs.workflowInput }} moduleTestFilePaths: ${{ steps.get-module-test-file-paths.outputs.moduleTestFilePaths }} + modulePath: '${{ env.modulePath }}' - ######################### - # Static validation # - ######################### - job_module_static_validation: - runs-on: ubuntu-20.04 - name: 'Static validation' - if: (fromJson(needs.job_initialize_pipeline.outputs.workflowInput)).staticValidation == 'true' - needs: - - job_initialize_pipeline - steps: - - name: 'Checkout' - uses: actions/checkout@v3 - with: - fetch-depth: 0 - - name: Set environment variables - uses: ./.github/actions/templates/setEnvironmentVariables - with: - variablesPath: ${{ env.variablesPath }} - - name: 'Run tests' - uses: ./.github/actions/templates/validateModulePester - with: - modulePath: '${{ env.modulePath }}' - moduleTestFilePath: '${{ env.moduleTestFilePath }}' - ############################# - # Deployment validation # - ############################# - job_module_deploy_validation: - runs-on: ubuntu-20.04 - name: 'Deploying' - if: | - !cancelled() && - (fromJson(needs.job_initialize_pipeline.outputs.workflowInput)).deploymentValidation == 'true' && - needs.job_module_static_validation.result != 'failure' + ############################## + # Call reusable workflow # + ############################## + call-workflow-passing-data: + name: 'Module' needs: - job_initialize_pipeline - - job_module_static_validation - strategy: - fail-fast: false - matrix: - moduleTestFilePaths: ${{ fromJson(needs.job_initialize_pipeline.outputs.moduleTestFilePaths) }} - steps: - - name: 'Checkout' - uses: actions/checkout@v3 - with: - fetch-depth: 0 - - name: Set environment variables - uses: ./.github/actions/templates/setEnvironmentVariables - with: - variablesPath: ${{ env.variablesPath }} - - name: 'Using test file [${{ matrix.moduleTestFilePaths }}]' - uses: ./.github/actions/templates/validateModuleDeployment - with: - templateFilePath: '${{ env.modulePath }}/${{ matrix.moduleTestFilePaths }}' - location: '${{ env.location }}' - subscriptionId: '${{ secrets.ARM_SUBSCRIPTION_ID }}' - managementGroupId: '${{ secrets.ARM_MGMTGROUP_ID }}' - removeDeployment: '${{ (fromJson(needs.job_initialize_pipeline.outputs.workflowInput)).removeDeployment }}' - - ################## - # Publishing # - ################## - job_publish_module: - name: 'Publishing' - if: github.ref == 'refs/heads/main' || github.ref == 'refs/heads/master' || github.event.inputs.prerelease == 'true' - runs-on: ubuntu-20.04 - needs: - - job_module_deploy_validation - steps: - - name: 'Checkout' - uses: actions/checkout@v3 - with: - fetch-depth: 0 - - name: Set environment variables - uses: ./.github/actions/templates/setEnvironmentVariables - with: - variablesPath: ${{ env.variablesPath }} - - name: 'Publishing' - uses: ./.github/actions/templates/publishModule - with: - templateFilePath: '${{ env.modulePath }}/deploy.bicep' - templateSpecsRGName: '${{ env.templateSpecsRGName }}' - templateSpecsRGLocation: '${{ env.templateSpecsRGLocation }}' - templateSpecsDescription: '${{ env.templateSpecsDescription }}' - templateSpecsDoPublish: '${{ env.templateSpecsDoPublish }}' - bicepRegistryName: '${{ env.bicepRegistryName }}' - bicepRegistryRGName: '${{ env.bicepRegistryRGName }}' - bicepRegistryRgLocation: '${{ env.bicepRegistryRgLocation }}' - bicepRegistryDoPublish: '${{ env.bicepRegistryDoPublish }}' - publishLatest: '${{ env.publishLatest }}' + uses: ./.github/workflows/template.module.yml + with: + workflowInput: '${{ needs.job_initialize_pipeline.outputs.workflowInput }}' + moduleTestFilePaths: '${{ needs.job_initialize_pipeline.outputs.moduleTestFilePaths }}' + modulePath: '${{ needs.job_initialize_pipeline.outputs.modulePath}}' + secrets: inherit diff --git a/.github/workflows/ms.cache.redis.yml b/.github/workflows/ms.cache.redis.yml index 57eeea179d..fc1b5c6c53 100644 --- a/.github/workflows/ms.cache.redis.yml +++ b/.github/workflows/ms.cache.redis.yml @@ -1,4 +1,4 @@ -name: 'Cache: Redis' +name: 'Cache - Redis' on: workflow_dispatch: @@ -28,6 +28,7 @@ on: - main paths: - '.github/actions/templates/**' + - '.github/workflows/template.module.yml' - '.github/workflows/ms.cache.redis.yml' - 'modules/Microsoft.Cache/redis/**' - 'utilities/pipelines/**' @@ -35,14 +36,8 @@ on: - '!*/**/readme.md' env: - variablesPath: 'settings.yml' modulePath: 'modules/Microsoft.Cache/redis' workflowPath: '.github/workflows/ms.cache.redis.yml' - AZURE_CREDENTIALS: ${{ secrets.AZURE_CREDENTIALS }} - ARM_SUBSCRIPTION_ID: '${{ secrets.ARM_SUBSCRIPTION_ID }}' - ARM_MGMTGROUP_ID: '${{ secrets.ARM_MGMTGROUP_ID }}' - ARM_TENANT_ID: '${{ secrets.ARM_TENANT_ID }}' - TOKEN_NAMEPREFIX: '${{ secrets.TOKEN_NAMEPREFIX }}' concurrency: group: ${{ github.workflow }} @@ -72,94 +67,19 @@ jobs: outputs: workflowInput: ${{ steps.get-workflow-param.outputs.workflowInput }} moduleTestFilePaths: ${{ steps.get-module-test-file-paths.outputs.moduleTestFilePaths }} + modulePath: '${{ env.modulePath }}' - ######################### - # Static validation # - ######################### - job_module_static_validation: - runs-on: ubuntu-20.04 - name: 'Static validation' - if: (fromJson(needs.job_initialize_pipeline.outputs.workflowInput)).staticValidation == 'true' - needs: - - job_initialize_pipeline - steps: - - name: 'Checkout' - uses: actions/checkout@v3 - with: - fetch-depth: 0 - - name: Set environment variables - uses: ./.github/actions/templates/setEnvironmentVariables - with: - variablesPath: ${{ env.variablesPath }} - - name: 'Run tests' - uses: ./.github/actions/templates/validateModulePester - with: - modulePath: '${{ env.modulePath }}' - moduleTestFilePath: '${{ env.moduleTestFilePath }}' - ############################# - # Deployment validation # - ############################# - job_module_deploy_validation: - runs-on: ubuntu-20.04 - name: 'Deploying' - if: | - !cancelled() && - (fromJson(needs.job_initialize_pipeline.outputs.workflowInput)).deploymentValidation == 'true' && - needs.job_module_static_validation.result != 'failure' + ############################## + # Call reusable workflow # + ############################## + call-workflow-passing-data: + name: 'Module' needs: - job_initialize_pipeline - - job_module_static_validation - strategy: - fail-fast: false - matrix: - moduleTestFilePaths: ${{ fromJson(needs.job_initialize_pipeline.outputs.moduleTestFilePaths) }} - steps: - - name: 'Checkout' - uses: actions/checkout@v3 - with: - fetch-depth: 0 - - name: Set environment variables - uses: ./.github/actions/templates/setEnvironmentVariables - with: - variablesPath: ${{ env.variablesPath }} - - name: 'Using test file [${{ matrix.moduleTestFilePaths }}]' - uses: ./.github/actions/templates/validateModuleDeployment - with: - templateFilePath: '${{ env.modulePath }}/${{ matrix.moduleTestFilePaths }}' - location: '${{ env.location }}' - subscriptionId: '${{ secrets.ARM_SUBSCRIPTION_ID }}' - managementGroupId: '${{ secrets.ARM_MGMTGROUP_ID }}' - removeDeployment: '${{ (fromJson(needs.job_initialize_pipeline.outputs.workflowInput)).removeDeployment }}' - - ################## - # Publishing # - ################## - job_publish_module: - name: 'Publishing' - if: github.ref == 'refs/heads/main' || github.ref == 'refs/heads/master' || github.event.inputs.prerelease == 'true' - runs-on: ubuntu-20.04 - needs: - - job_module_deploy_validation - steps: - - name: 'Checkout' - uses: actions/checkout@v3 - with: - fetch-depth: 0 - - name: Set environment variables - uses: ./.github/actions/templates/setEnvironmentVariables - with: - variablesPath: ${{ env.variablesPath }} - - name: 'Publishing' - uses: ./.github/actions/templates/publishModule - with: - templateFilePath: '${{ env.modulePath }}/deploy.bicep' - templateSpecsRGName: '${{ env.templateSpecsRGName }}' - templateSpecsRGLocation: '${{ env.templateSpecsRGLocation }}' - templateSpecsDescription: '${{ env.templateSpecsDescription }}' - templateSpecsDoPublish: '${{ env.templateSpecsDoPublish }}' - bicepRegistryName: '${{ env.bicepRegistryName }}' - bicepRegistryRGName: '${{ env.bicepRegistryRGName }}' - bicepRegistryRgLocation: '${{ env.bicepRegistryRgLocation }}' - bicepRegistryDoPublish: '${{ env.bicepRegistryDoPublish }}' - publishLatest: '${{ env.publishLatest }}' + uses: ./.github/workflows/template.module.yml + with: + workflowInput: '${{ needs.job_initialize_pipeline.outputs.workflowInput }}' + moduleTestFilePaths: '${{ needs.job_initialize_pipeline.outputs.moduleTestFilePaths }}' + modulePath: '${{ needs.job_initialize_pipeline.outputs.modulePath}}' + secrets: inherit diff --git a/.github/workflows/ms.cdn.profiles.yml b/.github/workflows/ms.cdn.profiles.yml index 9b28dd4886..be58161651 100644 --- a/.github/workflows/ms.cdn.profiles.yml +++ b/.github/workflows/ms.cdn.profiles.yml @@ -1,4 +1,4 @@ -name: 'CDN: Profiles' +name: 'CDN - Profiles' on: workflow_dispatch: @@ -28,6 +28,7 @@ on: - main paths: - '.github/actions/templates/**' + - '.github/workflows/template.module.yml' - '.github/workflows/ms.cdn.profiles.yml' - 'modules/Microsoft.CDN/profiles/**' - 'utilities/pipelines/**' @@ -35,14 +36,8 @@ on: - '!*/**/readme.md' env: - variablesPath: 'settings.yml' modulePath: 'modules/Microsoft.CDN/profiles' workflowPath: '.github/workflows/ms.cdn.profiles.yml' - AZURE_CREDENTIALS: ${{ secrets.AZURE_CREDENTIALS }} - ARM_SUBSCRIPTION_ID: '${{ secrets.ARM_SUBSCRIPTION_ID }}' - ARM_MGMTGROUP_ID: '${{ secrets.ARM_MGMTGROUP_ID }}' - ARM_TENANT_ID: '${{ secrets.ARM_TENANT_ID }}' - TOKEN_NAMEPREFIX: '${{ secrets.TOKEN_NAMEPREFIX }}' concurrency: group: ${{ github.workflow }} @@ -72,93 +67,19 @@ jobs: outputs: workflowInput: ${{ steps.get-workflow-param.outputs.workflowInput }} moduleTestFilePaths: ${{ steps.get-module-test-file-paths.outputs.moduleTestFilePaths }} + modulePath: '${{ env.modulePath }}' - ######################### - # Static validation # - ######################### - job_module_static_validation: - runs-on: ubuntu-20.04 - name: 'Static validation' - if: (fromJson(needs.job_initialize_pipeline.outputs.workflowInput)).staticValidation == 'true' - needs: - - job_initialize_pipeline - steps: - - name: 'Checkout' - uses: actions/checkout@v3 - with: - fetch-depth: 0 - - name: Set environment variables - uses: ./.github/actions/templates/setEnvironmentVariables - with: - variablesPath: ${{ env.variablesPath }} - - name: 'Run tests' - uses: ./.github/actions/templates/validateModulePester - with: - modulePath: '${{ env.modulePath }}' - moduleTestFilePath: '${{ env.moduleTestFilePath }}' - ############################# - # Deployment validation # - ############################# - job_module_deploy_validation: - runs-on: ubuntu-20.04 - name: 'Deploying' - if: | - !cancelled() && - (fromJson(needs.job_initialize_pipeline.outputs.workflowInput)).deploymentValidation == 'true' && - needs.job_module_static_validation.result != 'failure' + ############################## + # Call reusable workflow # + ############################## + call-workflow-passing-data: + name: 'Module' needs: - job_initialize_pipeline - - job_module_static_validation - strategy: - fail-fast: false - matrix: - moduleTestFilePaths: ${{ fromJson(needs.job_initialize_pipeline.outputs.moduleTestFilePaths) }} - steps: - - name: 'Checkout' - uses: actions/checkout@v3 - with: - fetch-depth: 0 - - name: Set environment variables - uses: ./.github/actions/templates/setEnvironmentVariables - with: - variablesPath: ${{ env.variablesPath }} - - name: 'Using test file [${{ matrix.moduleTestFilePaths }}]' - uses: ./.github/actions/templates/validateModuleDeployment - with: - templateFilePath: '${{ env.modulePath }}/${{ matrix.moduleTestFilePaths }}' - location: '${{ env.location }}' - subscriptionId: '${{ secrets.ARM_SUBSCRIPTION_ID }}' - managementGroupId: '${{ secrets.ARM_MGMTGROUP_ID }}' - removeDeployment: '${{ (fromJson(needs.job_initialize_pipeline.outputs.workflowInput)).removeDeployment }}' - - ################## - # Publishing # - ################## - job_publish_module: - name: 'Publishing' - if: github.ref == 'refs/heads/main' || github.ref == 'refs/heads/master' || github.event.inputs.prerelease == 'true' - runs-on: ubuntu-20.04 - needs: - - job_module_deploy_validation - steps: - - name: 'Checkout' - uses: actions/checkout@v3 - with: - fetch-depth: 0 - - name: Set environment variables - uses: ./.github/actions/templates/setEnvironmentVariables - with: - variablesPath: ${{ env.variablesPath }} - - name: 'Publishing' - uses: ./.github/actions/templates/publishModule - with: - templateFilePath: '${{ env.modulePath }}/deploy.bicep' - templateSpecsRGName: '${{ env.templateSpecsRGName }}' - templateSpecsRGLocation: '${{ env.templateSpecsRGLocation }}' - templateSpecsDescription: '${{ env.templateSpecsDescription }}' - templateSpecsDoPublish: '${{ env.templateSpecsDoPublish }}' - bicepRegistryName: '${{ env.bicepRegistryName }}' - bicepRegistryRGName: '${{ env.bicepRegistryRGName }}' - bicepRegistryRgLocation: '${{ env.bicepRegistryRgLocation }}' - bicepRegistryDoPublish: '${{ env.bicepRegistryDoPublish }}' + uses: ./.github/workflows/template.module.yml + with: + workflowInput: '${{ needs.job_initialize_pipeline.outputs.workflowInput }}' + moduleTestFilePaths: '${{ needs.job_initialize_pipeline.outputs.moduleTestFilePaths }}' + modulePath: '${{ needs.job_initialize_pipeline.outputs.modulePath}}' + secrets: inherit diff --git a/.github/workflows/ms.cognitiveservices.accounts.yml b/.github/workflows/ms.cognitiveservices.accounts.yml index 60708677db..c472491317 100644 --- a/.github/workflows/ms.cognitiveservices.accounts.yml +++ b/.github/workflows/ms.cognitiveservices.accounts.yml @@ -1,4 +1,4 @@ -name: 'CognitiveServices: Accounts' +name: 'CognitiveServices - Accounts' on: workflow_dispatch: @@ -28,6 +28,7 @@ on: - main paths: - '.github/actions/templates/**' + - '.github/workflows/template.module.yml' - '.github/workflows/ms.cognitiveservices.accounts.yml' - 'modules/Microsoft.CognitiveServices/accounts/**' - 'utilities/pipelines/**' @@ -35,14 +36,8 @@ on: - '!*/**/readme.md' env: - variablesPath: 'settings.yml' modulePath: 'modules/Microsoft.CognitiveServices/accounts' workflowPath: '.github/workflows/ms.cognitiveservices.accounts.yml' - AZURE_CREDENTIALS: ${{ secrets.AZURE_CREDENTIALS }} - ARM_SUBSCRIPTION_ID: '${{ secrets.ARM_SUBSCRIPTION_ID }}' - ARM_MGMTGROUP_ID: '${{ secrets.ARM_MGMTGROUP_ID }}' - ARM_TENANT_ID: '${{ secrets.ARM_TENANT_ID }}' - TOKEN_NAMEPREFIX: '${{ secrets.TOKEN_NAMEPREFIX }}' concurrency: group: ${{ github.workflow }} @@ -72,94 +67,19 @@ jobs: outputs: workflowInput: ${{ steps.get-workflow-param.outputs.workflowInput }} moduleTestFilePaths: ${{ steps.get-module-test-file-paths.outputs.moduleTestFilePaths }} + modulePath: '${{ env.modulePath }}' - ######################### - # Static validation # - ######################### - job_module_static_validation: - runs-on: ubuntu-20.04 - name: 'Static validation' - if: (fromJson(needs.job_initialize_pipeline.outputs.workflowInput)).staticValidation == 'true' - needs: - - job_initialize_pipeline - steps: - - name: 'Checkout' - uses: actions/checkout@v3 - with: - fetch-depth: 0 - - name: Set environment variables - uses: ./.github/actions/templates/setEnvironmentVariables - with: - variablesPath: ${{ env.variablesPath }} - - name: 'Run tests' - uses: ./.github/actions/templates/validateModulePester - with: - modulePath: '${{ env.modulePath }}' - moduleTestFilePath: '${{ env.moduleTestFilePath }}' - ############################# - # Deployment validation # - ############################# - job_module_deploy_validation: - runs-on: ubuntu-20.04 - name: 'Deploying' - if: | - !cancelled() && - (fromJson(needs.job_initialize_pipeline.outputs.workflowInput)).deploymentValidation == 'true' && - needs.job_module_static_validation.result != 'failure' + ############################## + # Call reusable workflow # + ############################## + call-workflow-passing-data: + name: 'Module' needs: - job_initialize_pipeline - - job_module_static_validation - strategy: - fail-fast: false - matrix: - moduleTestFilePaths: ${{ fromJson(needs.job_initialize_pipeline.outputs.moduleTestFilePaths) }} - steps: - - name: 'Checkout' - uses: actions/checkout@v3 - with: - fetch-depth: 0 - - name: Set environment variables - uses: ./.github/actions/templates/setEnvironmentVariables - with: - variablesPath: ${{ env.variablesPath }} - - name: 'Using test file [${{ matrix.moduleTestFilePaths }}]' - uses: ./.github/actions/templates/validateModuleDeployment - with: - templateFilePath: '${{ env.modulePath }}/${{ matrix.moduleTestFilePaths }}' - location: '${{ env.location }}' - subscriptionId: '${{ secrets.ARM_SUBSCRIPTION_ID }}' - managementGroupId: '${{ secrets.ARM_MGMTGROUP_ID }}' - removeDeployment: '${{ (fromJson(needs.job_initialize_pipeline.outputs.workflowInput)).removeDeployment }}' - - ################## - # Publishing # - ################## - job_publish_module: - name: 'Publishing' - if: github.ref == 'refs/heads/main' || github.ref == 'refs/heads/master' || github.event.inputs.prerelease == 'true' - runs-on: ubuntu-20.04 - needs: - - job_module_deploy_validation - steps: - - name: 'Checkout' - uses: actions/checkout@v3 - with: - fetch-depth: 0 - - name: Set environment variables - uses: ./.github/actions/templates/setEnvironmentVariables - with: - variablesPath: ${{ env.variablesPath }} - - name: 'Publishing' - uses: ./.github/actions/templates/publishModule - with: - templateFilePath: '${{ env.modulePath }}/deploy.bicep' - templateSpecsRGName: '${{ env.templateSpecsRGName }}' - templateSpecsRGLocation: '${{ env.templateSpecsRGLocation }}' - templateSpecsDescription: '${{ env.templateSpecsDescription }}' - templateSpecsDoPublish: '${{ env.templateSpecsDoPublish }}' - bicepRegistryName: '${{ env.bicepRegistryName }}' - bicepRegistryRGName: '${{ env.bicepRegistryRGName }}' - bicepRegistryRgLocation: '${{ env.bicepRegistryRgLocation }}' - bicepRegistryDoPublish: '${{ env.bicepRegistryDoPublish }}' - publishLatest: '${{ env.publishLatest }}' + uses: ./.github/workflows/template.module.yml + with: + workflowInput: '${{ needs.job_initialize_pipeline.outputs.workflowInput }}' + moduleTestFilePaths: '${{ needs.job_initialize_pipeline.outputs.moduleTestFilePaths }}' + modulePath: '${{ needs.job_initialize_pipeline.outputs.modulePath}}' + secrets: inherit diff --git a/.github/workflows/ms.compute.availabilitysets.yml b/.github/workflows/ms.compute.availabilitysets.yml index f2ba3a19c8..2b394d0897 100644 --- a/.github/workflows/ms.compute.availabilitysets.yml +++ b/.github/workflows/ms.compute.availabilitysets.yml @@ -1,4 +1,4 @@ -name: 'Compute: AvailabilitySets' +name: 'Compute - AvailabilitySets' on: workflow_dispatch: @@ -28,6 +28,7 @@ on: - main paths: - '.github/actions/templates/**' + - '.github/workflows/template.module.yml' - '.github/workflows/ms.compute.availabilitysets.yml' - 'modules/Microsoft.Compute/availabilitySets/**' - 'utilities/pipelines/**' @@ -35,14 +36,8 @@ on: - '!*/**/readme.md' env: - variablesPath: 'settings.yml' modulePath: 'modules/Microsoft.Compute/availabilitySets' workflowPath: '.github/workflows/ms.compute.availabilitysets.yml' - AZURE_CREDENTIALS: ${{ secrets.AZURE_CREDENTIALS }} - ARM_SUBSCRIPTION_ID: '${{ secrets.ARM_SUBSCRIPTION_ID }}' - ARM_MGMTGROUP_ID: '${{ secrets.ARM_MGMTGROUP_ID }}' - ARM_TENANT_ID: '${{ secrets.ARM_TENANT_ID }}' - TOKEN_NAMEPREFIX: '${{ secrets.TOKEN_NAMEPREFIX }}' concurrency: group: ${{ github.workflow }} @@ -72,94 +67,19 @@ jobs: outputs: workflowInput: ${{ steps.get-workflow-param.outputs.workflowInput }} moduleTestFilePaths: ${{ steps.get-module-test-file-paths.outputs.moduleTestFilePaths }} + modulePath: '${{ env.modulePath }}' - ######################### - # Static validation # - ######################### - job_module_static_validation: - runs-on: ubuntu-20.04 - name: 'Static validation' - if: (fromJson(needs.job_initialize_pipeline.outputs.workflowInput)).staticValidation == 'true' - needs: - - job_initialize_pipeline - steps: - - name: 'Checkout' - uses: actions/checkout@v3 - with: - fetch-depth: 0 - - name: Set environment variables - uses: ./.github/actions/templates/setEnvironmentVariables - with: - variablesPath: ${{ env.variablesPath }} - - name: 'Run tests' - uses: ./.github/actions/templates/validateModulePester - with: - modulePath: '${{ env.modulePath }}' - moduleTestFilePath: '${{ env.moduleTestFilePath }}' - ############################# - # Deployment validation # - ############################# - job_module_deploy_validation: - runs-on: ubuntu-20.04 - name: 'Deploying' - if: | - !cancelled() && - (fromJson(needs.job_initialize_pipeline.outputs.workflowInput)).deploymentValidation == 'true' && - needs.job_module_static_validation.result != 'failure' + ############################## + # Call reusable workflow # + ############################## + call-workflow-passing-data: + name: 'Module' needs: - job_initialize_pipeline - - job_module_static_validation - strategy: - fail-fast: false - matrix: - moduleTestFilePaths: ${{ fromJson(needs.job_initialize_pipeline.outputs.moduleTestFilePaths) }} - steps: - - name: 'Checkout' - uses: actions/checkout@v3 - with: - fetch-depth: 0 - - name: Set environment variables - uses: ./.github/actions/templates/setEnvironmentVariables - with: - variablesPath: ${{ env.variablesPath }} - - name: 'Using test file [${{ matrix.moduleTestFilePaths }}]' - uses: ./.github/actions/templates/validateModuleDeployment - with: - templateFilePath: '${{ env.modulePath }}/${{ matrix.moduleTestFilePaths }}' - location: '${{ env.location }}' - subscriptionId: '${{ secrets.ARM_SUBSCRIPTION_ID }}' - managementGroupId: '${{ secrets.ARM_MGMTGROUP_ID }}' - removeDeployment: '${{ (fromJson(needs.job_initialize_pipeline.outputs.workflowInput)).removeDeployment }}' - - ################## - # Publishing # - ################## - job_publish_module: - name: 'Publishing' - if: github.ref == 'refs/heads/main' || github.ref == 'refs/heads/master' || github.event.inputs.prerelease == 'true' - runs-on: ubuntu-20.04 - needs: - - job_module_deploy_validation - steps: - - name: 'Checkout' - uses: actions/checkout@v3 - with: - fetch-depth: 0 - - name: Set environment variables - uses: ./.github/actions/templates/setEnvironmentVariables - with: - variablesPath: ${{ env.variablesPath }} - - name: 'Publishing' - uses: ./.github/actions/templates/publishModule - with: - templateFilePath: '${{ env.modulePath }}/deploy.bicep' - templateSpecsRGName: '${{ env.templateSpecsRGName }}' - templateSpecsRGLocation: '${{ env.templateSpecsRGLocation }}' - templateSpecsDescription: '${{ env.templateSpecsDescription }}' - templateSpecsDoPublish: '${{ env.templateSpecsDoPublish }}' - bicepRegistryName: '${{ env.bicepRegistryName }}' - bicepRegistryRGName: '${{ env.bicepRegistryRGName }}' - bicepRegistryRgLocation: '${{ env.bicepRegistryRgLocation }}' - bicepRegistryDoPublish: '${{ env.bicepRegistryDoPublish }}' - publishLatest: '${{ env.publishLatest }}' + uses: ./.github/workflows/template.module.yml + with: + workflowInput: '${{ needs.job_initialize_pipeline.outputs.workflowInput }}' + moduleTestFilePaths: '${{ needs.job_initialize_pipeline.outputs.moduleTestFilePaths }}' + modulePath: '${{ needs.job_initialize_pipeline.outputs.modulePath}}' + secrets: inherit diff --git a/.github/workflows/ms.compute.diskencryptionsets.yml b/.github/workflows/ms.compute.diskencryptionsets.yml index a8ade40a0f..38b38e13bd 100644 --- a/.github/workflows/ms.compute.diskencryptionsets.yml +++ b/.github/workflows/ms.compute.diskencryptionsets.yml @@ -1,4 +1,4 @@ -name: 'Compute: DiskEncryptionSets' +name: 'Compute - DiskEncryptionSets' on: workflow_dispatch: @@ -28,6 +28,7 @@ on: - main paths: - '.github/actions/templates/**' + - '.github/workflows/template.module.yml' - '.github/workflows/ms.compute.diskencryptionsets.yml' - 'modules/Microsoft.Compute/diskEncryptionSets/**' - 'utilities/pipelines/**' @@ -35,14 +36,8 @@ on: - '!*/**/readme.md' env: - variablesPath: 'settings.yml' modulePath: 'modules/Microsoft.Compute/diskEncryptionSets' workflowPath: '.github/workflows/ms.compute.diskencryptionsets.yml' - AZURE_CREDENTIALS: ${{ secrets.AZURE_CREDENTIALS }} - ARM_SUBSCRIPTION_ID: '${{ secrets.ARM_SUBSCRIPTION_ID }}' - ARM_MGMTGROUP_ID: '${{ secrets.ARM_MGMTGROUP_ID }}' - ARM_TENANT_ID: '${{ secrets.ARM_TENANT_ID }}' - TOKEN_NAMEPREFIX: '${{ secrets.TOKEN_NAMEPREFIX }}' concurrency: group: ${{ github.workflow }} @@ -72,94 +67,19 @@ jobs: outputs: workflowInput: ${{ steps.get-workflow-param.outputs.workflowInput }} moduleTestFilePaths: ${{ steps.get-module-test-file-paths.outputs.moduleTestFilePaths }} + modulePath: '${{ env.modulePath }}' - ######################### - # Static validation # - ######################### - job_module_static_validation: - runs-on: ubuntu-20.04 - name: 'Static validation' - if: (fromJson(needs.job_initialize_pipeline.outputs.workflowInput)).staticValidation == 'true' - needs: - - job_initialize_pipeline - steps: - - name: 'Checkout' - uses: actions/checkout@v3 - with: - fetch-depth: 0 - - name: Set environment variables - uses: ./.github/actions/templates/setEnvironmentVariables - with: - variablesPath: ${{ env.variablesPath }} - - name: 'Run tests' - uses: ./.github/actions/templates/validateModulePester - with: - modulePath: '${{ env.modulePath }}' - moduleTestFilePath: '${{ env.moduleTestFilePath }}' - ############################# - # Deployment validation # - ############################# - job_module_deploy_validation: - runs-on: ubuntu-20.04 - name: 'Deploying' - if: | - !cancelled() && - (fromJson(needs.job_initialize_pipeline.outputs.workflowInput)).deploymentValidation == 'true' && - needs.job_module_static_validation.result != 'failure' + ############################## + # Call reusable workflow # + ############################## + call-workflow-passing-data: + name: 'Module' needs: - job_initialize_pipeline - - job_module_static_validation - strategy: - fail-fast: false - matrix: - moduleTestFilePaths: ${{ fromJson(needs.job_initialize_pipeline.outputs.moduleTestFilePaths) }} - steps: - - name: 'Checkout' - uses: actions/checkout@v3 - with: - fetch-depth: 0 - - name: Set environment variables - uses: ./.github/actions/templates/setEnvironmentVariables - with: - variablesPath: ${{ env.variablesPath }} - - name: 'Using test file [${{ matrix.moduleTestFilePaths }}]' - uses: ./.github/actions/templates/validateModuleDeployment - with: - templateFilePath: '${{ env.modulePath }}/${{ matrix.moduleTestFilePaths }}' - location: '${{ env.location }}' - subscriptionId: '${{ secrets.ARM_SUBSCRIPTION_ID }}' - managementGroupId: '${{ secrets.ARM_MGMTGROUP_ID }}' - removeDeployment: '${{ (fromJson(needs.job_initialize_pipeline.outputs.workflowInput)).removeDeployment }}' - - ################## - # Publishing # - ################## - job_publish_module: - name: 'Publishing' - if: github.ref == 'refs/heads/main' || github.ref == 'refs/heads/master' || github.event.inputs.prerelease == 'true' - runs-on: ubuntu-20.04 - needs: - - job_module_deploy_validation - steps: - - name: 'Checkout' - uses: actions/checkout@v3 - with: - fetch-depth: 0 - - name: Set environment variables - uses: ./.github/actions/templates/setEnvironmentVariables - with: - variablesPath: ${{ env.variablesPath }} - - name: 'Publishing' - uses: ./.github/actions/templates/publishModule - with: - templateFilePath: '${{ env.modulePath }}/deploy.bicep' - templateSpecsRGName: '${{ env.templateSpecsRGName }}' - templateSpecsRGLocation: '${{ env.templateSpecsRGLocation }}' - templateSpecsDescription: '${{ env.templateSpecsDescription }}' - templateSpecsDoPublish: '${{ env.templateSpecsDoPublish }}' - bicepRegistryName: '${{ env.bicepRegistryName }}' - bicepRegistryRGName: '${{ env.bicepRegistryRGName }}' - bicepRegistryRgLocation: '${{ env.bicepRegistryRgLocation }}' - bicepRegistryDoPublish: '${{ env.bicepRegistryDoPublish }}' - publishLatest: '${{ env.publishLatest }}' + uses: ./.github/workflows/template.module.yml + with: + workflowInput: '${{ needs.job_initialize_pipeline.outputs.workflowInput }}' + moduleTestFilePaths: '${{ needs.job_initialize_pipeline.outputs.moduleTestFilePaths }}' + modulePath: '${{ needs.job_initialize_pipeline.outputs.modulePath}}' + secrets: inherit diff --git a/.github/workflows/ms.compute.disks.yml b/.github/workflows/ms.compute.disks.yml index 27f51622e1..6b26194f70 100644 --- a/.github/workflows/ms.compute.disks.yml +++ b/.github/workflows/ms.compute.disks.yml @@ -1,4 +1,4 @@ -name: 'Compute: Disks' +name: 'Compute - Disks' on: workflow_dispatch: @@ -28,6 +28,7 @@ on: - main paths: - '.github/actions/templates/**' + - '.github/workflows/template.module.yml' - '.github/workflows/ms.compute.disks.yml' - 'modules/Microsoft.Compute/disks/**' - 'utilities/pipelines/**' @@ -35,14 +36,8 @@ on: - '!*/**/readme.md' env: - variablesPath: 'settings.yml' modulePath: 'modules/Microsoft.Compute/disks' workflowPath: '.github/workflows/ms.compute.disks.yml' - AZURE_CREDENTIALS: ${{ secrets.AZURE_CREDENTIALS }} - ARM_SUBSCRIPTION_ID: '${{ secrets.ARM_SUBSCRIPTION_ID }}' - ARM_MGMTGROUP_ID: '${{ secrets.ARM_MGMTGROUP_ID }}' - ARM_TENANT_ID: '${{ secrets.ARM_TENANT_ID }}' - TOKEN_NAMEPREFIX: '${{ secrets.TOKEN_NAMEPREFIX }}' concurrency: group: ${{ github.workflow }} @@ -72,94 +67,19 @@ jobs: outputs: workflowInput: ${{ steps.get-workflow-param.outputs.workflowInput }} moduleTestFilePaths: ${{ steps.get-module-test-file-paths.outputs.moduleTestFilePaths }} + modulePath: '${{ env.modulePath }}' - ######################### - # Static validation # - ######################### - job_module_static_validation: - runs-on: ubuntu-20.04 - name: 'Static validation' - if: (fromJson(needs.job_initialize_pipeline.outputs.workflowInput)).staticValidation == 'true' - needs: - - job_initialize_pipeline - steps: - - name: 'Checkout' - uses: actions/checkout@v3 - with: - fetch-depth: 0 - - name: Set environment variables - uses: ./.github/actions/templates/setEnvironmentVariables - with: - variablesPath: ${{ env.variablesPath }} - - name: 'Run tests' - uses: ./.github/actions/templates/validateModulePester - with: - modulePath: '${{ env.modulePath }}' - moduleTestFilePath: '${{ env.moduleTestFilePath }}' - ############################# - # Deployment validation # - ############################# - job_module_deploy_validation: - runs-on: ubuntu-20.04 - name: 'Deploying' - if: | - !cancelled() && - (fromJson(needs.job_initialize_pipeline.outputs.workflowInput)).deploymentValidation == 'true' && - needs.job_module_static_validation.result != 'failure' + ############################## + # Call reusable workflow # + ############################## + call-workflow-passing-data: + name: 'Module' needs: - job_initialize_pipeline - - job_module_static_validation - strategy: - fail-fast: false - matrix: - moduleTestFilePaths: ${{ fromJson(needs.job_initialize_pipeline.outputs.moduleTestFilePaths) }} - steps: - - name: 'Checkout' - uses: actions/checkout@v3 - with: - fetch-depth: 0 - - name: Set environment variables - uses: ./.github/actions/templates/setEnvironmentVariables - with: - variablesPath: ${{ env.variablesPath }} - - name: 'Using test file [${{ matrix.moduleTestFilePaths }}]' - uses: ./.github/actions/templates/validateModuleDeployment - with: - templateFilePath: '${{ env.modulePath }}/${{ matrix.moduleTestFilePaths }}' - location: '${{ env.location }}' - subscriptionId: '${{ secrets.ARM_SUBSCRIPTION_ID }}' - managementGroupId: '${{ secrets.ARM_MGMTGROUP_ID }}' - removeDeployment: '${{ (fromJson(needs.job_initialize_pipeline.outputs.workflowInput)).removeDeployment }}' - - ################## - # Publishing # - ################## - job_publish_module: - name: 'Publishing' - if: github.ref == 'refs/heads/main' || github.ref == 'refs/heads/master' || github.event.inputs.prerelease == 'true' - runs-on: ubuntu-20.04 - needs: - - job_module_deploy_validation - steps: - - name: 'Checkout' - uses: actions/checkout@v3 - with: - fetch-depth: 0 - - name: Set environment variables - uses: ./.github/actions/templates/setEnvironmentVariables - with: - variablesPath: ${{ env.variablesPath }} - - name: 'Publishing' - uses: ./.github/actions/templates/publishModule - with: - templateFilePath: '${{ env.modulePath }}/deploy.bicep' - templateSpecsRGName: '${{ env.templateSpecsRGName }}' - templateSpecsRGLocation: '${{ env.templateSpecsRGLocation }}' - templateSpecsDescription: '${{ env.templateSpecsDescription }}' - templateSpecsDoPublish: '${{ env.templateSpecsDoPublish }}' - bicepRegistryName: '${{ env.bicepRegistryName }}' - bicepRegistryRGName: '${{ env.bicepRegistryRGName }}' - bicepRegistryRgLocation: '${{ env.bicepRegistryRgLocation }}' - bicepRegistryDoPublish: '${{ env.bicepRegistryDoPublish }}' - publishLatest: '${{ env.publishLatest }}' + uses: ./.github/workflows/template.module.yml + with: + workflowInput: '${{ needs.job_initialize_pipeline.outputs.workflowInput }}' + moduleTestFilePaths: '${{ needs.job_initialize_pipeline.outputs.moduleTestFilePaths }}' + modulePath: '${{ needs.job_initialize_pipeline.outputs.modulePath}}' + secrets: inherit diff --git a/.github/workflows/ms.compute.galleries.yml b/.github/workflows/ms.compute.galleries.yml index 74c2cc2236..30ddd44e1d 100644 --- a/.github/workflows/ms.compute.galleries.yml +++ b/.github/workflows/ms.compute.galleries.yml @@ -1,4 +1,4 @@ -name: 'Compute: Galleries' +name: 'Compute - Galleries' on: workflow_dispatch: @@ -28,6 +28,7 @@ on: - main paths: - '.github/actions/templates/**' + - '.github/workflows/template.module.yml' - '.github/workflows/ms.compute.galleries.yml' - 'modules/Microsoft.Compute/galleries/**' - 'utilities/pipelines/**' @@ -35,14 +36,8 @@ on: - '!*/**/readme.md' env: - variablesPath: 'settings.yml' modulePath: 'modules/Microsoft.Compute/galleries' workflowPath: '.github/workflows/ms.compute.galleries.yml' - AZURE_CREDENTIALS: ${{ secrets.AZURE_CREDENTIALS }} - ARM_SUBSCRIPTION_ID: '${{ secrets.ARM_SUBSCRIPTION_ID }}' - ARM_MGMTGROUP_ID: '${{ secrets.ARM_MGMTGROUP_ID }}' - ARM_TENANT_ID: '${{ secrets.ARM_TENANT_ID }}' - TOKEN_NAMEPREFIX: '${{ secrets.TOKEN_NAMEPREFIX }}' concurrency: group: ${{ github.workflow }} @@ -72,94 +67,19 @@ jobs: outputs: workflowInput: ${{ steps.get-workflow-param.outputs.workflowInput }} moduleTestFilePaths: ${{ steps.get-module-test-file-paths.outputs.moduleTestFilePaths }} + modulePath: '${{ env.modulePath }}' - ######################### - # Static validation # - ######################### - job_module_static_validation: - runs-on: ubuntu-20.04 - name: 'Static validation' - if: (fromJson(needs.job_initialize_pipeline.outputs.workflowInput)).staticValidation == 'true' - needs: - - job_initialize_pipeline - steps: - - name: 'Checkout' - uses: actions/checkout@v3 - with: - fetch-depth: 0 - - name: Set environment variables - uses: ./.github/actions/templates/setEnvironmentVariables - with: - variablesPath: ${{ env.variablesPath }} - - name: 'Run tests' - uses: ./.github/actions/templates/validateModulePester - with: - modulePath: '${{ env.modulePath }}' - moduleTestFilePath: '${{ env.moduleTestFilePath }}' - ############################# - # Deployment validation # - ############################# - job_module_deploy_validation: - runs-on: ubuntu-20.04 - name: 'Deploying' - if: | - !cancelled() && - (fromJson(needs.job_initialize_pipeline.outputs.workflowInput)).deploymentValidation == 'true' && - needs.job_module_static_validation.result != 'failure' + ############################## + # Call reusable workflow # + ############################## + call-workflow-passing-data: + name: 'Module' needs: - job_initialize_pipeline - - job_module_static_validation - strategy: - fail-fast: false - matrix: - moduleTestFilePaths: ${{ fromJson(needs.job_initialize_pipeline.outputs.moduleTestFilePaths) }} - steps: - - name: 'Checkout' - uses: actions/checkout@v3 - with: - fetch-depth: 0 - - name: Set environment variables - uses: ./.github/actions/templates/setEnvironmentVariables - with: - variablesPath: ${{ env.variablesPath }} - - name: 'Using test file [${{ matrix.moduleTestFilePaths }}]' - uses: ./.github/actions/templates/validateModuleDeployment - with: - templateFilePath: '${{ env.modulePath }}/${{ matrix.moduleTestFilePaths }}' - location: '${{ env.location }}' - subscriptionId: '${{ secrets.ARM_SUBSCRIPTION_ID }}' - managementGroupId: '${{ secrets.ARM_MGMTGROUP_ID }}' - removeDeployment: '${{ (fromJson(needs.job_initialize_pipeline.outputs.workflowInput)).removeDeployment }}' - - ################## - # Publishing # - ################## - job_publish_module: - name: 'Publishing' - if: github.ref == 'refs/heads/main' || github.ref == 'refs/heads/master' || github.event.inputs.prerelease == 'true' - runs-on: ubuntu-20.04 - needs: - - job_module_deploy_validation - steps: - - name: 'Checkout' - uses: actions/checkout@v3 - with: - fetch-depth: 0 - - name: Set environment variables - uses: ./.github/actions/templates/setEnvironmentVariables - with: - variablesPath: ${{ env.variablesPath }} - - name: 'Publishing' - uses: ./.github/actions/templates/publishModule - with: - templateFilePath: '${{ env.modulePath }}/deploy.bicep' - templateSpecsRGName: '${{ env.templateSpecsRGName }}' - templateSpecsRGLocation: '${{ env.templateSpecsRGLocation }}' - templateSpecsDescription: '${{ env.templateSpecsDescription }}' - templateSpecsDoPublish: '${{ env.templateSpecsDoPublish }}' - bicepRegistryName: '${{ env.bicepRegistryName }}' - bicepRegistryRGName: '${{ env.bicepRegistryRGName }}' - bicepRegistryRgLocation: '${{ env.bicepRegistryRgLocation }}' - bicepRegistryDoPublish: '${{ env.bicepRegistryDoPublish }}' - publishLatest: '${{ env.publishLatest }}' + uses: ./.github/workflows/template.module.yml + with: + workflowInput: '${{ needs.job_initialize_pipeline.outputs.workflowInput }}' + moduleTestFilePaths: '${{ needs.job_initialize_pipeline.outputs.moduleTestFilePaths }}' + modulePath: '${{ needs.job_initialize_pipeline.outputs.modulePath}}' + secrets: inherit diff --git a/.github/workflows/ms.compute.images.yml b/.github/workflows/ms.compute.images.yml index 47c610e2c7..19b18c3c30 100644 --- a/.github/workflows/ms.compute.images.yml +++ b/.github/workflows/ms.compute.images.yml @@ -1,4 +1,4 @@ -name: 'Compute: Images' +name: 'Compute - Images' on: workflow_dispatch: @@ -28,6 +28,7 @@ on: - main paths: - '.github/actions/templates/**' + - '.github/workflows/template.module.yml' - '.github/workflows/ms.compute.images.yml' - 'modules/Microsoft.Compute/images/**' - 'utilities/pipelines/**' @@ -35,14 +36,8 @@ on: - '!*/**/readme.md' env: - variablesPath: 'settings.yml' modulePath: 'modules/Microsoft.Compute/images' workflowPath: '.github/workflows/ms.compute.images.yml' - AZURE_CREDENTIALS: ${{ secrets.AZURE_CREDENTIALS }} - ARM_SUBSCRIPTION_ID: '${{ secrets.ARM_SUBSCRIPTION_ID }}' - ARM_MGMTGROUP_ID: '${{ secrets.ARM_MGMTGROUP_ID }}' - ARM_TENANT_ID: '${{ secrets.ARM_TENANT_ID }}' - TOKEN_NAMEPREFIX: '${{ secrets.TOKEN_NAMEPREFIX }}' concurrency: group: ${{ github.workflow }} @@ -72,94 +67,19 @@ jobs: outputs: workflowInput: ${{ steps.get-workflow-param.outputs.workflowInput }} moduleTestFilePaths: ${{ steps.get-module-test-file-paths.outputs.moduleTestFilePaths }} + modulePath: '${{ env.modulePath }}' - ######################### - # Static validation # - ######################### - job_module_static_validation: - runs-on: ubuntu-20.04 - name: 'Static validation' - if: (fromJson(needs.job_initialize_pipeline.outputs.workflowInput)).staticValidation == 'true' - needs: - - job_initialize_pipeline - steps: - - name: 'Checkout' - uses: actions/checkout@v3 - with: - fetch-depth: 0 - - name: Set environment variables - uses: ./.github/actions/templates/setEnvironmentVariables - with: - variablesPath: ${{ env.variablesPath }} - - name: 'Run tests' - uses: ./.github/actions/templates/validateModulePester - with: - modulePath: '${{ env.modulePath }}' - moduleTestFilePath: '${{ env.moduleTestFilePath }}' - ############################# - # Deployment validation # - ############################# - job_module_deploy_validation: - runs-on: ubuntu-20.04 - name: 'Deploying' - if: | - !cancelled() && - (fromJson(needs.job_initialize_pipeline.outputs.workflowInput)).deploymentValidation == 'true' && - needs.job_module_static_validation.result != 'failure' + ############################## + # Call reusable workflow # + ############################## + call-workflow-passing-data: + name: 'Module' needs: - job_initialize_pipeline - - job_module_static_validation - strategy: - fail-fast: false - matrix: - moduleTestFilePaths: ${{ fromJson(needs.job_initialize_pipeline.outputs.moduleTestFilePaths) }} - steps: - - name: 'Checkout' - uses: actions/checkout@v3 - with: - fetch-depth: 0 - - name: Set environment variables - uses: ./.github/actions/templates/setEnvironmentVariables - with: - variablesPath: ${{ env.variablesPath }} - - name: 'Using test file [${{ matrix.moduleTestFilePaths }}]' - uses: ./.github/actions/templates/validateModuleDeployment - with: - templateFilePath: '${{ env.modulePath }}/${{ matrix.moduleTestFilePaths }}' - location: '${{ env.location }}' - subscriptionId: '${{ secrets.ARM_SUBSCRIPTION_ID }}' - managementGroupId: '${{ secrets.ARM_MGMTGROUP_ID }}' - removeDeployment: '${{ (fromJson(needs.job_initialize_pipeline.outputs.workflowInput)).removeDeployment }}' - - ################## - # Publishing # - ################## - job_publish_module: - name: 'Publishing' - if: github.ref == 'refs/heads/main' || github.ref == 'refs/heads/master' || github.event.inputs.prerelease == 'true' - runs-on: ubuntu-20.04 - needs: - - job_module_deploy_validation - steps: - - name: 'Checkout' - uses: actions/checkout@v3 - with: - fetch-depth: 0 - - name: Set environment variables - uses: ./.github/actions/templates/setEnvironmentVariables - with: - variablesPath: ${{ env.variablesPath }} - - name: 'Publishing' - uses: ./.github/actions/templates/publishModule - with: - templateFilePath: '${{ env.modulePath }}/deploy.bicep' - templateSpecsRGName: '${{ env.templateSpecsRGName }}' - templateSpecsRGLocation: '${{ env.templateSpecsRGLocation }}' - templateSpecsDescription: '${{ env.templateSpecsDescription }}' - templateSpecsDoPublish: '${{ env.templateSpecsDoPublish }}' - bicepRegistryName: '${{ env.bicepRegistryName }}' - bicepRegistryRGName: '${{ env.bicepRegistryRGName }}' - bicepRegistryRgLocation: '${{ env.bicepRegistryRgLocation }}' - bicepRegistryDoPublish: '${{ env.bicepRegistryDoPublish }}' - publishLatest: '${{ env.publishLatest }}' + uses: ./.github/workflows/template.module.yml + with: + workflowInput: '${{ needs.job_initialize_pipeline.outputs.workflowInput }}' + moduleTestFilePaths: '${{ needs.job_initialize_pipeline.outputs.moduleTestFilePaths }}' + modulePath: '${{ needs.job_initialize_pipeline.outputs.modulePath}}' + secrets: inherit diff --git a/.github/workflows/ms.compute.proximityplacementgroups.yml b/.github/workflows/ms.compute.proximityplacementgroups.yml index 97c3487b60..f47c96fb7f 100644 --- a/.github/workflows/ms.compute.proximityplacementgroups.yml +++ b/.github/workflows/ms.compute.proximityplacementgroups.yml @@ -1,4 +1,4 @@ -name: 'Compute: ProximityPlacementGroups' +name: 'Compute - ProximityPlacementGroups' on: workflow_dispatch: @@ -28,6 +28,7 @@ on: - main paths: - '.github/actions/templates/**' + - '.github/workflows/template.module.yml' - '.github/workflows/ms.compute.proximityplacementgroups.yml' - 'modules/Microsoft.Compute/proximityPlacementGroups/**' - 'utilities/pipelines/**' @@ -35,14 +36,8 @@ on: - '!*/**/readme.md' env: - variablesPath: 'settings.yml' modulePath: 'modules/Microsoft.Compute/proximityPlacementGroups' workflowPath: '.github/workflows/ms.compute.proximityplacementgroups.yml' - AZURE_CREDENTIALS: ${{ secrets.AZURE_CREDENTIALS }} - ARM_SUBSCRIPTION_ID: '${{ secrets.ARM_SUBSCRIPTION_ID }}' - ARM_MGMTGROUP_ID: '${{ secrets.ARM_MGMTGROUP_ID }}' - ARM_TENANT_ID: '${{ secrets.ARM_TENANT_ID }}' - TOKEN_NAMEPREFIX: '${{ secrets.TOKEN_NAMEPREFIX }}' concurrency: group: ${{ github.workflow }} @@ -72,94 +67,19 @@ jobs: outputs: workflowInput: ${{ steps.get-workflow-param.outputs.workflowInput }} moduleTestFilePaths: ${{ steps.get-module-test-file-paths.outputs.moduleTestFilePaths }} + modulePath: '${{ env.modulePath }}' - ######################### - # Static validation # - ######################### - job_module_static_validation: - runs-on: ubuntu-20.04 - name: 'Static validation' - if: (fromJson(needs.job_initialize_pipeline.outputs.workflowInput)).staticValidation == 'true' - needs: - - job_initialize_pipeline - steps: - - name: 'Checkout' - uses: actions/checkout@v3 - with: - fetch-depth: 0 - - name: Set environment variables - uses: ./.github/actions/templates/setEnvironmentVariables - with: - variablesPath: ${{ env.variablesPath }} - - name: 'Run tests' - uses: ./.github/actions/templates/validateModulePester - with: - modulePath: '${{ env.modulePath }}' - moduleTestFilePath: '${{ env.moduleTestFilePath }}' - ############################# - # Deployment validation # - ############################# - job_module_deploy_validation: - runs-on: ubuntu-20.04 - name: 'Deploying' - if: | - !cancelled() && - (fromJson(needs.job_initialize_pipeline.outputs.workflowInput)).deploymentValidation == 'true' && - needs.job_module_static_validation.result != 'failure' + ############################## + # Call reusable workflow # + ############################## + call-workflow-passing-data: + name: 'Module' needs: - job_initialize_pipeline - - job_module_static_validation - strategy: - fail-fast: false - matrix: - moduleTestFilePaths: ${{ fromJson(needs.job_initialize_pipeline.outputs.moduleTestFilePaths) }} - steps: - - name: 'Checkout' - uses: actions/checkout@v3 - with: - fetch-depth: 0 - - name: Set environment variables - uses: ./.github/actions/templates/setEnvironmentVariables - with: - variablesPath: ${{ env.variablesPath }} - - name: 'Using test file [${{ matrix.moduleTestFilePaths }}]' - uses: ./.github/actions/templates/validateModuleDeployment - with: - templateFilePath: '${{ env.modulePath }}/${{ matrix.moduleTestFilePaths }}' - location: '${{ env.location }}' - subscriptionId: '${{ secrets.ARM_SUBSCRIPTION_ID }}' - managementGroupId: '${{ secrets.ARM_MGMTGROUP_ID }}' - removeDeployment: '${{ (fromJson(needs.job_initialize_pipeline.outputs.workflowInput)).removeDeployment }}' - - ################## - # Publishing # - ################## - job_publish_module: - name: 'Publishing' - if: github.ref == 'refs/heads/main' || github.ref == 'refs/heads/master' || github.event.inputs.prerelease == 'true' - runs-on: ubuntu-20.04 - needs: - - job_module_deploy_validation - steps: - - name: 'Checkout' - uses: actions/checkout@v3 - with: - fetch-depth: 0 - - name: Set environment variables - uses: ./.github/actions/templates/setEnvironmentVariables - with: - variablesPath: ${{ env.variablesPath }} - - name: 'Publishing' - uses: ./.github/actions/templates/publishModule - with: - templateFilePath: '${{ env.modulePath }}/deploy.bicep' - templateSpecsRGName: '${{ env.templateSpecsRGName }}' - templateSpecsRGLocation: '${{ env.templateSpecsRGLocation }}' - templateSpecsDescription: '${{ env.templateSpecsDescription }}' - templateSpecsDoPublish: '${{ env.templateSpecsDoPublish }}' - bicepRegistryName: '${{ env.bicepRegistryName }}' - bicepRegistryRGName: '${{ env.bicepRegistryRGName }}' - bicepRegistryRgLocation: '${{ env.bicepRegistryRgLocation }}' - bicepRegistryDoPublish: '${{ env.bicepRegistryDoPublish }}' - publishLatest: '${{ env.publishLatest }}' + uses: ./.github/workflows/template.module.yml + with: + workflowInput: '${{ needs.job_initialize_pipeline.outputs.workflowInput }}' + moduleTestFilePaths: '${{ needs.job_initialize_pipeline.outputs.moduleTestFilePaths }}' + modulePath: '${{ needs.job_initialize_pipeline.outputs.modulePath}}' + secrets: inherit diff --git a/.github/workflows/ms.compute.virtualmachines.yml b/.github/workflows/ms.compute.virtualmachines.yml index 18895ea747..c8eea24b4a 100644 --- a/.github/workflows/ms.compute.virtualmachines.yml +++ b/.github/workflows/ms.compute.virtualmachines.yml @@ -1,4 +1,4 @@ -name: 'Compute: VirtualMachines' +name: 'Compute - VirtualMachines' on: workflow_dispatch: @@ -28,6 +28,7 @@ on: - main paths: - '.github/actions/templates/**' + - '.github/workflows/template.module.yml' - '.github/workflows/ms.compute.virtualmachines.yml' - 'modules/Microsoft.Compute/virtualMachines/**' - 'utilities/pipelines/**' @@ -35,14 +36,8 @@ on: - '!*/**/readme.md' env: - variablesPath: 'settings.yml' modulePath: 'modules/Microsoft.Compute/virtualMachines' workflowPath: '.github/workflows/ms.compute.virtualmachines.yml' - AZURE_CREDENTIALS: ${{ secrets.AZURE_CREDENTIALS }} - ARM_SUBSCRIPTION_ID: '${{ secrets.ARM_SUBSCRIPTION_ID }}' - ARM_MGMTGROUP_ID: '${{ secrets.ARM_MGMTGROUP_ID }}' - ARM_TENANT_ID: '${{ secrets.ARM_TENANT_ID }}' - TOKEN_NAMEPREFIX: '${{ secrets.TOKEN_NAMEPREFIX }}' concurrency: group: ${{ github.workflow }} @@ -72,94 +67,19 @@ jobs: outputs: workflowInput: ${{ steps.get-workflow-param.outputs.workflowInput }} moduleTestFilePaths: ${{ steps.get-module-test-file-paths.outputs.moduleTestFilePaths }} + modulePath: '${{ env.modulePath }}' - ######################### - # Static validation # - ######################### - job_module_static_validation: - runs-on: ubuntu-20.04 - name: 'Static validation' - if: (fromJson(needs.job_initialize_pipeline.outputs.workflowInput)).staticValidation == 'true' - needs: - - job_initialize_pipeline - steps: - - name: 'Checkout' - uses: actions/checkout@v3 - with: - fetch-depth: 0 - - name: Set environment variables - uses: ./.github/actions/templates/setEnvironmentVariables - with: - variablesPath: ${{ env.variablesPath }} - - name: 'Run tests' - uses: ./.github/actions/templates/validateModulePester - with: - modulePath: '${{ env.modulePath }}' - moduleTestFilePath: '${{ env.moduleTestFilePath }}' - ############################# - # Deployment validation # - ############################# - job_module_deploy_validation: - runs-on: ubuntu-20.04 - name: 'Deploying' - if: | - !cancelled() && - (fromJson(needs.job_initialize_pipeline.outputs.workflowInput)).deploymentValidation == 'true' && - needs.job_module_static_validation.result != 'failure' + ############################## + # Call reusable workflow # + ############################## + call-workflow-passing-data: + name: 'Module' needs: - job_initialize_pipeline - - job_module_static_validation - strategy: - fail-fast: false - matrix: - moduleTestFilePaths: ${{ fromJson(needs.job_initialize_pipeline.outputs.moduleTestFilePaths) }} - steps: - - name: 'Checkout' - uses: actions/checkout@v3 - with: - fetch-depth: 0 - - name: Set environment variables - uses: ./.github/actions/templates/setEnvironmentVariables - with: - variablesPath: ${{ env.variablesPath }} - - name: 'Using test file [${{ matrix.moduleTestFilePaths }}]' - uses: ./.github/actions/templates/validateModuleDeployment - with: - templateFilePath: '${{ env.modulePath }}/${{ matrix.moduleTestFilePaths }}' - location: '${{ env.location }}' - subscriptionId: '${{ secrets.ARM_SUBSCRIPTION_ID }}' - managementGroupId: '${{ secrets.ARM_MGMTGROUP_ID }}' - removeDeployment: '${{ (fromJson(needs.job_initialize_pipeline.outputs.workflowInput)).removeDeployment }}' - - ################## - # Publishing # - ################## - job_publish_module: - name: 'Publishing' - if: github.ref == 'refs/heads/main' || github.ref == 'refs/heads/master' || github.event.inputs.prerelease == 'true' - runs-on: ubuntu-20.04 - needs: - - job_module_deploy_validation - steps: - - name: 'Checkout' - uses: actions/checkout@v3 - with: - fetch-depth: 0 - - name: Set environment variables - uses: ./.github/actions/templates/setEnvironmentVariables - with: - variablesPath: ${{ env.variablesPath }} - - name: 'Publishing' - uses: ./.github/actions/templates/publishModule - with: - templateFilePath: '${{ env.modulePath }}/deploy.bicep' - templateSpecsRGName: '${{ env.templateSpecsRGName }}' - templateSpecsRGLocation: '${{ env.templateSpecsRGLocation }}' - templateSpecsDescription: '${{ env.templateSpecsDescription }}' - templateSpecsDoPublish: '${{ env.templateSpecsDoPublish }}' - bicepRegistryName: '${{ env.bicepRegistryName }}' - bicepRegistryRGName: '${{ env.bicepRegistryRGName }}' - bicepRegistryRgLocation: '${{ env.bicepRegistryRgLocation }}' - bicepRegistryDoPublish: '${{ env.bicepRegistryDoPublish }}' - publishLatest: '${{ env.publishLatest }}' + uses: ./.github/workflows/template.module.yml + with: + workflowInput: '${{ needs.job_initialize_pipeline.outputs.workflowInput }}' + moduleTestFilePaths: '${{ needs.job_initialize_pipeline.outputs.moduleTestFilePaths }}' + modulePath: '${{ needs.job_initialize_pipeline.outputs.modulePath}}' + secrets: inherit diff --git a/.github/workflows/ms.compute.virtualmachinescalesets.yml b/.github/workflows/ms.compute.virtualmachinescalesets.yml index e1adf7589d..5c22912641 100644 --- a/.github/workflows/ms.compute.virtualmachinescalesets.yml +++ b/.github/workflows/ms.compute.virtualmachinescalesets.yml @@ -1,4 +1,4 @@ -name: 'Compute: VirtualMachineScaleSets' +name: 'Compute - VirtualMachineScaleSets' on: workflow_dispatch: @@ -28,6 +28,7 @@ on: - main paths: - '.github/actions/templates/**' + - '.github/workflows/template.module.yml' - '.github/workflows/ms.compute.virtualmachinescalesets.yml' - 'modules/Microsoft.Compute/virtualMachineScaleSets/**' - 'utilities/pipelines/**' @@ -35,14 +36,8 @@ on: - '!*/**/readme.md' env: - variablesPath: 'settings.yml' modulePath: 'modules/Microsoft.Compute/virtualMachineScaleSets' workflowPath: '.github/workflows/ms.compute.virtualmachinescalesets.yml' - AZURE_CREDENTIALS: ${{ secrets.AZURE_CREDENTIALS }} - ARM_SUBSCRIPTION_ID: '${{ secrets.ARM_SUBSCRIPTION_ID }}' - ARM_MGMTGROUP_ID: '${{ secrets.ARM_MGMTGROUP_ID }}' - ARM_TENANT_ID: '${{ secrets.ARM_TENANT_ID }}' - TOKEN_NAMEPREFIX: '${{ secrets.TOKEN_NAMEPREFIX }}' concurrency: group: ${{ github.workflow }} @@ -72,94 +67,19 @@ jobs: outputs: workflowInput: ${{ steps.get-workflow-param.outputs.workflowInput }} moduleTestFilePaths: ${{ steps.get-module-test-file-paths.outputs.moduleTestFilePaths }} + modulePath: '${{ env.modulePath }}' - ######################### - # Static validation # - ######################### - job_module_static_validation: - runs-on: ubuntu-20.04 - name: 'Static validation' - if: (fromJson(needs.job_initialize_pipeline.outputs.workflowInput)).staticValidation == 'true' - needs: - - job_initialize_pipeline - steps: - - name: 'Checkout' - uses: actions/checkout@v3 - with: - fetch-depth: 0 - - name: Set environment variables - uses: ./.github/actions/templates/setEnvironmentVariables - with: - variablesPath: ${{ env.variablesPath }} - - name: 'Run tests' - uses: ./.github/actions/templates/validateModulePester - with: - modulePath: '${{ env.modulePath }}' - moduleTestFilePath: '${{ env.moduleTestFilePath }}' - ############################# - # Deployment validation # - ############################# - job_module_deploy_validation: - runs-on: ubuntu-20.04 - name: 'Deploying' - if: | - !cancelled() && - (fromJson(needs.job_initialize_pipeline.outputs.workflowInput)).deploymentValidation == 'true' && - needs.job_module_static_validation.result != 'failure' + ############################## + # Call reusable workflow # + ############################## + call-workflow-passing-data: + name: 'Module' needs: - job_initialize_pipeline - - job_module_static_validation - strategy: - fail-fast: false - matrix: - moduleTestFilePaths: ${{ fromJson(needs.job_initialize_pipeline.outputs.moduleTestFilePaths) }} - steps: - - name: 'Checkout' - uses: actions/checkout@v3 - with: - fetch-depth: 0 - - name: Set environment variables - uses: ./.github/actions/templates/setEnvironmentVariables - with: - variablesPath: ${{ env.variablesPath }} - - name: 'Using test file [${{ matrix.moduleTestFilePaths }}]' - uses: ./.github/actions/templates/validateModuleDeployment - with: - templateFilePath: '${{ env.modulePath }}/${{ matrix.moduleTestFilePaths }}' - location: '${{ env.location }}' - subscriptionId: '${{ secrets.ARM_SUBSCRIPTION_ID }}' - managementGroupId: '${{ secrets.ARM_MGMTGROUP_ID }}' - removeDeployment: '${{ (fromJson(needs.job_initialize_pipeline.outputs.workflowInput)).removeDeployment }}' - - ################## - # Publishing # - ################## - job_publish_module: - name: 'Publishing' - if: github.ref == 'refs/heads/main' || github.ref == 'refs/heads/master' || github.event.inputs.prerelease == 'true' - runs-on: ubuntu-20.04 - needs: - - job_module_deploy_validation - steps: - - name: 'Checkout' - uses: actions/checkout@v3 - with: - fetch-depth: 0 - - name: Set environment variables - uses: ./.github/actions/templates/setEnvironmentVariables - with: - variablesPath: ${{ env.variablesPath }} - - name: 'Publishing' - uses: ./.github/actions/templates/publishModule - with: - templateFilePath: '${{ env.modulePath }}/deploy.bicep' - templateSpecsRGName: '${{ env.templateSpecsRGName }}' - templateSpecsRGLocation: '${{ env.templateSpecsRGLocation }}' - templateSpecsDescription: '${{ env.templateSpecsDescription }}' - templateSpecsDoPublish: '${{ env.templateSpecsDoPublish }}' - bicepRegistryName: '${{ env.bicepRegistryName }}' - bicepRegistryRGName: '${{ env.bicepRegistryRGName }}' - bicepRegistryRgLocation: '${{ env.bicepRegistryRgLocation }}' - bicepRegistryDoPublish: '${{ env.bicepRegistryDoPublish }}' - publishLatest: '${{ env.publishLatest }}' + uses: ./.github/workflows/template.module.yml + with: + workflowInput: '${{ needs.job_initialize_pipeline.outputs.workflowInput }}' + moduleTestFilePaths: '${{ needs.job_initialize_pipeline.outputs.moduleTestFilePaths }}' + modulePath: '${{ needs.job_initialize_pipeline.outputs.modulePath}}' + secrets: inherit diff --git a/.github/workflows/ms.consumption.budgets.yml b/.github/workflows/ms.consumption.budgets.yml index ae28d0b3ed..33335df309 100644 --- a/.github/workflows/ms.consumption.budgets.yml +++ b/.github/workflows/ms.consumption.budgets.yml @@ -1,4 +1,4 @@ -name: 'Consumption: Budgets' +name: 'Consumption - Budgets' on: workflow_dispatch: @@ -28,6 +28,7 @@ on: - main paths: - '.github/actions/templates/**' + - '.github/workflows/template.module.yml' - '.github/workflows/ms.consumption.budgets.yml' - 'modules/Microsoft.Consumption/budgets/**' - 'utilities/pipelines/**' @@ -35,14 +36,8 @@ on: - '!*/**/readme.md' env: - variablesPath: 'settings.yml' modulePath: 'modules/Microsoft.Consumption/budgets' workflowPath: '.github/workflows/ms.consumption.budgets.yml' - AZURE_CREDENTIALS: ${{ secrets.AZURE_CREDENTIALS }} - ARM_SUBSCRIPTION_ID: '${{ secrets.ARM_SUBSCRIPTION_ID }}' - ARM_MGMTGROUP_ID: '${{ secrets.ARM_MGMTGROUP_ID }}' - ARM_TENANT_ID: '${{ secrets.ARM_TENANT_ID }}' - TOKEN_NAMEPREFIX: '${{ secrets.TOKEN_NAMEPREFIX }}' concurrency: group: ${{ github.workflow }} @@ -72,94 +67,19 @@ jobs: outputs: workflowInput: ${{ steps.get-workflow-param.outputs.workflowInput }} moduleTestFilePaths: ${{ steps.get-module-test-file-paths.outputs.moduleTestFilePaths }} + modulePath: '${{ env.modulePath }}' - ######################### - # Static validation # - ######################### - job_module_static_validation: - runs-on: ubuntu-20.04 - name: 'Static validation' - if: (fromJson(needs.job_initialize_pipeline.outputs.workflowInput)).staticValidation == 'true' - needs: - - job_initialize_pipeline - steps: - - name: 'Checkout' - uses: actions/checkout@v3 - with: - fetch-depth: 0 - - name: Set environment variables - uses: ./.github/actions/templates/setEnvironmentVariables - with: - variablesPath: ${{ env.variablesPath }} - - name: 'Run tests' - uses: ./.github/actions/templates/validateModulePester - with: - modulePath: '${{ env.modulePath }}' - moduleTestFilePath: '${{ env.moduleTestFilePath }}' - ############################# - # Deployment validation # - ############################# - job_module_deploy_validation: - runs-on: ubuntu-20.04 - name: 'Deploying' - if: | - !cancelled() && - (fromJson(needs.job_initialize_pipeline.outputs.workflowInput)).deploymentValidation == 'true' && - needs.job_module_static_validation.result != 'failure' + ############################## + # Call reusable workflow # + ############################## + call-workflow-passing-data: + name: 'Module' needs: - job_initialize_pipeline - - job_module_static_validation - strategy: - fail-fast: false - matrix: - moduleTestFilePaths: ${{ fromJson(needs.job_initialize_pipeline.outputs.moduleTestFilePaths) }} - steps: - - name: 'Checkout' - uses: actions/checkout@v3 - with: - fetch-depth: 0 - - name: Set environment variables - uses: ./.github/actions/templates/setEnvironmentVariables - with: - variablesPath: ${{ env.variablesPath }} - - name: 'Using test file [${{ matrix.moduleTestFilePaths }}]' - uses: ./.github/actions/templates/validateModuleDeployment - with: - templateFilePath: '${{ env.modulePath }}/${{ matrix.moduleTestFilePaths }}' - location: '${{ env.location }}' - subscriptionId: '${{ secrets.ARM_SUBSCRIPTION_ID }}' - managementGroupId: '${{ secrets.ARM_MGMTGROUP_ID }}' - removeDeployment: '${{ (fromJson(needs.job_initialize_pipeline.outputs.workflowInput)).removeDeployment }}' - - ################## - # Publishing # - ################## - job_publish_module: - name: 'Publishing' - if: github.ref == 'refs/heads/main' || github.ref == 'refs/heads/master' || github.event.inputs.prerelease == 'true' - runs-on: ubuntu-20.04 - needs: - - job_module_deploy_validation - steps: - - name: 'Checkout' - uses: actions/checkout@v3 - with: - fetch-depth: 0 - - name: Set environment variables - uses: ./.github/actions/templates/setEnvironmentVariables - with: - variablesPath: ${{ env.variablesPath }} - - name: 'Publishing' - uses: ./.github/actions/templates/publishModule - with: - templateFilePath: '${{ env.modulePath }}/deploy.bicep' - templateSpecsRGName: '${{ env.templateSpecsRGName }}' - templateSpecsRGLocation: '${{ env.templateSpecsRGLocation }}' - templateSpecsDescription: '${{ env.templateSpecsDescription }}' - templateSpecsDoPublish: '${{ env.templateSpecsDoPublish }}' - bicepRegistryName: '${{ env.bicepRegistryName }}' - bicepRegistryRGName: '${{ env.bicepRegistryRGName }}' - bicepRegistryRgLocation: '${{ env.bicepRegistryRgLocation }}' - bicepRegistryDoPublish: '${{ env.bicepRegistryDoPublish }}' - publishLatest: '${{ env.publishLatest }}' + uses: ./.github/workflows/template.module.yml + with: + workflowInput: '${{ needs.job_initialize_pipeline.outputs.workflowInput }}' + moduleTestFilePaths: '${{ needs.job_initialize_pipeline.outputs.moduleTestFilePaths }}' + modulePath: '${{ needs.job_initialize_pipeline.outputs.modulePath}}' + secrets: inherit diff --git a/.github/workflows/ms.containerinstance.containergroups.yml b/.github/workflows/ms.containerinstance.containergroups.yml index 17e7aad458..ab1a0192d7 100644 --- a/.github/workflows/ms.containerinstance.containergroups.yml +++ b/.github/workflows/ms.containerinstance.containergroups.yml @@ -1,4 +1,4 @@ -name: 'ContainerInstance: ContainerGroups' +name: 'ContainerInstance - ContainerGroups' on: workflow_dispatch: @@ -28,6 +28,7 @@ on: - main paths: - '.github/actions/templates/**' + - '.github/workflows/template.module.yml' - '.github/workflows/ms.containerinstance.containergroups.yml' - 'modules/Microsoft.ContainerInstance/containerGroups/**' - 'utilities/pipelines/**' @@ -35,14 +36,8 @@ on: - '!*/**/readme.md' env: - variablesPath: 'settings.yml' modulePath: 'modules/Microsoft.ContainerInstance/containerGroups' workflowPath: '.github/workflows/ms.containerinstance.containergroups.yml' - AZURE_CREDENTIALS: ${{ secrets.AZURE_CREDENTIALS }} - ARM_SUBSCRIPTION_ID: '${{ secrets.ARM_SUBSCRIPTION_ID }}' - ARM_MGMTGROUP_ID: '${{ secrets.ARM_MGMTGROUP_ID }}' - ARM_TENANT_ID: '${{ secrets.ARM_TENANT_ID }}' - TOKEN_NAMEPREFIX: '${{ secrets.TOKEN_NAMEPREFIX }}' concurrency: group: ${{ github.workflow }} @@ -72,94 +67,19 @@ jobs: outputs: workflowInput: ${{ steps.get-workflow-param.outputs.workflowInput }} moduleTestFilePaths: ${{ steps.get-module-test-file-paths.outputs.moduleTestFilePaths }} + modulePath: '${{ env.modulePath }}' - ######################### - # Static validation # - ######################### - job_module_static_validation: - runs-on: ubuntu-20.04 - name: 'Static validation' - if: (fromJson(needs.job_initialize_pipeline.outputs.workflowInput)).staticValidation == 'true' - needs: - - job_initialize_pipeline - steps: - - name: 'Checkout' - uses: actions/checkout@v3 - with: - fetch-depth: 0 - - name: Set environment variables - uses: ./.github/actions/templates/setEnvironmentVariables - with: - variablesPath: ${{ env.variablesPath }} - - name: 'Run tests' - uses: ./.github/actions/templates/validateModulePester - with: - modulePath: '${{ env.modulePath }}' - moduleTestFilePath: '${{ env.moduleTestFilePath }}' - ############################# - # Deployment validation # - ############################# - job_module_deploy_validation: - runs-on: ubuntu-20.04 - name: 'Deploying' - if: | - !cancelled() && - (fromJson(needs.job_initialize_pipeline.outputs.workflowInput)).deploymentValidation == 'true' && - needs.job_module_static_validation.result != 'failure' + ############################## + # Call reusable workflow # + ############################## + call-workflow-passing-data: + name: 'Module' needs: - job_initialize_pipeline - - job_module_static_validation - strategy: - fail-fast: false - matrix: - moduleTestFilePaths: ${{ fromJson(needs.job_initialize_pipeline.outputs.moduleTestFilePaths) }} - steps: - - name: 'Checkout' - uses: actions/checkout@v3 - with: - fetch-depth: 0 - - name: Set environment variables - uses: ./.github/actions/templates/setEnvironmentVariables - with: - variablesPath: ${{ env.variablesPath }} - - name: 'Using test file [${{ matrix.moduleTestFilePaths }}]' - uses: ./.github/actions/templates/validateModuleDeployment - with: - templateFilePath: '${{ env.modulePath }}/${{ matrix.moduleTestFilePaths }}' - location: '${{ env.location }}' - subscriptionId: '${{ secrets.ARM_SUBSCRIPTION_ID }}' - managementGroupId: '${{ secrets.ARM_MGMTGROUP_ID }}' - removeDeployment: '${{ (fromJson(needs.job_initialize_pipeline.outputs.workflowInput)).removeDeployment }}' - - ################## - # Publishing # - ################## - job_publish_module: - name: 'Publishing' - if: github.ref == 'refs/heads/main' || github.ref == 'refs/heads/master' || github.event.inputs.prerelease == 'true' - runs-on: ubuntu-20.04 - needs: - - job_module_deploy_validation - steps: - - name: 'Checkout' - uses: actions/checkout@v3 - with: - fetch-depth: 0 - - name: Set environment variables - uses: ./.github/actions/templates/setEnvironmentVariables - with: - variablesPath: ${{ env.variablesPath }} - - name: 'Publishing' - uses: ./.github/actions/templates/publishModule - with: - templateFilePath: '${{ env.modulePath }}/deploy.bicep' - templateSpecsRGName: '${{ env.templateSpecsRGName }}' - templateSpecsRGLocation: '${{ env.templateSpecsRGLocation }}' - templateSpecsDescription: '${{ env.templateSpecsDescription }}' - templateSpecsDoPublish: '${{ env.templateSpecsDoPublish }}' - bicepRegistryName: '${{ env.bicepRegistryName }}' - bicepRegistryRGName: '${{ env.bicepRegistryRGName }}' - bicepRegistryRgLocation: '${{ env.bicepRegistryRgLocation }}' - bicepRegistryDoPublish: '${{ env.bicepRegistryDoPublish }}' - publishLatest: '${{ env.publishLatest }}' + uses: ./.github/workflows/template.module.yml + with: + workflowInput: '${{ needs.job_initialize_pipeline.outputs.workflowInput }}' + moduleTestFilePaths: '${{ needs.job_initialize_pipeline.outputs.moduleTestFilePaths }}' + modulePath: '${{ needs.job_initialize_pipeline.outputs.modulePath}}' + secrets: inherit diff --git a/.github/workflows/ms.containerregistry.registries.yml b/.github/workflows/ms.containerregistry.registries.yml index f3e1606eab..5dbd853e50 100644 --- a/.github/workflows/ms.containerregistry.registries.yml +++ b/.github/workflows/ms.containerregistry.registries.yml @@ -1,4 +1,4 @@ -name: 'ContainerRegistry: Registries' +name: 'ContainerRegistry - Registries' on: workflow_dispatch: @@ -28,6 +28,7 @@ on: - main paths: - '.github/actions/templates/**' + - '.github/workflows/template.module.yml' - '.github/workflows/ms.containerregistry.registries.yml' - 'modules/Microsoft.ContainerRegistry/registries/**' - 'utilities/pipelines/**' @@ -35,14 +36,8 @@ on: - '!*/**/readme.md' env: - variablesPath: 'settings.yml' modulePath: 'modules/Microsoft.ContainerRegistry/registries' workflowPath: '.github/workflows/ms.containerregistry.registries.yml' - AZURE_CREDENTIALS: ${{ secrets.AZURE_CREDENTIALS }} - ARM_SUBSCRIPTION_ID: '${{ secrets.ARM_SUBSCRIPTION_ID }}' - ARM_MGMTGROUP_ID: '${{ secrets.ARM_MGMTGROUP_ID }}' - ARM_TENANT_ID: '${{ secrets.ARM_TENANT_ID }}' - TOKEN_NAMEPREFIX: '${{ secrets.TOKEN_NAMEPREFIX }}' concurrency: group: ${{ github.workflow }} @@ -72,94 +67,19 @@ jobs: outputs: workflowInput: ${{ steps.get-workflow-param.outputs.workflowInput }} moduleTestFilePaths: ${{ steps.get-module-test-file-paths.outputs.moduleTestFilePaths }} + modulePath: '${{ env.modulePath }}' - ######################### - # Static validation # - ######################### - job_module_static_validation: - runs-on: ubuntu-20.04 - name: 'Static validation' - if: (fromJson(needs.job_initialize_pipeline.outputs.workflowInput)).staticValidation == 'true' - needs: - - job_initialize_pipeline - steps: - - name: 'Checkout' - uses: actions/checkout@v3 - with: - fetch-depth: 0 - - name: Set environment variables - uses: ./.github/actions/templates/setEnvironmentVariables - with: - variablesPath: ${{ env.variablesPath }} - - name: 'Run tests' - uses: ./.github/actions/templates/validateModulePester - with: - modulePath: '${{ env.modulePath }}' - moduleTestFilePath: '${{ env.moduleTestFilePath }}' - ############################# - # Deployment validation # - ############################# - job_module_deploy_validation: - runs-on: ubuntu-20.04 - name: 'Deploying' - if: | - !cancelled() && - (fromJson(needs.job_initialize_pipeline.outputs.workflowInput)).deploymentValidation == 'true' && - needs.job_module_static_validation.result != 'failure' + ############################## + # Call reusable workflow # + ############################## + call-workflow-passing-data: + name: 'Module' needs: - job_initialize_pipeline - - job_module_static_validation - strategy: - fail-fast: false - matrix: - moduleTestFilePaths: ${{ fromJson(needs.job_initialize_pipeline.outputs.moduleTestFilePaths) }} - steps: - - name: 'Checkout' - uses: actions/checkout@v3 - with: - fetch-depth: 0 - - name: Set environment variables - uses: ./.github/actions/templates/setEnvironmentVariables - with: - variablesPath: ${{ env.variablesPath }} - - name: 'Using test file [${{ matrix.moduleTestFilePaths }}]' - uses: ./.github/actions/templates/validateModuleDeployment - with: - templateFilePath: '${{ env.modulePath }}/${{ matrix.moduleTestFilePaths }}' - location: '${{ env.location }}' - subscriptionId: '${{ secrets.ARM_SUBSCRIPTION_ID }}' - managementGroupId: '${{ secrets.ARM_MGMTGROUP_ID }}' - removeDeployment: '${{ (fromJson(needs.job_initialize_pipeline.outputs.workflowInput)).removeDeployment }}' - - ################## - # Publishing # - ################## - job_publish_module: - name: 'Publishing' - if: github.ref == 'refs/heads/main' || github.ref == 'refs/heads/master' || github.event.inputs.prerelease == 'true' - runs-on: ubuntu-20.04 - needs: - - job_module_deploy_validation - steps: - - name: 'Checkout' - uses: actions/checkout@v3 - with: - fetch-depth: 0 - - name: Set environment variables - uses: ./.github/actions/templates/setEnvironmentVariables - with: - variablesPath: ${{ env.variablesPath }} - - name: 'Publishing' - uses: ./.github/actions/templates/publishModule - with: - templateFilePath: '${{ env.modulePath }}/deploy.bicep' - templateSpecsRGName: '${{ env.templateSpecsRGName }}' - templateSpecsRGLocation: '${{ env.templateSpecsRGLocation }}' - templateSpecsDescription: '${{ env.templateSpecsDescription }}' - templateSpecsDoPublish: '${{ env.templateSpecsDoPublish }}' - bicepRegistryName: '${{ env.bicepRegistryName }}' - bicepRegistryRGName: '${{ env.bicepRegistryRGName }}' - bicepRegistryRgLocation: '${{ env.bicepRegistryRgLocation }}' - bicepRegistryDoPublish: '${{ env.bicepRegistryDoPublish }}' - publishLatest: '${{ env.publishLatest }}' + uses: ./.github/workflows/template.module.yml + with: + workflowInput: '${{ needs.job_initialize_pipeline.outputs.workflowInput }}' + moduleTestFilePaths: '${{ needs.job_initialize_pipeline.outputs.moduleTestFilePaths }}' + modulePath: '${{ needs.job_initialize_pipeline.outputs.modulePath}}' + secrets: inherit diff --git a/.github/workflows/ms.containerservice.managedclusters.yml b/.github/workflows/ms.containerservice.managedclusters.yml index f49922f390..e01dfa2f17 100644 --- a/.github/workflows/ms.containerservice.managedclusters.yml +++ b/.github/workflows/ms.containerservice.managedclusters.yml @@ -1,4 +1,4 @@ -name: 'ContainerService: ManagedClusters' +name: 'ContainerService - ManagedClusters' on: workflow_dispatch: @@ -28,6 +28,7 @@ on: - main paths: - '.github/actions/templates/**' + - '.github/workflows/template.module.yml' - '.github/workflows/ms.containerservice.managedclusters.yml' - 'modules/Microsoft.ContainerService/managedClusters/**' - 'utilities/pipelines/**' @@ -35,14 +36,8 @@ on: - '!*/**/readme.md' env: - variablesPath: 'settings.yml' modulePath: 'modules/Microsoft.ContainerService/managedClusters' workflowPath: '.github/workflows/ms.containerservice.managedclusters.yml' - AZURE_CREDENTIALS: ${{ secrets.AZURE_CREDENTIALS }} - ARM_SUBSCRIPTION_ID: '${{ secrets.ARM_SUBSCRIPTION_ID }}' - ARM_MGMTGROUP_ID: '${{ secrets.ARM_MGMTGROUP_ID }}' - ARM_TENANT_ID: '${{ secrets.ARM_TENANT_ID }}' - TOKEN_NAMEPREFIX: '${{ secrets.TOKEN_NAMEPREFIX }}' concurrency: group: ${{ github.workflow }} @@ -72,94 +67,19 @@ jobs: outputs: workflowInput: ${{ steps.get-workflow-param.outputs.workflowInput }} moduleTestFilePaths: ${{ steps.get-module-test-file-paths.outputs.moduleTestFilePaths }} + modulePath: '${{ env.modulePath }}' - ######################### - # Static validation # - ######################### - job_module_static_validation: - runs-on: ubuntu-20.04 - name: 'Static validation' - if: (fromJson(needs.job_initialize_pipeline.outputs.workflowInput)).staticValidation == 'true' - needs: - - job_initialize_pipeline - steps: - - name: 'Checkout' - uses: actions/checkout@v3 - with: - fetch-depth: 0 - - name: Set environment variables - uses: ./.github/actions/templates/setEnvironmentVariables - with: - variablesPath: ${{ env.variablesPath }} - - name: 'Run tests' - uses: ./.github/actions/templates/validateModulePester - with: - modulePath: '${{ env.modulePath }}' - moduleTestFilePath: '${{ env.moduleTestFilePath }}' - ############################# - # Deployment validation # - ############################# - job_module_deploy_validation: - runs-on: ubuntu-20.04 - name: 'Deploying' - if: | - !cancelled() && - (fromJson(needs.job_initialize_pipeline.outputs.workflowInput)).deploymentValidation == 'true' && - needs.job_module_static_validation.result != 'failure' + ############################## + # Call reusable workflow # + ############################## + call-workflow-passing-data: + name: 'Module' needs: - job_initialize_pipeline - - job_module_static_validation - strategy: - fail-fast: false - matrix: - moduleTestFilePaths: ${{ fromJson(needs.job_initialize_pipeline.outputs.moduleTestFilePaths) }} - steps: - - name: 'Checkout' - uses: actions/checkout@v3 - with: - fetch-depth: 0 - - name: Set environment variables - uses: ./.github/actions/templates/setEnvironmentVariables - with: - variablesPath: ${{ env.variablesPath }} - - name: 'Using test file [${{ matrix.moduleTestFilePaths }}]' - uses: ./.github/actions/templates/validateModuleDeployment - with: - templateFilePath: '${{ env.modulePath }}/${{ matrix.moduleTestFilePaths }}' - location: '${{ env.location }}' - subscriptionId: '${{ secrets.ARM_SUBSCRIPTION_ID }}' - managementGroupId: '${{ secrets.ARM_MGMTGROUP_ID }}' - removeDeployment: '${{ (fromJson(needs.job_initialize_pipeline.outputs.workflowInput)).removeDeployment }}' - - ################## - # Publishing # - ################## - job_publish_module: - name: 'Publishing' - if: github.ref == 'refs/heads/main' || github.ref == 'refs/heads/master' || github.event.inputs.prerelease == 'true' - runs-on: ubuntu-20.04 - needs: - - job_module_deploy_validation - steps: - - name: 'Checkout' - uses: actions/checkout@v3 - with: - fetch-depth: 0 - - name: Set environment variables - uses: ./.github/actions/templates/setEnvironmentVariables - with: - variablesPath: ${{ env.variablesPath }} - - name: 'Publishing' - uses: ./.github/actions/templates/publishModule - with: - templateFilePath: '${{ env.modulePath }}/deploy.bicep' - templateSpecsRGName: '${{ env.templateSpecsRGName }}' - templateSpecsRGLocation: '${{ env.templateSpecsRGLocation }}' - templateSpecsDescription: '${{ env.templateSpecsDescription }}' - templateSpecsDoPublish: '${{ env.templateSpecsDoPublish }}' - bicepRegistryName: '${{ env.bicepRegistryName }}' - bicepRegistryRGName: '${{ env.bicepRegistryRGName }}' - bicepRegistryRgLocation: '${{ env.bicepRegistryRgLocation }}' - bicepRegistryDoPublish: '${{ env.bicepRegistryDoPublish }}' - publishLatest: '${{ env.publishLatest }}' + uses: ./.github/workflows/template.module.yml + with: + workflowInput: '${{ needs.job_initialize_pipeline.outputs.workflowInput }}' + moduleTestFilePaths: '${{ needs.job_initialize_pipeline.outputs.moduleTestFilePaths }}' + modulePath: '${{ needs.job_initialize_pipeline.outputs.modulePath}}' + secrets: inherit diff --git a/.github/workflows/ms.databricks.workspaces.yml b/.github/workflows/ms.databricks.workspaces.yml index d913271851..77c3c99a51 100644 --- a/.github/workflows/ms.databricks.workspaces.yml +++ b/.github/workflows/ms.databricks.workspaces.yml @@ -1,4 +1,4 @@ -name: 'Databricks: Workspaces' +name: 'Databricks - Workspaces' on: workflow_dispatch: @@ -28,6 +28,7 @@ on: - main paths: - '.github/actions/templates/**' + - '.github/workflows/template.module.yml' - '.github/workflows/ms.databricks.workspaces.yml' - 'modules/Microsoft.Databricks/workspaces/**' - 'utilities/pipelines/**' @@ -35,14 +36,8 @@ on: - '!*/**/readme.md' env: - variablesPath: 'settings.yml' modulePath: 'modules/Microsoft.Databricks/workspaces' workflowPath: '.github/workflows/ms.databricks.workspaces.yml' - AZURE_CREDENTIALS: ${{ secrets.AZURE_CREDENTIALS }} - ARM_SUBSCRIPTION_ID: '${{ secrets.ARM_SUBSCRIPTION_ID }}' - ARM_MGMTGROUP_ID: '${{ secrets.ARM_MGMTGROUP_ID }}' - ARM_TENANT_ID: '${{ secrets.ARM_TENANT_ID }}' - TOKEN_NAMEPREFIX: '${{ secrets.TOKEN_NAMEPREFIX }}' concurrency: group: ${{ github.workflow }} @@ -72,94 +67,19 @@ jobs: outputs: workflowInput: ${{ steps.get-workflow-param.outputs.workflowInput }} moduleTestFilePaths: ${{ steps.get-module-test-file-paths.outputs.moduleTestFilePaths }} + modulePath: '${{ env.modulePath }}' - ######################### - # Static validation # - ######################### - job_module_static_validation: - runs-on: ubuntu-20.04 - name: 'Static validation' - if: (fromJson(needs.job_initialize_pipeline.outputs.workflowInput)).staticValidation == 'true' - needs: - - job_initialize_pipeline - steps: - - name: 'Checkout' - uses: actions/checkout@v3 - with: - fetch-depth: 0 - - name: Set environment variables - uses: ./.github/actions/templates/setEnvironmentVariables - with: - variablesPath: ${{ env.variablesPath }} - - name: 'Run tests' - uses: ./.github/actions/templates/validateModulePester - with: - modulePath: '${{ env.modulePath }}' - moduleTestFilePath: '${{ env.moduleTestFilePath }}' - ############################# - # Deployment validation # - ############################# - job_module_deploy_validation: - runs-on: ubuntu-20.04 - name: 'Deploying' - if: | - !cancelled() && - (fromJson(needs.job_initialize_pipeline.outputs.workflowInput)).deploymentValidation == 'true' && - needs.job_module_static_validation.result != 'failure' + ############################## + # Call reusable workflow # + ############################## + call-workflow-passing-data: + name: 'Module' needs: - job_initialize_pipeline - - job_module_static_validation - strategy: - fail-fast: false - matrix: - moduleTestFilePaths: ${{ fromJson(needs.job_initialize_pipeline.outputs.moduleTestFilePaths) }} - steps: - - name: 'Checkout' - uses: actions/checkout@v3 - with: - fetch-depth: 0 - - name: Set environment variables - uses: ./.github/actions/templates/setEnvironmentVariables - with: - variablesPath: ${{ env.variablesPath }} - - name: 'Using test file [${{ matrix.moduleTestFilePaths }}]' - uses: ./.github/actions/templates/validateModuleDeployment - with: - templateFilePath: '${{ env.modulePath }}/${{ matrix.moduleTestFilePaths }}' - location: '${{ env.location }}' - subscriptionId: '${{ secrets.ARM_SUBSCRIPTION_ID }}' - managementGroupId: '${{ secrets.ARM_MGMTGROUP_ID }}' - removeDeployment: '${{ (fromJson(needs.job_initialize_pipeline.outputs.workflowInput)).removeDeployment }}' - - ################## - # Publishing # - ################## - job_publish_module: - name: 'Publishing' - if: github.ref == 'refs/heads/main' || github.ref == 'refs/heads/master' || github.event.inputs.prerelease == 'true' - runs-on: ubuntu-20.04 - needs: - - job_module_deploy_validation - steps: - - name: 'Checkout' - uses: actions/checkout@v3 - with: - fetch-depth: 0 - - name: Set environment variables - uses: ./.github/actions/templates/setEnvironmentVariables - with: - variablesPath: ${{ env.variablesPath }} - - name: 'Publishing' - uses: ./.github/actions/templates/publishModule - with: - templateFilePath: '${{ env.modulePath }}/deploy.bicep' - templateSpecsRGName: '${{ env.templateSpecsRGName }}' - templateSpecsRGLocation: '${{ env.templateSpecsRGLocation }}' - templateSpecsDescription: '${{ env.templateSpecsDescription }}' - templateSpecsDoPublish: '${{ env.templateSpecsDoPublish }}' - bicepRegistryName: '${{ env.bicepRegistryName }}' - bicepRegistryRGName: '${{ env.bicepRegistryRGName }}' - bicepRegistryRgLocation: '${{ env.bicepRegistryRgLocation }}' - bicepRegistryDoPublish: '${{ env.bicepRegistryDoPublish }}' - publishLatest: '${{ env.publishLatest }}' + uses: ./.github/workflows/template.module.yml + with: + workflowInput: '${{ needs.job_initialize_pipeline.outputs.workflowInput }}' + moduleTestFilePaths: '${{ needs.job_initialize_pipeline.outputs.moduleTestFilePaths }}' + modulePath: '${{ needs.job_initialize_pipeline.outputs.modulePath}}' + secrets: inherit diff --git a/.github/workflows/ms.datafactory.factories.yml b/.github/workflows/ms.datafactory.factories.yml index a441d34a4c..e4e984c873 100644 --- a/.github/workflows/ms.datafactory.factories.yml +++ b/.github/workflows/ms.datafactory.factories.yml @@ -1,4 +1,4 @@ -name: 'DataFactory: Factories' +name: 'DataFactory - Factories' on: workflow_dispatch: @@ -28,6 +28,7 @@ on: - main paths: - '.github/actions/templates/**' + - '.github/workflows/template.module.yml' - '.github/workflows/ms.datafactory.factories.yml' - 'modules/Microsoft.DataFactory/factories/**' - 'utilities/pipelines/**' @@ -35,14 +36,8 @@ on: - '!*/**/readme.md' env: - variablesPath: 'settings.yml' modulePath: 'modules/Microsoft.DataFactory/factories' workflowPath: '.github/workflows/ms.datafactory.factories.yml' - AZURE_CREDENTIALS: ${{ secrets.AZURE_CREDENTIALS }} - ARM_SUBSCRIPTION_ID: '${{ secrets.ARM_SUBSCRIPTION_ID }}' - ARM_MGMTGROUP_ID: '${{ secrets.ARM_MGMTGROUP_ID }}' - ARM_TENANT_ID: '${{ secrets.ARM_TENANT_ID }}' - TOKEN_NAMEPREFIX: '${{ secrets.TOKEN_NAMEPREFIX }}' concurrency: group: ${{ github.workflow }} @@ -72,94 +67,19 @@ jobs: outputs: workflowInput: ${{ steps.get-workflow-param.outputs.workflowInput }} moduleTestFilePaths: ${{ steps.get-module-test-file-paths.outputs.moduleTestFilePaths }} + modulePath: '${{ env.modulePath }}' - ######################### - # Static validation # - ######################### - job_module_static_validation: - runs-on: ubuntu-20.04 - name: 'Static validation' - if: (fromJson(needs.job_initialize_pipeline.outputs.workflowInput)).staticValidation == 'true' - needs: - - job_initialize_pipeline - steps: - - name: 'Checkout' - uses: actions/checkout@v3 - with: - fetch-depth: 0 - - name: Set environment variables - uses: ./.github/actions/templates/setEnvironmentVariables - with: - variablesPath: ${{ env.variablesPath }} - - name: 'Run tests' - uses: ./.github/actions/templates/validateModulePester - with: - modulePath: '${{ env.modulePath }}' - moduleTestFilePath: '${{ env.moduleTestFilePath }}' - ############################# - # Deployment validation # - ############################# - job_module_deploy_validation: - runs-on: ubuntu-20.04 - name: 'Deploying' - if: | - !cancelled() && - (fromJson(needs.job_initialize_pipeline.outputs.workflowInput)).deploymentValidation == 'true' && - needs.job_module_static_validation.result != 'failure' + ############################## + # Call reusable workflow # + ############################## + call-workflow-passing-data: + name: 'Module' needs: - job_initialize_pipeline - - job_module_static_validation - strategy: - fail-fast: false - matrix: - moduleTestFilePaths: ${{ fromJson(needs.job_initialize_pipeline.outputs.moduleTestFilePaths) }} - steps: - - name: 'Checkout' - uses: actions/checkout@v3 - with: - fetch-depth: 0 - - name: Set environment variables - uses: ./.github/actions/templates/setEnvironmentVariables - with: - variablesPath: ${{ env.variablesPath }} - - name: 'Using test file [${{ matrix.moduleTestFilePaths }}]' - uses: ./.github/actions/templates/validateModuleDeployment - with: - templateFilePath: '${{ env.modulePath }}/${{ matrix.moduleTestFilePaths }}' - location: '${{ env.location }}' - subscriptionId: '${{ secrets.ARM_SUBSCRIPTION_ID }}' - managementGroupId: '${{ secrets.ARM_MGMTGROUP_ID }}' - removeDeployment: '${{ (fromJson(needs.job_initialize_pipeline.outputs.workflowInput)).removeDeployment }}' - - ################## - # Publishing # - ################## - job_publish_module: - name: 'Publishing' - if: github.ref == 'refs/heads/main' || github.ref == 'refs/heads/master' || github.event.inputs.prerelease == 'true' - runs-on: ubuntu-20.04 - needs: - - job_module_deploy_validation - steps: - - name: 'Checkout' - uses: actions/checkout@v3 - with: - fetch-depth: 0 - - name: Set environment variables - uses: ./.github/actions/templates/setEnvironmentVariables - with: - variablesPath: ${{ env.variablesPath }} - - name: 'Publishing' - uses: ./.github/actions/templates/publishModule - with: - templateFilePath: '${{ env.modulePath }}/deploy.bicep' - templateSpecsRGName: '${{ env.templateSpecsRGName }}' - templateSpecsRGLocation: '${{ env.templateSpecsRGLocation }}' - templateSpecsDescription: '${{ env.templateSpecsDescription }}' - templateSpecsDoPublish: '${{ env.templateSpecsDoPublish }}' - bicepRegistryName: '${{ env.bicepRegistryName }}' - bicepRegistryRGName: '${{ env.bicepRegistryRGName }}' - bicepRegistryRgLocation: '${{ env.bicepRegistryRgLocation }}' - bicepRegistryDoPublish: '${{ env.bicepRegistryDoPublish }}' - publishLatest: '${{ env.publishLatest }}' + uses: ./.github/workflows/template.module.yml + with: + workflowInput: '${{ needs.job_initialize_pipeline.outputs.workflowInput }}' + moduleTestFilePaths: '${{ needs.job_initialize_pipeline.outputs.moduleTestFilePaths }}' + modulePath: '${{ needs.job_initialize_pipeline.outputs.modulePath}}' + secrets: inherit diff --git a/.github/workflows/ms.dataprotection.backupvaults.yml b/.github/workflows/ms.dataprotection.backupvaults.yml index 68d5ff7a70..3de30e7b85 100644 --- a/.github/workflows/ms.dataprotection.backupvaults.yml +++ b/.github/workflows/ms.dataprotection.backupvaults.yml @@ -1,4 +1,4 @@ -name: 'DataProtection: BackupVaults' +name: 'DataProtection - BackupVaults' on: workflow_dispatch: @@ -28,6 +28,7 @@ on: - main paths: - '.github/actions/templates/**' + - '.github/workflows/template.module.yml' - '.github/workflows/ms.dataprotection.backupvaults.yml' - 'modules/Microsoft.DataProtection/backupVaults/**' - 'utilities/pipelines/**' @@ -35,14 +36,8 @@ on: - '!*/**/readme.md' env: - variablesPath: 'settings.yml' modulePath: 'modules/Microsoft.DataProtection/backupVaults' workflowPath: '.github/workflows/ms.dataprotection.backupvaults.yml' - AZURE_CREDENTIALS: ${{ secrets.AZURE_CREDENTIALS }} - ARM_SUBSCRIPTION_ID: '${{ secrets.ARM_SUBSCRIPTION_ID }}' - ARM_MGMTGROUP_ID: '${{ secrets.ARM_MGMTGROUP_ID }}' - ARM_TENANT_ID: '${{ secrets.ARM_TENANT_ID }}' - TOKEN_NAMEPREFIX: '${{ secrets.TOKEN_NAMEPREFIX }}' concurrency: group: ${{ github.workflow }} @@ -72,94 +67,19 @@ jobs: outputs: workflowInput: ${{ steps.get-workflow-param.outputs.workflowInput }} moduleTestFilePaths: ${{ steps.get-module-test-file-paths.outputs.moduleTestFilePaths }} + modulePath: '${{ env.modulePath }}' - ######################### - # Static validation # - ######################### - job_module_static_validation: - runs-on: ubuntu-20.04 - name: 'Static validation' - if: (fromJson(needs.job_initialize_pipeline.outputs.workflowInput)).staticValidation == 'true' - needs: - - job_initialize_pipeline - steps: - - name: 'Checkout' - uses: actions/checkout@v3 - with: - fetch-depth: 0 - - name: Set environment variables - uses: ./.github/actions/templates/setEnvironmentVariables - with: - variablesPath: ${{ env.variablesPath }} - - name: 'Run tests' - uses: ./.github/actions/templates/validateModulePester - with: - modulePath: '${{ env.modulePath }}' - moduleTestFilePath: '${{ env.moduleTestFilePath }}' - ############################# - # Deployment validation # - ############################# - job_module_deploy_validation: - runs-on: ubuntu-20.04 - name: 'Deploying' - if: | - !cancelled() && - (fromJson(needs.job_initialize_pipeline.outputs.workflowInput)).deploymentValidation == 'true' && - needs.job_module_static_validation.result != 'failure' + ############################## + # Call reusable workflow # + ############################## + call-workflow-passing-data: + name: 'Module' needs: - job_initialize_pipeline - - job_module_static_validation - strategy: - fail-fast: false - matrix: - moduleTestFilePaths: ${{ fromJson(needs.job_initialize_pipeline.outputs.moduleTestFilePaths) }} - steps: - - name: 'Checkout' - uses: actions/checkout@v3 - with: - fetch-depth: 0 - - name: Set environment variables - uses: ./.github/actions/templates/setEnvironmentVariables - with: - variablesPath: ${{ env.variablesPath }} - - name: 'Using test file [${{ matrix.moduleTestFilePaths }}]' - uses: ./.github/actions/templates/validateModuleDeployment - with: - templateFilePath: '${{ env.modulePath }}/${{ matrix.moduleTestFilePaths }}' - location: '${{ env.location }}' - subscriptionId: '${{ secrets.ARM_SUBSCRIPTION_ID }}' - managementGroupId: '${{ secrets.ARM_MGMTGROUP_ID }}' - removeDeployment: '${{ (fromJson(needs.job_initialize_pipeline.outputs.workflowInput)).removeDeployment }}' - - ################## - # Publishing # - ################## - job_publish_module: - name: 'Publishing' - if: github.ref == 'refs/heads/main' || github.ref == 'refs/heads/master' || github.event.inputs.prerelease == 'true' - runs-on: ubuntu-20.04 - needs: - - job_module_deploy_validation - steps: - - name: 'Checkout' - uses: actions/checkout@v3 - with: - fetch-depth: 0 - - name: Set environment variables - uses: ./.github/actions/templates/setEnvironmentVariables - with: - variablesPath: ${{ env.variablesPath }} - - name: 'Publishing' - uses: ./.github/actions/templates/publishModule - with: - templateFilePath: '${{ env.modulePath }}/deploy.bicep' - templateSpecsRGName: '${{ env.templateSpecsRGName }}' - templateSpecsRGLocation: '${{ env.templateSpecsRGLocation }}' - templateSpecsDescription: '${{ env.templateSpecsDescription }}' - templateSpecsDoPublish: '${{ env.templateSpecsDoPublish }}' - bicepRegistryName: '${{ env.bicepRegistryName }}' - bicepRegistryRGName: '${{ env.bicepRegistryRGName }}' - bicepRegistryRgLocation: '${{ env.bicepRegistryRgLocation }}' - bicepRegistryDoPublish: '${{ env.bicepRegistryDoPublish }}' - publishLatest: '${{ env.publishLatest }}' + uses: ./.github/workflows/template.module.yml + with: + workflowInput: '${{ needs.job_initialize_pipeline.outputs.workflowInput }}' + moduleTestFilePaths: '${{ needs.job_initialize_pipeline.outputs.moduleTestFilePaths }}' + modulePath: '${{ needs.job_initialize_pipeline.outputs.modulePath}}' + secrets: inherit diff --git a/.github/workflows/ms.dbforpostgresql.flexibleservers.yml b/.github/workflows/ms.dbforpostgresql.flexibleservers.yml index e655b37c7b..5be1cc433d 100644 --- a/.github/workflows/ms.dbforpostgresql.flexibleservers.yml +++ b/.github/workflows/ms.dbforpostgresql.flexibleservers.yml @@ -1,4 +1,4 @@ -name: 'DbForPostgreSQL: FlexibleServers' +name: 'DbForPostgreSQL - FlexibleServers' on: workflow_dispatch: @@ -28,6 +28,7 @@ on: - main paths: - '.github/actions/templates/**' + - '.github/workflows/template.module.yml' - '.github/workflows/ms.dbforpostgresql.flexibleservers.yml' - 'modules/Microsoft.DBforPostgreSQL/flexibleServers/**' - 'utilities/pipelines/**' @@ -35,14 +36,8 @@ on: - '!*/**/readme.md' env: - variablesPath: 'settings.yml' modulePath: 'modules/Microsoft.DBforPostgreSQL/flexibleServers' workflowPath: '.github/workflows/ms.dbforpostgresql.flexibleservers.yml' - AZURE_CREDENTIALS: ${{ secrets.AZURE_CREDENTIALS }} - ARM_SUBSCRIPTION_ID: '${{ secrets.ARM_SUBSCRIPTION_ID }}' - ARM_MGMTGROUP_ID: '${{ secrets.ARM_MGMTGROUP_ID }}' - ARM_TENANT_ID: '${{ secrets.ARM_TENANT_ID }}' - TOKEN_NAMEPREFIX: '${{ secrets.TOKEN_NAMEPREFIX }}' concurrency: group: ${{ github.workflow }} @@ -72,97 +67,19 @@ jobs: outputs: workflowInput: ${{ steps.get-workflow-param.outputs.workflowInput }} moduleTestFilePaths: ${{ steps.get-module-test-file-paths.outputs.moduleTestFilePaths }} + modulePath: '${{ env.modulePath }}' - ######################### - # Static validation # - ######################### - job_module_static_validation: - runs-on: ubuntu-20.04 - name: 'Static validation' - if: (fromJson(needs.job_initialize_pipeline.outputs.workflowInput)).staticValidation == 'true' - needs: - - job_initialize_pipeline - steps: - - name: 'Checkout' - uses: actions/checkout@v3 - with: - fetch-depth: 0 - - name: Set environment variables - uses: ./.github/actions/templates/setEnvironmentVariables - with: - variablesPath: ${{ env.variablesPath }} - - name: 'Run tests' - uses: ./.github/actions/templates/validateModulePester - with: - modulePath: '${{ env.modulePath }}' - moduleTestFilePath: '${{ env.moduleTestFilePath }}' - ############################# - # Deployment validation # - ############################# - job_module_deploy_validation: - runs-on: ubuntu-20.04 - name: 'Deploying' - if: | - !cancelled() && - (fromJson(needs.job_initialize_pipeline.outputs.workflowInput)).deploymentValidation == 'true' && - needs.job_module_static_validation.result != 'failure' + ############################## + # Call reusable workflow # + ############################## + call-workflow-passing-data: + name: 'Module' needs: - job_initialize_pipeline - - job_module_static_validation - strategy: - fail-fast: false - matrix: - moduleTestFilePaths: ${{ fromJson(needs.job_initialize_pipeline.outputs.moduleTestFilePaths) }} - steps: - - name: 'Checkout' - uses: actions/checkout@v3 - with: - fetch-depth: 0 - - name: Set environment variables - uses: ./.github/actions/templates/setEnvironmentVariables - with: - variablesPath: ${{ env.variablesPath }} - # ------------------- # - ## Deploy & Remove ## - # ------------------- # - - name: 'Using test file [${{ matrix.moduleTestFilePaths }}]' - uses: ./.github/actions/templates/validateModuleDeployment - with: - templateFilePath: '${{ env.modulePath }}/${{ matrix.moduleTestFilePaths }}' - location: '${{ env.location }}' - subscriptionId: '${{ secrets.ARM_SUBSCRIPTION_ID }}' - managementGroupId: '${{ secrets.ARM_MGMTGROUP_ID }}' - removeDeployment: '${{ (fromJson(needs.job_initialize_pipeline.outputs.workflowInput)).removeDeployment }}' - - ################## - # Publishing # - ################## - job_publish_module: - name: 'Publishing' - if: github.ref == 'refs/heads/main' || github.ref == 'refs/heads/master' || github.event.inputs.prerelease == 'true' - runs-on: ubuntu-20.04 - needs: - - job_module_deploy_validation - steps: - - name: 'Checkout' - uses: actions/checkout@v3 - with: - fetch-depth: 0 - - name: Set environment variables - uses: ./.github/actions/templates/setEnvironmentVariables - with: - variablesPath: ${{ env.variablesPath }} - - name: 'Publishing' - uses: ./.github/actions/templates/publishModule - with: - templateFilePath: '${{ env.modulePath }}/deploy.bicep' - templateSpecsRGName: '${{ env.templateSpecsRGName }}' - templateSpecsRGLocation: '${{ env.templateSpecsRGLocation }}' - templateSpecsDescription: '${{ env.templateSpecsDescription }}' - templateSpecsDoPublish: '${{ env.templateSpecsDoPublish }}' - bicepRegistryName: '${{ env.bicepRegistryName }}' - bicepRegistryRGName: '${{ env.bicepRegistryRGName }}' - bicepRegistryRgLocation: '${{ env.bicepRegistryRgLocation }}' - bicepRegistryDoPublish: '${{ env.bicepRegistryDoPublish }}' - publishLatest: '${{ env.publishLatest }}' + uses: ./.github/workflows/template.module.yml + with: + workflowInput: '${{ needs.job_initialize_pipeline.outputs.workflowInput }}' + moduleTestFilePaths: '${{ needs.job_initialize_pipeline.outputs.moduleTestFilePaths }}' + modulePath: '${{ needs.job_initialize_pipeline.outputs.modulePath}}' + secrets: inherit diff --git a/.github/workflows/ms.desktopvirtualization.applicationgroups.yml b/.github/workflows/ms.desktopvirtualization.applicationgroups.yml index dc187c8238..2dccdbaf7d 100644 --- a/.github/workflows/ms.desktopvirtualization.applicationgroups.yml +++ b/.github/workflows/ms.desktopvirtualization.applicationgroups.yml @@ -1,4 +1,4 @@ -name: 'DesktopVirtualization: ApplicationGroups' +name: 'DesktopVirtualization - ApplicationGroups' on: workflow_dispatch: @@ -28,6 +28,7 @@ on: - main paths: - '.github/actions/templates/**' + - '.github/workflows/template.module.yml' - '.github/workflows/ms.desktopvirtualization.applicationgroups.yml' - 'modules/Microsoft.DesktopVirtualization/applicationgroups/**' - 'utilities/pipelines/**' @@ -35,14 +36,8 @@ on: - '!*/**/readme.md' env: - variablesPath: 'settings.yml' modulePath: 'modules/Microsoft.DesktopVirtualization/applicationgroups' workflowPath: '.github/workflows/ms.desktopvirtualization.applicationgroups.yml' - AZURE_CREDENTIALS: ${{ secrets.AZURE_CREDENTIALS }} - ARM_SUBSCRIPTION_ID: '${{ secrets.ARM_SUBSCRIPTION_ID }}' - ARM_MGMTGROUP_ID: '${{ secrets.ARM_MGMTGROUP_ID }}' - ARM_TENANT_ID: '${{ secrets.ARM_TENANT_ID }}' - TOKEN_NAMEPREFIX: '${{ secrets.TOKEN_NAMEPREFIX }}' concurrency: group: ${{ github.workflow }} @@ -72,94 +67,19 @@ jobs: outputs: workflowInput: ${{ steps.get-workflow-param.outputs.workflowInput }} moduleTestFilePaths: ${{ steps.get-module-test-file-paths.outputs.moduleTestFilePaths }} + modulePath: '${{ env.modulePath }}' - ######################### - # Static validation # - ######################### - job_module_static_validation: - runs-on: ubuntu-20.04 - name: 'Static validation' - if: (fromJson(needs.job_initialize_pipeline.outputs.workflowInput)).staticValidation == 'true' - needs: - - job_initialize_pipeline - steps: - - name: 'Checkout' - uses: actions/checkout@v3 - with: - fetch-depth: 0 - - name: Set environment variables - uses: ./.github/actions/templates/setEnvironmentVariables - with: - variablesPath: ${{ env.variablesPath }} - - name: 'Run tests' - uses: ./.github/actions/templates/validateModulePester - with: - modulePath: '${{ env.modulePath }}' - moduleTestFilePath: '${{ env.moduleTestFilePath }}' - ############################# - # Deployment validation # - ############################# - job_module_deploy_validation: - runs-on: ubuntu-20.04 - name: 'Deploying' - if: | - !cancelled() && - (fromJson(needs.job_initialize_pipeline.outputs.workflowInput)).deploymentValidation == 'true' && - needs.job_module_static_validation.result != 'failure' + ############################## + # Call reusable workflow # + ############################## + call-workflow-passing-data: + name: 'Module' needs: - job_initialize_pipeline - - job_module_static_validation - strategy: - fail-fast: false - matrix: - moduleTestFilePaths: ${{ fromJson(needs.job_initialize_pipeline.outputs.moduleTestFilePaths) }} - steps: - - name: 'Checkout' - uses: actions/checkout@v3 - with: - fetch-depth: 0 - - name: Set environment variables - uses: ./.github/actions/templates/setEnvironmentVariables - with: - variablesPath: ${{ env.variablesPath }} - - name: 'Using test file [${{ matrix.moduleTestFilePaths }}]' - uses: ./.github/actions/templates/validateModuleDeployment - with: - templateFilePath: '${{ env.modulePath }}/${{ matrix.moduleTestFilePaths }}' - location: '${{ env.location }}' - subscriptionId: '${{ secrets.ARM_SUBSCRIPTION_ID }}' - managementGroupId: '${{ secrets.ARM_MGMTGROUP_ID }}' - removeDeployment: '${{ (fromJson(needs.job_initialize_pipeline.outputs.workflowInput)).removeDeployment }}' - - ################## - # Publishing # - ################## - job_publish_module: - name: 'Publishing' - if: github.ref == 'refs/heads/main' || github.ref == 'refs/heads/master' || github.event.inputs.prerelease == 'true' - runs-on: ubuntu-20.04 - needs: - - job_module_deploy_validation - steps: - - name: 'Checkout' - uses: actions/checkout@v3 - with: - fetch-depth: 0 - - name: Set environment variables - uses: ./.github/actions/templates/setEnvironmentVariables - with: - variablesPath: ${{ env.variablesPath }} - - name: 'Publishing' - uses: ./.github/actions/templates/publishModule - with: - templateFilePath: '${{ env.modulePath }}/deploy.bicep' - templateSpecsRGName: '${{ env.templateSpecsRGName }}' - templateSpecsRGLocation: '${{ env.templateSpecsRGLocation }}' - templateSpecsDescription: '${{ env.templateSpecsDescription }}' - templateSpecsDoPublish: '${{ env.templateSpecsDoPublish }}' - bicepRegistryName: '${{ env.bicepRegistryName }}' - bicepRegistryRGName: '${{ env.bicepRegistryRGName }}' - bicepRegistryRgLocation: '${{ env.bicepRegistryRgLocation }}' - bicepRegistryDoPublish: '${{ env.bicepRegistryDoPublish }}' - publishLatest: '${{ env.publishLatest }}' + uses: ./.github/workflows/template.module.yml + with: + workflowInput: '${{ needs.job_initialize_pipeline.outputs.workflowInput }}' + moduleTestFilePaths: '${{ needs.job_initialize_pipeline.outputs.moduleTestFilePaths }}' + modulePath: '${{ needs.job_initialize_pipeline.outputs.modulePath}}' + secrets: inherit diff --git a/.github/workflows/ms.desktopvirtualization.hostpools.yml b/.github/workflows/ms.desktopvirtualization.hostpools.yml index b168568567..85fc27726b 100644 --- a/.github/workflows/ms.desktopvirtualization.hostpools.yml +++ b/.github/workflows/ms.desktopvirtualization.hostpools.yml @@ -1,4 +1,4 @@ -name: 'DesktopVirtualization: HostPools' +name: 'DesktopVirtualization - HostPools' on: workflow_dispatch: @@ -28,6 +28,7 @@ on: - main paths: - '.github/actions/templates/**' + - '.github/workflows/template.module.yml' - '.github/workflows/ms.desktopvirtualization.hostpools.yml' - 'modules/Microsoft.DesktopVirtualization/hostpools/**' - 'utilities/pipelines/**' @@ -35,14 +36,8 @@ on: - '!*/**/readme.md' env: - variablesPath: 'settings.yml' modulePath: 'modules/Microsoft.DesktopVirtualization/hostpools' workflowPath: '.github/workflows/ms.desktopvirtualization.hostpools.yml' - AZURE_CREDENTIALS: ${{ secrets.AZURE_CREDENTIALS }} - ARM_SUBSCRIPTION_ID: '${{ secrets.ARM_SUBSCRIPTION_ID }}' - ARM_MGMTGROUP_ID: '${{ secrets.ARM_MGMTGROUP_ID }}' - ARM_TENANT_ID: '${{ secrets.ARM_TENANT_ID }}' - TOKEN_NAMEPREFIX: '${{ secrets.TOKEN_NAMEPREFIX }}' concurrency: group: ${{ github.workflow }} @@ -72,94 +67,19 @@ jobs: outputs: workflowInput: ${{ steps.get-workflow-param.outputs.workflowInput }} moduleTestFilePaths: ${{ steps.get-module-test-file-paths.outputs.moduleTestFilePaths }} + modulePath: '${{ env.modulePath }}' - ######################### - # Static validation # - ######################### - job_module_static_validation: - runs-on: ubuntu-20.04 - name: 'Static validation' - if: (fromJson(needs.job_initialize_pipeline.outputs.workflowInput)).staticValidation == 'true' - needs: - - job_initialize_pipeline - steps: - - name: 'Checkout' - uses: actions/checkout@v3 - with: - fetch-depth: 0 - - name: Set environment variables - uses: ./.github/actions/templates/setEnvironmentVariables - with: - variablesPath: ${{ env.variablesPath }} - - name: 'Run tests' - uses: ./.github/actions/templates/validateModulePester - with: - modulePath: '${{ env.modulePath }}' - moduleTestFilePath: '${{ env.moduleTestFilePath }}' - ############################# - # Deployment validation # - ############################# - job_module_deploy_validation: - runs-on: ubuntu-20.04 - name: 'Deploying' - if: | - !cancelled() && - (fromJson(needs.job_initialize_pipeline.outputs.workflowInput)).deploymentValidation == 'true' && - needs.job_module_static_validation.result != 'failure' + ############################## + # Call reusable workflow # + ############################## + call-workflow-passing-data: + name: 'Module' needs: - job_initialize_pipeline - - job_module_static_validation - strategy: - fail-fast: false - matrix: - moduleTestFilePaths: ${{ fromJson(needs.job_initialize_pipeline.outputs.moduleTestFilePaths) }} - steps: - - name: 'Checkout' - uses: actions/checkout@v3 - with: - fetch-depth: 0 - - name: Set environment variables - uses: ./.github/actions/templates/setEnvironmentVariables - with: - variablesPath: ${{ env.variablesPath }} - - name: 'Using test file [${{ matrix.moduleTestFilePaths }}]' - uses: ./.github/actions/templates/validateModuleDeployment - with: - templateFilePath: '${{ env.modulePath }}/${{ matrix.moduleTestFilePaths }}' - location: '${{ env.location }}' - subscriptionId: '${{ secrets.ARM_SUBSCRIPTION_ID }}' - managementGroupId: '${{ secrets.ARM_MGMTGROUP_ID }}' - removeDeployment: '${{ (fromJson(needs.job_initialize_pipeline.outputs.workflowInput)).removeDeployment }}' - - ################## - # Publishing # - ################## - job_publish_module: - name: 'Publishing' - if: github.ref == 'refs/heads/main' || github.ref == 'refs/heads/master' || github.event.inputs.prerelease == 'true' - runs-on: ubuntu-20.04 - needs: - - job_module_deploy_validation - steps: - - name: 'Checkout' - uses: actions/checkout@v3 - with: - fetch-depth: 0 - - name: Set environment variables - uses: ./.github/actions/templates/setEnvironmentVariables - with: - variablesPath: ${{ env.variablesPath }} - - name: 'Publishing' - uses: ./.github/actions/templates/publishModule - with: - templateFilePath: '${{ env.modulePath }}/deploy.bicep' - templateSpecsRGName: '${{ env.templateSpecsRGName }}' - templateSpecsRGLocation: '${{ env.templateSpecsRGLocation }}' - templateSpecsDescription: '${{ env.templateSpecsDescription }}' - templateSpecsDoPublish: '${{ env.templateSpecsDoPublish }}' - bicepRegistryName: '${{ env.bicepRegistryName }}' - bicepRegistryRGName: '${{ env.bicepRegistryRGName }}' - bicepRegistryRgLocation: '${{ env.bicepRegistryRgLocation }}' - bicepRegistryDoPublish: '${{ env.bicepRegistryDoPublish }}' - publishLatest: '${{ env.publishLatest }}' + uses: ./.github/workflows/template.module.yml + with: + workflowInput: '${{ needs.job_initialize_pipeline.outputs.workflowInput }}' + moduleTestFilePaths: '${{ needs.job_initialize_pipeline.outputs.moduleTestFilePaths }}' + modulePath: '${{ needs.job_initialize_pipeline.outputs.modulePath}}' + secrets: inherit diff --git a/.github/workflows/ms.desktopvirtualization.scalingplans.yml b/.github/workflows/ms.desktopvirtualization.scalingplans.yml index 21c2031cb2..d4002e4aff 100644 --- a/.github/workflows/ms.desktopvirtualization.scalingplans.yml +++ b/.github/workflows/ms.desktopvirtualization.scalingplans.yml @@ -1,4 +1,4 @@ -name: 'DesktopVirtualization: Scalingplans' +name: 'DesktopVirtualization - Scalingplans' on: workflow_dispatch: @@ -28,6 +28,7 @@ on: - main paths: - '.github/actions/templates/**' + - '.github/workflows/template.module.yml' - '.github/workflows/ms.desktopvirtualization.scalingplans.yml' - 'modules/Microsoft.DesktopVirtualization/scalingplans/**' - 'utilities/pipelines/**' @@ -35,14 +36,8 @@ on: - '!*/**/readme.md' env: - variablesPath: 'settings.yml' modulePath: 'modules/Microsoft.DesktopVirtualization/scalingplans' workflowPath: '.github/workflows/ms.desktopvirtualization.scalingplans.yml' - AZURE_CREDENTIALS: ${{ secrets.AZURE_CREDENTIALS }} - ARM_SUBSCRIPTION_ID: '${{ secrets.ARM_SUBSCRIPTION_ID }}' - ARM_MGMTGROUP_ID: '${{ secrets.ARM_MGMTGROUP_ID }}' - ARM_TENANT_ID: '${{ secrets.ARM_TENANT_ID }}' - TOKEN_NAMEPREFIX: '${{ secrets.TOKEN_NAMEPREFIX }}' concurrency: group: ${{ github.workflow }} @@ -72,94 +67,19 @@ jobs: outputs: workflowInput: ${{ steps.get-workflow-param.outputs.workflowInput }} moduleTestFilePaths: ${{ steps.get-module-test-file-paths.outputs.moduleTestFilePaths }} + modulePath: '${{ env.modulePath }}' - ######################### - # Static validation # - ######################### - job_module_static_validation: - runs-on: ubuntu-20.04 - name: 'Static validation' - if: (fromJson(needs.job_initialize_pipeline.outputs.workflowInput)).staticValidation == 'true' - needs: - - job_initialize_pipeline - steps: - - name: 'Checkout' - uses: actions/checkout@v3 - with: - fetch-depth: 0 - - name: Set environment variables - uses: ./.github/actions/templates/setEnvironmentVariables - with: - variablesPath: ${{ env.variablesPath }} - - name: 'Run tests' - uses: ./.github/actions/templates/validateModulePester - with: - modulePath: '${{ env.modulePath }}' - moduleTestFilePath: '${{ env.moduleTestFilePath }}' - ############################# - # Deployment validation # - ############################# - job_module_deploy_validation: - runs-on: ubuntu-20.04 - name: 'Deploying' - if: | - !cancelled() && - (fromJson(needs.job_initialize_pipeline.outputs.workflowInput)).deploymentValidation == 'true' && - needs.job_module_static_validation.result != 'failure' + ############################## + # Call reusable workflow # + ############################## + call-workflow-passing-data: + name: 'Module' needs: - job_initialize_pipeline - - job_module_static_validation - strategy: - fail-fast: false - matrix: - moduleTestFilePaths: ${{ fromJson(needs.job_initialize_pipeline.outputs.moduleTestFilePaths) }} - steps: - - name: 'Checkout' - uses: actions/checkout@v3 - with: - fetch-depth: 0 - - name: Set environment variables - uses: ./.github/actions/templates/setEnvironmentVariables - with: - variablesPath: ${{ env.variablesPath }} - - name: 'Using test file [${{ matrix.moduleTestFilePaths }}]' - uses: ./.github/actions/templates/validateModuleDeployment - with: - templateFilePath: '${{ env.modulePath }}/${{ matrix.moduleTestFilePaths }}' - location: '${{ env.location }}' - subscriptionId: '${{ secrets.ARM_SUBSCRIPTION_ID }}' - managementGroupId: '${{ secrets.ARM_MGMTGROUP_ID }}' - removeDeployment: '${{ (fromJson(needs.job_initialize_pipeline.outputs.workflowInput)).removeDeployment }}' - - ################## - # Publishing # - ################## - job_publish_module: - name: 'Publishing' - if: github.ref == 'refs/heads/main' || github.ref == 'refs/heads/master' || github.event.inputs.prerelease == 'true' - runs-on: ubuntu-20.04 - needs: - - job_module_deploy_validation - steps: - - name: 'Checkout' - uses: actions/checkout@v3 - with: - fetch-depth: 0 - - name: Set environment variables - uses: ./.github/actions/templates/setEnvironmentVariables - with: - variablesPath: ${{ env.variablesPath }} - - name: 'Publishing' - uses: ./.github/actions/templates/publishModule - with: - templateFilePath: '${{ env.modulePath }}/deploy.bicep' - templateSpecsRGName: '${{ env.templateSpecsRGName }}' - templateSpecsRGLocation: '${{ env.templateSpecsRGLocation }}' - templateSpecsDescription: '${{ env.templateSpecsDescription }}' - templateSpecsDoPublish: '${{ env.templateSpecsDoPublish }}' - bicepRegistryName: '${{ env.bicepRegistryName }}' - bicepRegistryRGName: '${{ env.bicepRegistryRGName }}' - bicepRegistryRgLocation: '${{ env.bicepRegistryRgLocation }}' - bicepRegistryDoPublish: '${{ env.bicepRegistryDoPublish }}' - publishLatest: '${{ env.publishLatest }}' + uses: ./.github/workflows/template.module.yml + with: + workflowInput: '${{ needs.job_initialize_pipeline.outputs.workflowInput }}' + moduleTestFilePaths: '${{ needs.job_initialize_pipeline.outputs.moduleTestFilePaths }}' + modulePath: '${{ needs.job_initialize_pipeline.outputs.modulePath}}' + secrets: inherit diff --git a/.github/workflows/ms.desktopvirtualization.workspaces.yml b/.github/workflows/ms.desktopvirtualization.workspaces.yml index 5c888bf6f3..2c706b3503 100644 --- a/.github/workflows/ms.desktopvirtualization.workspaces.yml +++ b/.github/workflows/ms.desktopvirtualization.workspaces.yml @@ -1,4 +1,4 @@ -name: 'DesktopVirtualization: Workspaces' +name: 'DesktopVirtualization - Workspaces' on: workflow_dispatch: @@ -28,6 +28,7 @@ on: - main paths: - '.github/actions/templates/**' + - '.github/workflows/template.module.yml' - '.github/workflows/ms.desktopvirtualization.workspaces.yml' - 'modules/Microsoft.DesktopVirtualization/workspaces/**' - 'utilities/pipelines/**' @@ -35,14 +36,8 @@ on: - '!*/**/readme.md' env: - variablesPath: 'settings.yml' modulePath: 'modules/Microsoft.DesktopVirtualization/workspaces' workflowPath: '.github/workflows/ms.desktopvirtualization.workspaces.yml' - AZURE_CREDENTIALS: ${{ secrets.AZURE_CREDENTIALS }} - ARM_SUBSCRIPTION_ID: '${{ secrets.ARM_SUBSCRIPTION_ID }}' - ARM_MGMTGROUP_ID: '${{ secrets.ARM_MGMTGROUP_ID }}' - ARM_TENANT_ID: '${{ secrets.ARM_TENANT_ID }}' - TOKEN_NAMEPREFIX: '${{ secrets.TOKEN_NAMEPREFIX }}' concurrency: group: ${{ github.workflow }} @@ -72,94 +67,19 @@ jobs: outputs: workflowInput: ${{ steps.get-workflow-param.outputs.workflowInput }} moduleTestFilePaths: ${{ steps.get-module-test-file-paths.outputs.moduleTestFilePaths }} + modulePath: '${{ env.modulePath }}' - ######################### - # Static validation # - ######################### - job_module_static_validation: - runs-on: ubuntu-20.04 - name: 'Static validation' - if: (fromJson(needs.job_initialize_pipeline.outputs.workflowInput)).staticValidation == 'true' - needs: - - job_initialize_pipeline - steps: - - name: 'Checkout' - uses: actions/checkout@v3 - with: - fetch-depth: 0 - - name: Set environment variables - uses: ./.github/actions/templates/setEnvironmentVariables - with: - variablesPath: ${{ env.variablesPath }} - - name: 'Run tests' - uses: ./.github/actions/templates/validateModulePester - with: - modulePath: '${{ env.modulePath }}' - moduleTestFilePath: '${{ env.moduleTestFilePath }}' - ############################# - # Deployment validation # - ############################# - job_module_deploy_validation: - runs-on: ubuntu-20.04 - name: 'Deploying' - if: | - !cancelled() && - (fromJson(needs.job_initialize_pipeline.outputs.workflowInput)).deploymentValidation == 'true' && - needs.job_module_static_validation.result != 'failure' + ############################## + # Call reusable workflow # + ############################## + call-workflow-passing-data: + name: 'Module' needs: - job_initialize_pipeline - - job_module_static_validation - strategy: - fail-fast: false - matrix: - moduleTestFilePaths: ${{ fromJson(needs.job_initialize_pipeline.outputs.moduleTestFilePaths) }} - steps: - - name: 'Checkout' - uses: actions/checkout@v3 - with: - fetch-depth: 0 - - name: Set environment variables - uses: ./.github/actions/templates/setEnvironmentVariables - with: - variablesPath: ${{ env.variablesPath }} - - name: 'Using test file [${{ matrix.moduleTestFilePaths }}]' - uses: ./.github/actions/templates/validateModuleDeployment - with: - templateFilePath: '${{ env.modulePath }}/${{ matrix.moduleTestFilePaths }}' - location: '${{ env.location }}' - subscriptionId: '${{ secrets.ARM_SUBSCRIPTION_ID }}' - managementGroupId: '${{ secrets.ARM_MGMTGROUP_ID }}' - removeDeployment: '${{ (fromJson(needs.job_initialize_pipeline.outputs.workflowInput)).removeDeployment }}' - - ################## - # Publishing # - ################## - job_publish_module: - name: 'Publishing' - if: github.ref == 'refs/heads/main' || github.ref == 'refs/heads/master' || github.event.inputs.prerelease == 'true' - runs-on: ubuntu-20.04 - needs: - - job_module_deploy_validation - steps: - - name: 'Checkout' - uses: actions/checkout@v3 - with: - fetch-depth: 0 - - name: Set environment variables - uses: ./.github/actions/templates/setEnvironmentVariables - with: - variablesPath: ${{ env.variablesPath }} - - name: 'Publishing' - uses: ./.github/actions/templates/publishModule - with: - templateFilePath: '${{ env.modulePath }}/deploy.bicep' - templateSpecsRGName: '${{ env.templateSpecsRGName }}' - templateSpecsRGLocation: '${{ env.templateSpecsRGLocation }}' - templateSpecsDescription: '${{ env.templateSpecsDescription }}' - templateSpecsDoPublish: '${{ env.templateSpecsDoPublish }}' - bicepRegistryName: '${{ env.bicepRegistryName }}' - bicepRegistryRGName: '${{ env.bicepRegistryRGName }}' - bicepRegistryRgLocation: '${{ env.bicepRegistryRgLocation }}' - bicepRegistryDoPublish: '${{ env.bicepRegistryDoPublish }}' - publishLatest: '${{ env.publishLatest }}' + uses: ./.github/workflows/template.module.yml + with: + workflowInput: '${{ needs.job_initialize_pipeline.outputs.workflowInput }}' + moduleTestFilePaths: '${{ needs.job_initialize_pipeline.outputs.moduleTestFilePaths }}' + modulePath: '${{ needs.job_initialize_pipeline.outputs.modulePath}}' + secrets: inherit diff --git a/.github/workflows/ms.devtestlab.labs.yml b/.github/workflows/ms.devtestlab.labs.yml index 49eba6f6bb..e3682b3305 100644 --- a/.github/workflows/ms.devtestlab.labs.yml +++ b/.github/workflows/ms.devtestlab.labs.yml @@ -1,8 +1,18 @@ -name: 'DevTestLab: Labs' +name: 'DevTestLab - Labs' on: workflow_dispatch: inputs: + staticValidation: + type: boolean + description: 'Execute static validation' + required: false + default: true + deploymentValidation: + type: boolean + description: 'Execute deployment validation' + required: false + default: true removeDeployment: type: boolean description: 'Remove deployed module' @@ -19,6 +29,7 @@ on: - main paths: - '.github/actions/templates/**' + - '.github/workflows/template.module.yml' - '.github/workflows/ms.devtestlab.labs.yml' - 'modules/Microsoft.DevTestLab/labs/**' - 'utilities/pipelines/**' @@ -26,14 +37,8 @@ on: - '!*/**/readme.md' env: - variablesPath: 'settings.yml' modulePath: 'modules/Microsoft.DevTestLab/labs' workflowPath: '.github/workflows/ms.devtestlab.labs.yml' - AZURE_CREDENTIALS: ${{ secrets.AZURE_CREDENTIALS }} - ARM_SUBSCRIPTION_ID: ${{ secrets.ARM_SUBSCRIPTION_ID }} - ARM_MGMTGROUP_ID: ${{ secrets.ARM_MGMTGROUP_ID }} - ARM_TENANT_ID: '${{ secrets.ARM_TENANT_ID }}' - TOKEN_NAMEPREFIX: '${{ secrets.TOKEN_NAMEPREFIX }}' concurrency: group: ${{ github.workflow }} @@ -63,93 +68,19 @@ jobs: outputs: workflowInput: ${{ steps.get-workflow-param.outputs.workflowInput }} moduleTestFilePaths: ${{ steps.get-module-test-file-paths.outputs.moduleTestFilePaths }} + modulePath: '${{ env.modulePath }}' - ######################### - # Static validation # - ######################### - job_module_static_validation: - runs-on: ubuntu-20.04 - name: 'Static validation' - if: (fromJson(needs.job_initialize_pipeline.outputs.workflowInput)).staticValidation == 'true' - needs: - - job_initialize_pipeline - steps: - - name: 'Checkout' - uses: actions/checkout@v3 - with: - fetch-depth: 0 - - name: Set environment variables - uses: ./.github/actions/templates/setEnvironmentVariables - with: - variablesPath: ${{ env.variablesPath }} - - name: 'Run tests' - uses: ./.github/actions/templates/validateModulePester - with: - modulePath: '${{ env.modulePath }}' - moduleTestFilePath: '${{ env.moduleTestFilePath }}' - ############################# - # Deployment validation # - ############################# - job_module_deploy_validation: - runs-on: ubuntu-20.04 - name: 'Deploying' - if: | - !cancelled() && - (fromJson(needs.job_initialize_pipeline.outputs.workflowInput)).deploymentValidation == 'true' && - needs.job_module_static_validation.result != 'failure' + ############################## + # Call reusable workflow # + ############################## + call-workflow-passing-data: + name: 'Module' needs: - job_initialize_pipeline - - job_module_static_validation - strategy: - fail-fast: false - matrix: - moduleTestFilePaths: ${{ fromJson(needs.job_initialize_pipeline.outputs.moduleTestFilePaths) }} - steps: - - name: 'Checkout' - uses: actions/checkout@v3 - with: - fetch-depth: 0 - - name: Set environment variables - uses: ./.github/actions/templates/setEnvironmentVariables - with: - variablesPath: ${{ env.variablesPath }} - - name: 'Using test file [${{ matrix.moduleTestFilePaths }}]' - uses: ./.github/actions/templates/validateModuleDeployment - with: - templateFilePath: '${{ env.modulePath }}/${{ matrix.moduleTestFilePaths }}' - location: '${{ env.location }}' - subscriptionId: '${{ secrets.ARM_SUBSCRIPTION_ID }}' - managementGroupId: '${{ secrets.ARM_MGMTGROUP_ID }}' - removeDeployment: '${{ (fromJson(needs.job_initialize_pipeline.outputs.workflowInput)).removeDeployment }}' - - ################## - # Publishing # - ################## - job_publish_module: - name: 'Publishing' - if: github.ref == 'refs/heads/main' || github.ref == 'refs/heads/master' || github.event.inputs.prerelease == 'true' - runs-on: ubuntu-20.04 - needs: - - job_module_deploy_validation - steps: - - name: 'Checkout' - uses: actions/checkout@v3 - with: - fetch-depth: 0 - - name: Set environment variables - uses: ./.github/actions/templates/setEnvironmentVariables - with: - variablesPath: ${{ env.variablesPath }} - - name: 'Publishing' - uses: ./.github/actions/templates/publishModule - with: - templateFilePath: '${{ env.modulePath }}/deploy.bicep' - templateSpecsRGName: '${{ env.templateSpecsRGName }}' - templateSpecsRGLocation: '${{ env.templateSpecsRGLocation }}' - templateSpecsDescription: '${{ env.templateSpecsDescription }}' - templateSpecsDoPublish: '${{ env.templateSpecsDoPublish }}' - bicepRegistryName: '${{ env.bicepRegistryName }}' - bicepRegistryRGName: '${{ env.bicepRegistryRGName }}' - bicepRegistryRgLocation: '${{ env.bicepRegistryRgLocation }}' - bicepRegistryDoPublish: '${{ env.bicepRegistryDoPublish }}' + uses: ./.github/workflows/template.module.yml + with: + workflowInput: '${{ needs.job_initialize_pipeline.outputs.workflowInput }}' + moduleTestFilePaths: '${{ needs.job_initialize_pipeline.outputs.moduleTestFilePaths }}' + modulePath: '${{ needs.job_initialize_pipeline.outputs.modulePath}}' + secrets: inherit diff --git a/.github/workflows/ms.documentdb.databaseaccounts.yml b/.github/workflows/ms.documentdb.databaseaccounts.yml index 69f74cf661..776fb23aba 100644 --- a/.github/workflows/ms.documentdb.databaseaccounts.yml +++ b/.github/workflows/ms.documentdb.databaseaccounts.yml @@ -1,4 +1,4 @@ -name: 'DocumentDB: DatabaseAccounts' +name: 'DocumentDB - DatabaseAccounts' on: workflow_dispatch: @@ -28,6 +28,7 @@ on: - main paths: - '.github/actions/templates/**' + - '.github/workflows/template.module.yml' - '.github/workflows/ms.documentdb.databaseaccounts.yml' - 'modules/Microsoft.DocumentDB/databaseAccounts/**' - 'utilities/pipelines/**' @@ -35,14 +36,8 @@ on: - '!*/**/readme.md' env: - variablesPath: 'settings.yml' modulePath: 'modules/Microsoft.DocumentDB/databaseAccounts' workflowPath: '.github/workflows/ms.documentdb.databaseaccounts.yml' - AZURE_CREDENTIALS: ${{ secrets.AZURE_CREDENTIALS }} - ARM_SUBSCRIPTION_ID: '${{ secrets.ARM_SUBSCRIPTION_ID }}' - ARM_MGMTGROUP_ID: '${{ secrets.ARM_MGMTGROUP_ID }}' - ARM_TENANT_ID: '${{ secrets.ARM_TENANT_ID }}' - TOKEN_NAMEPREFIX: '${{ secrets.TOKEN_NAMEPREFIX }}' concurrency: group: ${{ github.workflow }} @@ -72,94 +67,19 @@ jobs: outputs: workflowInput: ${{ steps.get-workflow-param.outputs.workflowInput }} moduleTestFilePaths: ${{ steps.get-module-test-file-paths.outputs.moduleTestFilePaths }} + modulePath: '${{ env.modulePath }}' - ######################### - # Static validation # - ######################### - job_module_static_validation: - runs-on: ubuntu-20.04 - name: 'Static validation' - if: (fromJson(needs.job_initialize_pipeline.outputs.workflowInput)).staticValidation == 'true' - needs: - - job_initialize_pipeline - steps: - - name: 'Checkout' - uses: actions/checkout@v3 - with: - fetch-depth: 0 - - name: Set environment variables - uses: ./.github/actions/templates/setEnvironmentVariables - with: - variablesPath: ${{ env.variablesPath }} - - name: 'Run tests' - uses: ./.github/actions/templates/validateModulePester - with: - modulePath: '${{ env.modulePath }}' - moduleTestFilePath: '${{ env.moduleTestFilePath }}' - ############################# - # Deployment validation # - ############################# - job_module_deploy_validation: - runs-on: ubuntu-20.04 - name: 'Deploying' - if: | - !cancelled() && - (fromJson(needs.job_initialize_pipeline.outputs.workflowInput)).deploymentValidation == 'true' && - needs.job_module_static_validation.result != 'failure' + ############################## + # Call reusable workflow # + ############################## + call-workflow-passing-data: + name: 'Module' needs: - job_initialize_pipeline - - job_module_static_validation - strategy: - fail-fast: false - matrix: - moduleTestFilePaths: ${{ fromJson(needs.job_initialize_pipeline.outputs.moduleTestFilePaths) }} - steps: - - name: 'Checkout' - uses: actions/checkout@v3 - with: - fetch-depth: 0 - - name: Set environment variables - uses: ./.github/actions/templates/setEnvironmentVariables - with: - variablesPath: ${{ env.variablesPath }} - - name: 'Using test file [${{ matrix.moduleTestFilePaths }}]' - uses: ./.github/actions/templates/validateModuleDeployment - with: - templateFilePath: '${{ env.modulePath }}/${{ matrix.moduleTestFilePaths }}' - location: '${{ env.location }}' - subscriptionId: '${{ secrets.ARM_SUBSCRIPTION_ID }}' - managementGroupId: '${{ secrets.ARM_MGMTGROUP_ID }}' - removeDeployment: '${{ (fromJson(needs.job_initialize_pipeline.outputs.workflowInput)).removeDeployment }}' - - ################## - # Publishing # - ################## - job_publish_module: - name: 'Publishing' - if: github.ref == 'refs/heads/main' || github.ref == 'refs/heads/master' || github.event.inputs.prerelease == 'true' - runs-on: ubuntu-20.04 - needs: - - job_module_deploy_validation - steps: - - name: 'Checkout' - uses: actions/checkout@v3 - with: - fetch-depth: 0 - - name: Set environment variables - uses: ./.github/actions/templates/setEnvironmentVariables - with: - variablesPath: ${{ env.variablesPath }} - - name: 'Publishing' - uses: ./.github/actions/templates/publishModule - with: - templateFilePath: '${{ env.modulePath }}/deploy.bicep' - templateSpecsRGName: '${{ env.templateSpecsRGName }}' - templateSpecsRGLocation: '${{ env.templateSpecsRGLocation }}' - templateSpecsDescription: '${{ env.templateSpecsDescription }}' - templateSpecsDoPublish: '${{ env.templateSpecsDoPublish }}' - bicepRegistryName: '${{ env.bicepRegistryName }}' - bicepRegistryRGName: '${{ env.bicepRegistryRGName }}' - bicepRegistryRgLocation: '${{ env.bicepRegistryRgLocation }}' - bicepRegistryDoPublish: '${{ env.bicepRegistryDoPublish }}' - publishLatest: '${{ env.publishLatest }}' + uses: ./.github/workflows/template.module.yml + with: + workflowInput: '${{ needs.job_initialize_pipeline.outputs.workflowInput }}' + moduleTestFilePaths: '${{ needs.job_initialize_pipeline.outputs.moduleTestFilePaths }}' + modulePath: '${{ needs.job_initialize_pipeline.outputs.modulePath}}' + secrets: inherit diff --git a/.github/workflows/ms.eventgrid.domains.yml b/.github/workflows/ms.eventgrid.domains.yml index 4c55876389..a724fef880 100644 --- a/.github/workflows/ms.eventgrid.domains.yml +++ b/.github/workflows/ms.eventgrid.domains.yml @@ -1,4 +1,4 @@ -name: 'EventGrid: Domains' +name: 'EventGrid - Domains' on: workflow_dispatch: @@ -28,6 +28,7 @@ on: - main paths: - '.github/actions/templates/**' + - '.github/workflows/template.module.yml' - '.github/workflows/ms.eventgrid.domains.yml' - 'modules/Microsoft.EventGrid/domains/**' - 'utilities/pipelines/**' @@ -35,14 +36,8 @@ on: - '!*/**/readme.md' env: - variablesPath: 'settings.yml' modulePath: 'modules/Microsoft.EventGrid/domains' workflowPath: '.github/workflows/ms.eventgrid.domains.yml' - AZURE_CREDENTIALS: ${{ secrets.AZURE_CREDENTIALS }} - ARM_SUBSCRIPTION_ID: '${{ secrets.ARM_SUBSCRIPTION_ID }}' - ARM_MGMTGROUP_ID: '${{ secrets.ARM_MGMTGROUP_ID }}' - ARM_TENANT_ID: '${{ secrets.ARM_TENANT_ID }}' - TOKEN_NAMEPREFIX: '${{ secrets.TOKEN_NAMEPREFIX }}' concurrency: group: ${{ github.workflow }} @@ -72,94 +67,19 @@ jobs: outputs: workflowInput: ${{ steps.get-workflow-param.outputs.workflowInput }} moduleTestFilePaths: ${{ steps.get-module-test-file-paths.outputs.moduleTestFilePaths }} + modulePath: '${{ env.modulePath }}' - ######################### - # Static validation # - ######################### - job_module_static_validation: - runs-on: ubuntu-20.04 - name: 'Static validation' - if: (fromJson(needs.job_initialize_pipeline.outputs.workflowInput)).staticValidation == 'true' - needs: - - job_initialize_pipeline - steps: - - name: 'Checkout' - uses: actions/checkout@v3 - with: - fetch-depth: 0 - - name: Set environment variables - uses: ./.github/actions/templates/setEnvironmentVariables - with: - variablesPath: ${{ env.variablesPath }} - - name: 'Run tests' - uses: ./.github/actions/templates/validateModulePester - with: - modulePath: '${{ env.modulePath }}' - moduleTestFilePath: '${{ env.moduleTestFilePath }}' - ############################# - # Deployment validation # - ############################# - job_module_deploy_validation: - runs-on: ubuntu-20.04 - name: 'Deploying' - if: | - !cancelled() && - (fromJson(needs.job_initialize_pipeline.outputs.workflowInput)).deploymentValidation == 'true' && - needs.job_module_static_validation.result != 'failure' + ############################## + # Call reusable workflow # + ############################## + call-workflow-passing-data: + name: 'Module' needs: - job_initialize_pipeline - - job_module_static_validation - strategy: - fail-fast: false - matrix: - moduleTestFilePaths: ${{ fromJson(needs.job_initialize_pipeline.outputs.moduleTestFilePaths) }} - steps: - - name: 'Checkout' - uses: actions/checkout@v3 - with: - fetch-depth: 0 - - name: Set environment variables - uses: ./.github/actions/templates/setEnvironmentVariables - with: - variablesPath: ${{ env.variablesPath }} - - name: 'Using test file [${{ matrix.moduleTestFilePaths }}]' - uses: ./.github/actions/templates/validateModuleDeployment - with: - templateFilePath: '${{ env.modulePath }}/${{ matrix.moduleTestFilePaths }}' - location: '${{ env.location }}' - subscriptionId: '${{ secrets.ARM_SUBSCRIPTION_ID }}' - managementGroupId: '${{ secrets.ARM_MGMTGROUP_ID }}' - removeDeployment: '${{ (fromJson(needs.job_initialize_pipeline.outputs.workflowInput)).removeDeployment }}' - - ################## - # Publishing # - ################## - job_publish_module: - name: 'Publishing' - if: github.ref == 'refs/heads/main' || github.ref == 'refs/heads/master' || github.event.inputs.prerelease == 'true' - runs-on: ubuntu-20.04 - needs: - - job_module_deploy_validation - steps: - - name: 'Checkout' - uses: actions/checkout@v3 - with: - fetch-depth: 0 - - name: Set environment variables - uses: ./.github/actions/templates/setEnvironmentVariables - with: - variablesPath: ${{ env.variablesPath }} - - name: 'Publishing' - uses: ./.github/actions/templates/publishModule - with: - templateFilePath: '${{ env.modulePath }}/deploy.bicep' - templateSpecsRGName: '${{ env.templateSpecsRGName }}' - templateSpecsRGLocation: '${{ env.templateSpecsRGLocation }}' - templateSpecsDescription: '${{ env.templateSpecsDescription }}' - templateSpecsDoPublish: '${{ env.templateSpecsDoPublish }}' - bicepRegistryName: '${{ env.bicepRegistryName }}' - bicepRegistryRGName: '${{ env.bicepRegistryRGName }}' - bicepRegistryRgLocation: '${{ env.bicepRegistryRgLocation }}' - bicepRegistryDoPublish: '${{ env.bicepRegistryDoPublish }}' - publishLatest: '${{ env.publishLatest }}' + uses: ./.github/workflows/template.module.yml + with: + workflowInput: '${{ needs.job_initialize_pipeline.outputs.workflowInput }}' + moduleTestFilePaths: '${{ needs.job_initialize_pipeline.outputs.moduleTestFilePaths }}' + modulePath: '${{ needs.job_initialize_pipeline.outputs.modulePath}}' + secrets: inherit diff --git a/.github/workflows/ms.eventgrid.eventsubscriptions.yml b/.github/workflows/ms.eventgrid.eventsubscriptions.yml index f594fe6bb5..235504321f 100644 --- a/.github/workflows/ms.eventgrid.eventsubscriptions.yml +++ b/.github/workflows/ms.eventgrid.eventsubscriptions.yml @@ -1,4 +1,4 @@ -name: 'EventGrid: Event Subscriptions' +name: 'EventGrid - Event Subscriptions' on: workflow_dispatch: @@ -28,6 +28,7 @@ on: - main paths: - '.github/actions/templates/**' + - '.github/workflows/template.module.yml' - '.github/workflows/ms.eventgrid.eventsubscriptions.yml' - 'modules/Microsoft.EventGrid/eventSubscriptions/**' - 'utilities/pipelines/**' @@ -35,14 +36,8 @@ on: - '!*/**/readme.md' env: - variablesPath: 'settings.yml' modulePath: 'modules/Microsoft.EventGrid/eventSubscriptions' workflowPath: '.github/workflows/ms.eventgrid.eventsubscriptions.yml' - AZURE_CREDENTIALS: ${{ secrets.AZURE_CREDENTIALS }} - ARM_SUBSCRIPTION_ID: '${{ secrets.ARM_SUBSCRIPTION_ID }}' - ARM_MGMTGROUP_ID: '${{ secrets.ARM_MGMTGROUP_ID }}' - ARM_TENANT_ID: '${{ secrets.ARM_TENANT_ID }}' - TOKEN_NAMEPREFIX: '${{ secrets.TOKEN_NAMEPREFIX }}' concurrency: group: ${{ github.workflow }} @@ -72,93 +67,19 @@ jobs: outputs: workflowInput: ${{ steps.get-workflow-param.outputs.workflowInput }} moduleTestFilePaths: ${{ steps.get-module-test-file-paths.outputs.moduleTestFilePaths }} + modulePath: '${{ env.modulePath }}' - ######################### - # Static validation # - ######################### - job_module_static_validation: - runs-on: ubuntu-20.04 - name: 'Static validation' - if: (fromJson(needs.job_initialize_pipeline.outputs.workflowInput)).staticValidation == 'true' - needs: - - job_initialize_pipeline - steps: - - name: 'Checkout' - uses: actions/checkout@v3 - with: - fetch-depth: 0 - - name: Set environment variables - uses: ./.github/actions/templates/setEnvironmentVariables - with: - variablesPath: ${{ env.variablesPath }} - - name: 'Run tests' - uses: ./.github/actions/templates/validateModulePester - with: - modulePath: '${{ env.modulePath }}' - moduleTestFilePath: '${{ env.moduleTestFilePath }}' - ############################# - # Deployment validation # - ############################# - job_module_deploy_validation: - runs-on: ubuntu-20.04 - name: 'Deploying' - if: | - !cancelled() && - (fromJson(needs.job_initialize_pipeline.outputs.workflowInput)).deploymentValidation == 'true' && - needs.job_module_static_validation.result != 'failure' + ############################## + # Call reusable workflow # + ############################## + call-workflow-passing-data: + name: 'Module' needs: - job_initialize_pipeline - - job_module_static_validation - strategy: - fail-fast: false - matrix: - moduleTestFilePaths: ${{ fromJson(needs.job_initialize_pipeline.outputs.moduleTestFilePaths) }} - steps: - - name: 'Checkout' - uses: actions/checkout@v3 - with: - fetch-depth: 0 - - name: Set environment variables - uses: ./.github/actions/templates/setEnvironmentVariables - with: - variablesPath: ${{ env.variablesPath }} - - name: 'Using test file [${{ matrix.moduleTestFilePaths }}]' - uses: ./.github/actions/templates/validateModuleDeployment - with: - templateFilePath: '${{ env.modulePath }}/${{ matrix.moduleTestFilePaths }}' - location: '${{ env.location }}' - subscriptionId: '${{ secrets.ARM_SUBSCRIPTION_ID }}' - managementGroupId: '${{ secrets.ARM_MGMTGROUP_ID }}' - removeDeployment: '${{ (fromJson(needs.job_initialize_pipeline.outputs.workflowInput)).removeDeployment }}' - - ################## - # Publishing # - ################## - job_publish_module: - name: 'Publishing' - if: github.ref == 'refs/heads/main' || github.ref == 'refs/heads/master' || github.event.inputs.prerelease == 'true' - runs-on: ubuntu-20.04 - needs: - - job_module_deploy_validation - steps: - - name: 'Checkout' - uses: actions/checkout@v3 - with: - fetch-depth: 0 - - name: Set environment variables - uses: ./.github/actions/templates/setEnvironmentVariables - with: - variablesPath: ${{ env.variablesPath }} - - name: 'Publishing' - uses: ./.github/actions/templates/publishModule - with: - templateFilePath: '${{ env.modulePath }}/deploy.bicep' - templateSpecsRGName: '${{ env.templateSpecsRGName }}' - templateSpecsRGLocation: '${{ env.templateSpecsRGLocation }}' - templateSpecsDescription: '${{ env.templateSpecsDescription }}' - templateSpecsDoPublish: '${{ env.templateSpecsDoPublish }}' - bicepRegistryName: '${{ env.bicepRegistryName }}' - bicepRegistryRGName: '${{ env.bicepRegistryRGName }}' - bicepRegistryRgLocation: '${{ env.bicepRegistryRgLocation }}' - bicepRegistryDoPublish: '${{ env.bicepRegistryDoPublish }}' + uses: ./.github/workflows/template.module.yml + with: + workflowInput: '${{ needs.job_initialize_pipeline.outputs.workflowInput }}' + moduleTestFilePaths: '${{ needs.job_initialize_pipeline.outputs.moduleTestFilePaths }}' + modulePath: '${{ needs.job_initialize_pipeline.outputs.modulePath}}' + secrets: inherit diff --git a/.github/workflows/ms.eventgrid.systemtopics.yml b/.github/workflows/ms.eventgrid.systemtopics.yml index 8d48ea4c4c..52333a1461 100644 --- a/.github/workflows/ms.eventgrid.systemtopics.yml +++ b/.github/workflows/ms.eventgrid.systemtopics.yml @@ -1,4 +1,4 @@ -name: 'EventGrid: System Topics' +name: 'EventGrid - System Topics' on: workflow_dispatch: @@ -28,6 +28,7 @@ on: - main paths: - '.github/actions/templates/**' + - '.github/workflows/template.module.yml' - '.github/workflows/ms.eventgrid.systemtopics.yml' - 'modules/Microsoft.EventGrid/systemTopics/**' - 'utilities/pipelines/**' @@ -35,14 +36,8 @@ on: - '!*/**/readme.md' env: - variablesPath: 'settings.yml' modulePath: 'modules/Microsoft.EventGrid/systemTopics' workflowPath: '.github/workflows/ms.eventgrid.systemtopics.yml' - AZURE_CREDENTIALS: ${{ secrets.AZURE_CREDENTIALS }} - ARM_SUBSCRIPTION_ID: '${{ secrets.ARM_SUBSCRIPTION_ID }}' - ARM_MGMTGROUP_ID: '${{ secrets.ARM_MGMTGROUP_ID }}' - ARM_TENANT_ID: '${{ secrets.ARM_TENANT_ID }}' - TOKEN_NAMEPREFIX: '${{ secrets.TOKEN_NAMEPREFIX }}' concurrency: group: ${{ github.workflow }} @@ -72,94 +67,19 @@ jobs: outputs: workflowInput: ${{ steps.get-workflow-param.outputs.workflowInput }} moduleTestFilePaths: ${{ steps.get-module-test-file-paths.outputs.moduleTestFilePaths }} + modulePath: '${{ env.modulePath }}' - ######################### - # Static validation # - ######################### - job_module_static_validation: - runs-on: ubuntu-20.04 - name: 'Static validation' - if: (fromJson(needs.job_initialize_pipeline.outputs.workflowInput)).staticValidation == 'true' - needs: - - job_initialize_pipeline - steps: - - name: 'Checkout' - uses: actions/checkout@v3 - with: - fetch-depth: 0 - - name: Set environment variables - uses: ./.github/actions/templates/setEnvironmentVariables - with: - variablesPath: ${{ env.variablesPath }} - - name: 'Run tests' - uses: ./.github/actions/templates/validateModulePester - with: - modulePath: '${{ env.modulePath }}' - moduleTestFilePath: '${{ env.moduleTestFilePath }}' - ############################# - # Deployment validation # - ############################# - job_module_deploy_validation: - runs-on: ubuntu-20.04 - name: 'Deploying' - if: | - !cancelled() && - (fromJson(needs.job_initialize_pipeline.outputs.workflowInput)).deploymentValidation == 'true' && - needs.job_module_static_validation.result != 'failure' + ############################## + # Call reusable workflow # + ############################## + call-workflow-passing-data: + name: 'Module' needs: - job_initialize_pipeline - - job_module_static_validation - strategy: - fail-fast: false - matrix: - moduleTestFilePaths: ${{ fromJson(needs.job_initialize_pipeline.outputs.moduleTestFilePaths) }} - steps: - - name: 'Checkout' - uses: actions/checkout@v3 - with: - fetch-depth: 0 - - name: Set environment variables - uses: ./.github/actions/templates/setEnvironmentVariables - with: - variablesPath: ${{ env.variablesPath }} - - name: 'Using test file [${{ matrix.moduleTestFilePaths }}]' - uses: ./.github/actions/templates/validateModuleDeployment - with: - templateFilePath: '${{ env.modulePath }}/${{ matrix.moduleTestFilePaths }}' - location: '${{ env.location }}' - subscriptionId: '${{ secrets.ARM_SUBSCRIPTION_ID }}' - managementGroupId: '${{ secrets.ARM_MGMTGROUP_ID }}' - removeDeployment: '${{ (fromJson(needs.job_initialize_pipeline.outputs.workflowInput)).removeDeployment }}' - - ################## - # Publishing # - ################## - job_publish_module: - name: 'Publishing' - if: github.ref == 'refs/heads/main' || github.ref == 'refs/heads/master' || github.event.inputs.prerelease == 'true' - runs-on: ubuntu-20.04 - needs: - - job_module_deploy_validation - steps: - - name: 'Checkout' - uses: actions/checkout@v3 - with: - fetch-depth: 0 - - name: Set environment variables - uses: ./.github/actions/templates/setEnvironmentVariables - with: - variablesPath: ${{ env.variablesPath }} - - name: 'Publishing' - uses: ./.github/actions/templates/publishModule - with: - templateFilePath: '${{ env.modulePath }}/deploy.bicep' - templateSpecsRGName: '${{ env.templateSpecsRGName }}' - templateSpecsRGLocation: '${{ env.templateSpecsRGLocation }}' - templateSpecsDescription: '${{ env.templateSpecsDescription }}' - templateSpecsDoPublish: '${{ env.templateSpecsDoPublish }}' - bicepRegistryName: '${{ env.bicepRegistryName }}' - bicepRegistryRGName: '${{ env.bicepRegistryRGName }}' - bicepRegistryRgLocation: '${{ env.bicepRegistryRgLocation }}' - bicepRegistryDoPublish: '${{ env.bicepRegistryDoPublish }}' - publishLatest: '${{ env.publishLatest }}' + uses: ./.github/workflows/template.module.yml + with: + workflowInput: '${{ needs.job_initialize_pipeline.outputs.workflowInput }}' + moduleTestFilePaths: '${{ needs.job_initialize_pipeline.outputs.moduleTestFilePaths }}' + modulePath: '${{ needs.job_initialize_pipeline.outputs.modulePath}}' + secrets: inherit diff --git a/.github/workflows/ms.eventgrid.topics.yml b/.github/workflows/ms.eventgrid.topics.yml index 8b458574c0..8abf5774a1 100644 --- a/.github/workflows/ms.eventgrid.topics.yml +++ b/.github/workflows/ms.eventgrid.topics.yml @@ -1,4 +1,4 @@ -name: 'EventGrid: Topics' +name: 'EventGrid - Topics' on: workflow_dispatch: @@ -28,6 +28,7 @@ on: - main paths: - '.github/actions/templates/**' + - '.github/workflows/template.module.yml' - '.github/workflows/ms.eventgrid.topics.yml' - 'modules/Microsoft.EventGrid/topics/**' - 'utilities/pipelines/**' @@ -35,14 +36,8 @@ on: - '!*/**/readme.md' env: - variablesPath: 'settings.yml' modulePath: 'modules/Microsoft.EventGrid/topics' workflowPath: '.github/workflows/ms.eventgrid.topics.yml' - AZURE_CREDENTIALS: ${{ secrets.AZURE_CREDENTIALS }} - ARM_SUBSCRIPTION_ID: '${{ secrets.ARM_SUBSCRIPTION_ID }}' - ARM_MGMTGROUP_ID: '${{ secrets.ARM_MGMTGROUP_ID }}' - ARM_TENANT_ID: '${{ secrets.ARM_TENANT_ID }}' - TOKEN_NAMEPREFIX: '${{ secrets.TOKEN_NAMEPREFIX }}' concurrency: group: ${{ github.workflow }} @@ -72,94 +67,19 @@ jobs: outputs: workflowInput: ${{ steps.get-workflow-param.outputs.workflowInput }} moduleTestFilePaths: ${{ steps.get-module-test-file-paths.outputs.moduleTestFilePaths }} + modulePath: '${{ env.modulePath }}' - ######################### - # Static validation # - ######################### - job_module_static_validation: - runs-on: ubuntu-20.04 - name: 'Static validation' - if: (fromJson(needs.job_initialize_pipeline.outputs.workflowInput)).staticValidation == 'true' - needs: - - job_initialize_pipeline - steps: - - name: 'Checkout' - uses: actions/checkout@v3 - with: - fetch-depth: 0 - - name: Set environment variables - uses: ./.github/actions/templates/setEnvironmentVariables - with: - variablesPath: ${{ env.variablesPath }} - - name: 'Run tests' - uses: ./.github/actions/templates/validateModulePester - with: - modulePath: '${{ env.modulePath }}' - moduleTestFilePath: '${{ env.moduleTestFilePath }}' - ############################# - # Deployment validation # - ############################# - job_module_deploy_validation: - runs-on: ubuntu-20.04 - name: 'Deploying' - if: | - !cancelled() && - (fromJson(needs.job_initialize_pipeline.outputs.workflowInput)).deploymentValidation == 'true' && - needs.job_module_static_validation.result != 'failure' + ############################## + # Call reusable workflow # + ############################## + call-workflow-passing-data: + name: 'Module' needs: - job_initialize_pipeline - - job_module_static_validation - strategy: - fail-fast: false - matrix: - moduleTestFilePaths: ${{ fromJson(needs.job_initialize_pipeline.outputs.moduleTestFilePaths) }} - steps: - - name: 'Checkout' - uses: actions/checkout@v3 - with: - fetch-depth: 0 - - name: Set environment variables - uses: ./.github/actions/templates/setEnvironmentVariables - with: - variablesPath: ${{ env.variablesPath }} - - name: 'Using test file [${{ matrix.moduleTestFilePaths }}]' - uses: ./.github/actions/templates/validateModuleDeployment - with: - templateFilePath: '${{ env.modulePath }}/${{ matrix.moduleTestFilePaths }}' - location: '${{ env.location }}' - subscriptionId: '${{ secrets.ARM_SUBSCRIPTION_ID }}' - managementGroupId: '${{ secrets.ARM_MGMTGROUP_ID }}' - removeDeployment: '${{ (fromJson(needs.job_initialize_pipeline.outputs.workflowInput)).removeDeployment }}' - - ################## - # Publishing # - ################## - job_publish_module: - name: 'Publishing' - if: github.ref == 'refs/heads/main' || github.ref == 'refs/heads/master' || github.event.inputs.prerelease == 'true' - runs-on: ubuntu-20.04 - needs: - - job_module_deploy_validation - steps: - - name: 'Checkout' - uses: actions/checkout@v3 - with: - fetch-depth: 0 - - name: Set environment variables - uses: ./.github/actions/templates/setEnvironmentVariables - with: - variablesPath: ${{ env.variablesPath }} - - name: 'Publishing' - uses: ./.github/actions/templates/publishModule - with: - templateFilePath: '${{ env.modulePath }}/deploy.bicep' - templateSpecsRGName: '${{ env.templateSpecsRGName }}' - templateSpecsRGLocation: '${{ env.templateSpecsRGLocation }}' - templateSpecsDescription: '${{ env.templateSpecsDescription }}' - templateSpecsDoPublish: '${{ env.templateSpecsDoPublish }}' - bicepRegistryName: '${{ env.bicepRegistryName }}' - bicepRegistryRGName: '${{ env.bicepRegistryRGName }}' - bicepRegistryRgLocation: '${{ env.bicepRegistryRgLocation }}' - bicepRegistryDoPublish: '${{ env.bicepRegistryDoPublish }}' - publishLatest: '${{ env.publishLatest }}' + uses: ./.github/workflows/template.module.yml + with: + workflowInput: '${{ needs.job_initialize_pipeline.outputs.workflowInput }}' + moduleTestFilePaths: '${{ needs.job_initialize_pipeline.outputs.moduleTestFilePaths }}' + modulePath: '${{ needs.job_initialize_pipeline.outputs.modulePath}}' + secrets: inherit diff --git a/.github/workflows/ms.eventhub.namespaces.yml b/.github/workflows/ms.eventhub.namespaces.yml index 7594fa0df6..2450a7a1aa 100644 --- a/.github/workflows/ms.eventhub.namespaces.yml +++ b/.github/workflows/ms.eventhub.namespaces.yml @@ -1,4 +1,4 @@ -name: 'EventHub: Namespaces' +name: 'EventHub - Namespaces' on: workflow_dispatch: @@ -28,6 +28,7 @@ on: - main paths: - '.github/actions/templates/**' + - '.github/workflows/template.module.yml' - '.github/workflows/ms.eventhub.namespaces.yml' - 'modules/Microsoft.EventHub/namespaces/**' - 'utilities/pipelines/**' @@ -35,14 +36,8 @@ on: - '!*/**/readme.md' env: - variablesPath: 'settings.yml' modulePath: 'modules/Microsoft.EventHub/namespaces' workflowPath: '.github/workflows/ms.eventhub.namespaces.yml' - AZURE_CREDENTIALS: ${{ secrets.AZURE_CREDENTIALS }} - ARM_SUBSCRIPTION_ID: '${{ secrets.ARM_SUBSCRIPTION_ID }}' - ARM_MGMTGROUP_ID: '${{ secrets.ARM_MGMTGROUP_ID }}' - ARM_TENANT_ID: '${{ secrets.ARM_TENANT_ID }}' - TOKEN_NAMEPREFIX: '${{ secrets.TOKEN_NAMEPREFIX }}' concurrency: group: ${{ github.workflow }} @@ -72,94 +67,19 @@ jobs: outputs: workflowInput: ${{ steps.get-workflow-param.outputs.workflowInput }} moduleTestFilePaths: ${{ steps.get-module-test-file-paths.outputs.moduleTestFilePaths }} + modulePath: '${{ env.modulePath }}' - ######################### - # Static validation # - ######################### - job_module_static_validation: - runs-on: ubuntu-20.04 - name: 'Static validation' - if: (fromJson(needs.job_initialize_pipeline.outputs.workflowInput)).staticValidation == 'true' - needs: - - job_initialize_pipeline - steps: - - name: 'Checkout' - uses: actions/checkout@v3 - with: - fetch-depth: 0 - - name: Set environment variables - uses: ./.github/actions/templates/setEnvironmentVariables - with: - variablesPath: ${{ env.variablesPath }} - - name: 'Run tests' - uses: ./.github/actions/templates/validateModulePester - with: - modulePath: '${{ env.modulePath }}' - moduleTestFilePath: '${{ env.moduleTestFilePath }}' - ############################# - # Deployment validation # - ############################# - job_module_deploy_validation: - runs-on: ubuntu-20.04 - name: 'Deploying' - if: | - !cancelled() && - (fromJson(needs.job_initialize_pipeline.outputs.workflowInput)).deploymentValidation == 'true' && - needs.job_module_static_validation.result != 'failure' + ############################## + # Call reusable workflow # + ############################## + call-workflow-passing-data: + name: 'Module' needs: - job_initialize_pipeline - - job_module_static_validation - strategy: - fail-fast: false - matrix: - moduleTestFilePaths: ${{ fromJson(needs.job_initialize_pipeline.outputs.moduleTestFilePaths) }} - steps: - - name: 'Checkout' - uses: actions/checkout@v3 - with: - fetch-depth: 0 - - name: Set environment variables - uses: ./.github/actions/templates/setEnvironmentVariables - with: - variablesPath: ${{ env.variablesPath }} - - name: 'Using test file [${{ matrix.moduleTestFilePaths }}]' - uses: ./.github/actions/templates/validateModuleDeployment - with: - templateFilePath: '${{ env.modulePath }}/${{ matrix.moduleTestFilePaths }}' - location: '${{ env.location }}' - subscriptionId: '${{ secrets.ARM_SUBSCRIPTION_ID }}' - managementGroupId: '${{ secrets.ARM_MGMTGROUP_ID }}' - removeDeployment: '${{ (fromJson(needs.job_initialize_pipeline.outputs.workflowInput)).removeDeployment }}' - - ################## - # Publishing # - ################## - job_publish_module: - name: 'Publishing' - if: github.ref == 'refs/heads/main' || github.ref == 'refs/heads/master' || github.event.inputs.prerelease == 'true' - runs-on: ubuntu-20.04 - needs: - - job_module_deploy_validation - steps: - - name: 'Checkout' - uses: actions/checkout@v3 - with: - fetch-depth: 0 - - name: Set environment variables - uses: ./.github/actions/templates/setEnvironmentVariables - with: - variablesPath: ${{ env.variablesPath }} - - name: 'Publishing' - uses: ./.github/actions/templates/publishModule - with: - templateFilePath: '${{ env.modulePath }}/deploy.bicep' - templateSpecsRGName: '${{ env.templateSpecsRGName }}' - templateSpecsRGLocation: '${{ env.templateSpecsRGLocation }}' - templateSpecsDescription: '${{ env.templateSpecsDescription }}' - templateSpecsDoPublish: '${{ env.templateSpecsDoPublish }}' - bicepRegistryName: '${{ env.bicepRegistryName }}' - bicepRegistryRGName: '${{ env.bicepRegistryRGName }}' - bicepRegistryRgLocation: '${{ env.bicepRegistryRgLocation }}' - bicepRegistryDoPublish: '${{ env.bicepRegistryDoPublish }}' - publishLatest: '${{ env.publishLatest }}' + uses: ./.github/workflows/template.module.yml + with: + workflowInput: '${{ needs.job_initialize_pipeline.outputs.workflowInput }}' + moduleTestFilePaths: '${{ needs.job_initialize_pipeline.outputs.moduleTestFilePaths }}' + modulePath: '${{ needs.job_initialize_pipeline.outputs.modulePath}}' + secrets: inherit diff --git a/.github/workflows/ms.healthbot.healthbots.yml b/.github/workflows/ms.healthbot.healthbots.yml index e1f884fbc2..d2c99a7632 100644 --- a/.github/workflows/ms.healthbot.healthbots.yml +++ b/.github/workflows/ms.healthbot.healthbots.yml @@ -1,4 +1,4 @@ -name: 'HealthBot: HealthBots' +name: 'HealthBot - HealthBots' on: workflow_dispatch: @@ -28,6 +28,7 @@ on: - main paths: - '.github/actions/templates/**' + - '.github/workflows/template.module.yml' - '.github/workflows/ms.healthbot.healthbots.yml' - 'modules/Microsoft.HealthBot/healthBots/**' - 'utilities/pipelines/**' @@ -35,14 +36,8 @@ on: - '!*/**/readme.md' env: - variablesPath: 'settings.yml' modulePath: 'modules/Microsoft.HealthBot/healthBots' workflowPath: '.github/workflows/ms.healthbot.healthbots.yml' - AZURE_CREDENTIALS: ${{ secrets.AZURE_CREDENTIALS }} - ARM_SUBSCRIPTION_ID: '${{ secrets.ARM_SUBSCRIPTION_ID }}' - ARM_MGMTGROUP_ID: '${{ secrets.ARM_MGMTGROUP_ID }}' - ARM_TENANT_ID: '${{ secrets.ARM_TENANT_ID }}' - TOKEN_NAMEPREFIX: '${{ secrets.TOKEN_NAMEPREFIX }}' concurrency: group: ${{ github.workflow }} @@ -72,94 +67,19 @@ jobs: outputs: workflowInput: ${{ steps.get-workflow-param.outputs.workflowInput }} moduleTestFilePaths: ${{ steps.get-module-test-file-paths.outputs.moduleTestFilePaths }} + modulePath: '${{ env.modulePath }}' - ######################### - # Static validation # - ######################### - job_module_static_validation: - runs-on: ubuntu-20.04 - name: 'Static validation' - if: (fromJson(needs.job_initialize_pipeline.outputs.workflowInput)).staticValidation == 'true' - needs: - - job_initialize_pipeline - steps: - - name: 'Checkout' - uses: actions/checkout@v3 - with: - fetch-depth: 0 - - name: Set environment variables - uses: ./.github/actions/templates/setEnvironmentVariables - with: - variablesPath: ${{ env.variablesPath }} - - name: 'Run tests' - uses: ./.github/actions/templates/validateModulePester - with: - modulePath: '${{ env.modulePath }}' - moduleTestFilePath: '${{ env.moduleTestFilePath }}' - ############################# - # Deployment validation # - ############################# - job_module_deploy_validation: - runs-on: ubuntu-20.04 - name: 'Deploying' - if: | - !cancelled() && - (fromJson(needs.job_initialize_pipeline.outputs.workflowInput)).deploymentValidation == 'true' && - needs.job_module_static_validation.result != 'failure' + ############################## + # Call reusable workflow # + ############################## + call-workflow-passing-data: + name: 'Module' needs: - job_initialize_pipeline - - job_module_static_validation - strategy: - fail-fast: false - matrix: - moduleTestFilePaths: ${{ fromJson(needs.job_initialize_pipeline.outputs.moduleTestFilePaths) }} - steps: - - name: 'Checkout' - uses: actions/checkout@v3 - with: - fetch-depth: 0 - - name: Set environment variables - uses: ./.github/actions/templates/setEnvironmentVariables - with: - variablesPath: ${{ env.variablesPath }} - - name: 'Using test file [${{ matrix.moduleTestFilePaths }}]' - uses: ./.github/actions/templates/validateModuleDeployment - with: - templateFilePath: '${{ env.modulePath }}/${{ matrix.moduleTestFilePaths }}' - location: '${{ env.location }}' - subscriptionId: '${{ secrets.ARM_SUBSCRIPTION_ID }}' - managementGroupId: '${{ secrets.ARM_MGMTGROUP_ID }}' - removeDeployment: '${{ (fromJson(needs.job_initialize_pipeline.outputs.workflowInput)).removeDeployment }}' - - ################## - # Publishing # - ################## - job_publish_module: - name: 'Publishing' - if: github.ref == 'refs/heads/main' || github.ref == 'refs/heads/master' || github.event.inputs.prerelease == 'true' - runs-on: ubuntu-20.04 - needs: - - job_module_deploy_validation - steps: - - name: 'Checkout' - uses: actions/checkout@v3 - with: - fetch-depth: 0 - - name: Set environment variables - uses: ./.github/actions/templates/setEnvironmentVariables - with: - variablesPath: ${{ env.variablesPath }} - - name: 'Publishing' - uses: ./.github/actions/templates/publishModule - with: - templateFilePath: '${{ env.modulePath }}/deploy.bicep' - templateSpecsRGName: '${{ env.templateSpecsRGName }}' - templateSpecsRGLocation: '${{ env.templateSpecsRGLocation }}' - templateSpecsDescription: '${{ env.templateSpecsDescription }}' - templateSpecsDoPublish: '${{ env.templateSpecsDoPublish }}' - bicepRegistryName: '${{ env.bicepRegistryName }}' - bicepRegistryRGName: '${{ env.bicepRegistryRGName }}' - bicepRegistryRgLocation: '${{ env.bicepRegistryRgLocation }}' - bicepRegistryDoPublish: '${{ env.bicepRegistryDoPublish }}' - publishLatest: '${{ env.publishLatest }}' + uses: ./.github/workflows/template.module.yml + with: + workflowInput: '${{ needs.job_initialize_pipeline.outputs.workflowInput }}' + moduleTestFilePaths: '${{ needs.job_initialize_pipeline.outputs.moduleTestFilePaths }}' + modulePath: '${{ needs.job_initialize_pipeline.outputs.modulePath}}' + secrets: inherit diff --git a/.github/workflows/ms.healthcareapis.workspaces.yml b/.github/workflows/ms.healthcareapis.workspaces.yml index 1a7373b933..4c7aad425c 100644 --- a/.github/workflows/ms.healthcareapis.workspaces.yml +++ b/.github/workflows/ms.healthcareapis.workspaces.yml @@ -1,8 +1,18 @@ -name: 'HealthcareApis: Workspaces' +name: 'HealthcareApis - Workspaces' on: workflow_dispatch: inputs: + staticValidation: + type: boolean + description: 'Execute static validation' + required: false + default: true + deploymentValidation: + type: boolean + description: 'Execute deployment validation' + required: false + default: true removeDeployment: type: boolean description: 'Remove deployed module' @@ -18,6 +28,7 @@ on: - main paths: - '.github/actions/templates/**' + - '.github/workflows/template.module.yml' - '.github/workflows/ms.healthcareapis.workspaces.yml' - 'modules/Microsoft.HealthcareApis/workspaces/**' - 'utilities/pipelines/**' @@ -25,14 +36,11 @@ on: - '!*/**/readme.md' env: - variablesPath: 'settings.yml' modulePath: 'modules/Microsoft.HealthcareApis/workspaces' workflowPath: '.github/workflows/ms.healthcareapis.workspaces.yml' - AZURE_CREDENTIALS: ${{ secrets.AZURE_CREDENTIALS }} - ARM_SUBSCRIPTION_ID: '${{ secrets.ARM_SUBSCRIPTION_ID }}' - ARM_MGMTGROUP_ID: '${{ secrets.ARM_MGMTGROUP_ID }}' - ARM_TENANT_ID: '${{ secrets.ARM_TENANT_ID }}' - TOKEN_NAMEPREFIX: '${{ secrets.TOKEN_NAMEPREFIX }}' + +concurrency: + group: ${{ github.workflow }} jobs: ########################### @@ -59,86 +67,19 @@ jobs: outputs: workflowInput: ${{ steps.get-workflow-param.outputs.workflowInput }} moduleTestFilePaths: ${{ steps.get-module-test-file-paths.outputs.moduleTestFilePaths }} + modulePath: '${{ env.modulePath }}' - ######################### - # Static validation # - ######################### - job_module_pester_validation: - runs-on: ubuntu-20.04 - name: 'Static validation' - steps: - - name: 'Checkout' - uses: actions/checkout@v3 - with: - fetch-depth: 0 - - name: Set environment variables - uses: ./.github/actions/templates/setEnvironmentVariables - with: - variablesPath: ${{ env.variablesPath }} - - name: 'Run tests' - uses: ./.github/actions/templates/validateModulePester - with: - modulePath: '${{ env.modulePath }}' - moduleTestFilePath: '${{ env.moduleTestFilePath }}' - ############################# - # Deployment validation # - ############################# - job_module_deploy_validation: - runs-on: ubuntu-20.04 - name: 'Deployment validation' + ############################## + # Call reusable workflow # + ############################## + call-workflow-passing-data: + name: 'Module' needs: - job_initialize_pipeline - - job_module_pester_validation - strategy: - fail-fast: false - matrix: - moduleTestFilePaths: ${{ fromJson(needs.job_initialize_pipeline.outputs.moduleTestFilePaths) }} - steps: - - name: 'Checkout' - uses: actions/checkout@v3 - with: - fetch-depth: 0 - - name: Set environment variables - uses: ./.github/actions/templates/setEnvironmentVariables - with: - variablesPath: ${{ env.variablesPath }} - - name: 'Using test file [${{ matrix.moduleTestFilePaths }}]' - uses: ./.github/actions/templates/validateModuleDeployment - with: - templateFilePath: '${{ env.modulePath }}/${{ matrix.moduleTestFilePaths }}' - location: '${{ env.location }}' - subscriptionId: '${{ secrets.ARM_SUBSCRIPTION_ID }}' - managementGroupId: '${{ secrets.ARM_MGMTGROUP_ID }}' - removeDeployment: '${{ (fromJson(needs.job_initialize_pipeline.outputs.workflowInput)).removeDeployment }}' - - ################## - # Publishing # - ################## - job_publish_module: - name: 'Publishing' - if: github.ref == 'refs/heads/main' || github.ref == 'refs/heads/master' || github.event.inputs.prerelease == 'true' - runs-on: ubuntu-20.04 - needs: - - job_module_deploy_validation - steps: - - name: 'Checkout' - uses: actions/checkout@v3 - with: - fetch-depth: 0 - - name: Set environment variables - uses: ./.github/actions/templates/setEnvironmentVariables - with: - variablesPath: ${{ env.variablesPath }} - - name: 'Publishing' - uses: ./.github/actions/templates/publishModule - with: - templateFilePath: '${{ env.modulePath }}/deploy.bicep' - templateSpecsRGName: '${{ env.templateSpecsRGName }}' - templateSpecsRGLocation: '${{ env.templateSpecsRGLocation }}' - templateSpecsDescription: '${{ env.templateSpecsDescription }}' - templateSpecsDoPublish: '${{ env.templateSpecsDoPublish }}' - bicepRegistryName: '${{ env.bicepRegistryName }}' - bicepRegistryRGName: '${{ env.bicepRegistryRGName }}' - bicepRegistryRgLocation: '${{ env.bicepRegistryRgLocation }}' - bicepRegistryDoPublish: '${{ env.bicepRegistryDoPublish }}' + uses: ./.github/workflows/template.module.yml + with: + workflowInput: '${{ needs.job_initialize_pipeline.outputs.workflowInput }}' + moduleTestFilePaths: '${{ needs.job_initialize_pipeline.outputs.moduleTestFilePaths }}' + modulePath: '${{ needs.job_initialize_pipeline.outputs.modulePath}}' + secrets: inherit diff --git a/.github/workflows/ms.insights.actiongroups.yml b/.github/workflows/ms.insights.actiongroups.yml index 1e5fa98eac..1805dd4f42 100644 --- a/.github/workflows/ms.insights.actiongroups.yml +++ b/.github/workflows/ms.insights.actiongroups.yml @@ -1,4 +1,4 @@ -name: 'Insights: ActionGroups' +name: 'Insights - ActionGroups' on: workflow_dispatch: @@ -28,6 +28,7 @@ on: - main paths: - '.github/actions/templates/**' + - '.github/workflows/template.module.yml' - '.github/workflows/ms.insights.actiongroups.yml' - 'modules/Microsoft.Insights/actionGroups/**' - 'utilities/pipelines/**' @@ -35,14 +36,8 @@ on: - '!*/**/readme.md' env: - variablesPath: 'settings.yml' modulePath: 'modules/Microsoft.Insights/actionGroups' workflowPath: '.github/workflows/ms.insights.actiongroups.yml' - AZURE_CREDENTIALS: ${{ secrets.AZURE_CREDENTIALS }} - ARM_SUBSCRIPTION_ID: '${{ secrets.ARM_SUBSCRIPTION_ID }}' - ARM_MGMTGROUP_ID: '${{ secrets.ARM_MGMTGROUP_ID }}' - ARM_TENANT_ID: '${{ secrets.ARM_TENANT_ID }}' - TOKEN_NAMEPREFIX: '${{ secrets.TOKEN_NAMEPREFIX }}' concurrency: group: ${{ github.workflow }} @@ -72,94 +67,19 @@ jobs: outputs: workflowInput: ${{ steps.get-workflow-param.outputs.workflowInput }} moduleTestFilePaths: ${{ steps.get-module-test-file-paths.outputs.moduleTestFilePaths }} + modulePath: '${{ env.modulePath }}' - ######################### - # Static validation # - ######################### - job_module_static_validation: - runs-on: ubuntu-20.04 - name: 'Static validation' - if: (fromJson(needs.job_initialize_pipeline.outputs.workflowInput)).staticValidation == 'true' - needs: - - job_initialize_pipeline - steps: - - name: 'Checkout' - uses: actions/checkout@v3 - with: - fetch-depth: 0 - - name: Set environment variables - uses: ./.github/actions/templates/setEnvironmentVariables - with: - variablesPath: ${{ env.variablesPath }} - - name: 'Run tests' - uses: ./.github/actions/templates/validateModulePester - with: - modulePath: '${{ env.modulePath }}' - moduleTestFilePath: '${{ env.moduleTestFilePath }}' - ############################# - # Deployment validation # - ############################# - job_module_deploy_validation: - runs-on: ubuntu-20.04 - name: 'Deploying' - if: | - !cancelled() && - (fromJson(needs.job_initialize_pipeline.outputs.workflowInput)).deploymentValidation == 'true' && - needs.job_module_static_validation.result != 'failure' + ############################## + # Call reusable workflow # + ############################## + call-workflow-passing-data: + name: 'Module' needs: - job_initialize_pipeline - - job_module_static_validation - strategy: - fail-fast: false - matrix: - moduleTestFilePaths: ${{ fromJson(needs.job_initialize_pipeline.outputs.moduleTestFilePaths) }} - steps: - - name: 'Checkout' - uses: actions/checkout@v3 - with: - fetch-depth: 0 - - name: Set environment variables - uses: ./.github/actions/templates/setEnvironmentVariables - with: - variablesPath: ${{ env.variablesPath }} - - name: 'Using test file [${{ matrix.moduleTestFilePaths }}]' - uses: ./.github/actions/templates/validateModuleDeployment - with: - templateFilePath: '${{ env.modulePath }}/${{ matrix.moduleTestFilePaths }}' - location: '${{ env.location }}' - subscriptionId: '${{ secrets.ARM_SUBSCRIPTION_ID }}' - managementGroupId: '${{ secrets.ARM_MGMTGROUP_ID }}' - removeDeployment: '${{ (fromJson(needs.job_initialize_pipeline.outputs.workflowInput)).removeDeployment }}' - - ################## - # Publishing # - ################## - job_publish_module: - name: 'Publishing' - if: github.ref == 'refs/heads/main' || github.ref == 'refs/heads/master' || github.event.inputs.prerelease == 'true' - runs-on: ubuntu-20.04 - needs: - - job_module_deploy_validation - steps: - - name: 'Checkout' - uses: actions/checkout@v3 - with: - fetch-depth: 0 - - name: Set environment variables - uses: ./.github/actions/templates/setEnvironmentVariables - with: - variablesPath: ${{ env.variablesPath }} - - name: 'Publishing' - uses: ./.github/actions/templates/publishModule - with: - templateFilePath: '${{ env.modulePath }}/deploy.bicep' - templateSpecsRGName: '${{ env.templateSpecsRGName }}' - templateSpecsRGLocation: '${{ env.templateSpecsRGLocation }}' - templateSpecsDescription: '${{ env.templateSpecsDescription }}' - templateSpecsDoPublish: '${{ env.templateSpecsDoPublish }}' - bicepRegistryName: '${{ env.bicepRegistryName }}' - bicepRegistryRGName: '${{ env.bicepRegistryRGName }}' - bicepRegistryRgLocation: '${{ env.bicepRegistryRgLocation }}' - bicepRegistryDoPublish: '${{ env.bicepRegistryDoPublish }}' - publishLatest: '${{ env.publishLatest }}' + uses: ./.github/workflows/template.module.yml + with: + workflowInput: '${{ needs.job_initialize_pipeline.outputs.workflowInput }}' + moduleTestFilePaths: '${{ needs.job_initialize_pipeline.outputs.moduleTestFilePaths }}' + modulePath: '${{ needs.job_initialize_pipeline.outputs.modulePath}}' + secrets: inherit diff --git a/.github/workflows/ms.insights.activitylogalerts.yml b/.github/workflows/ms.insights.activitylogalerts.yml index 8f3a7ff511..d250e94cfd 100644 --- a/.github/workflows/ms.insights.activitylogalerts.yml +++ b/.github/workflows/ms.insights.activitylogalerts.yml @@ -1,4 +1,4 @@ -name: 'Insights: ActivityLogAlerts' +name: 'Insights - ActivityLogAlerts' on: workflow_dispatch: @@ -28,6 +28,7 @@ on: - main paths: - '.github/actions/templates/**' + - '.github/workflows/template.module.yml' - '.github/workflows/ms.insights.activitylogalerts.yml' - 'modules/Microsoft.Insights/activityLogAlerts/**' - 'utilities/pipelines/**' @@ -35,14 +36,8 @@ on: - '!*/**/readme.md' env: - variablesPath: 'settings.yml' modulePath: 'modules/Microsoft.Insights/activityLogAlerts' workflowPath: '.github/workflows/ms.insights.activitylogalerts.yml' - AZURE_CREDENTIALS: ${{ secrets.AZURE_CREDENTIALS }} - ARM_SUBSCRIPTION_ID: '${{ secrets.ARM_SUBSCRIPTION_ID }}' - ARM_MGMTGROUP_ID: '${{ secrets.ARM_MGMTGROUP_ID }}' - ARM_TENANT_ID: '${{ secrets.ARM_TENANT_ID }}' - TOKEN_NAMEPREFIX: '${{ secrets.TOKEN_NAMEPREFIX }}' concurrency: group: ${{ github.workflow }} @@ -72,94 +67,19 @@ jobs: outputs: workflowInput: ${{ steps.get-workflow-param.outputs.workflowInput }} moduleTestFilePaths: ${{ steps.get-module-test-file-paths.outputs.moduleTestFilePaths }} + modulePath: '${{ env.modulePath }}' - ######################### - # Static validation # - ######################### - job_module_static_validation: - runs-on: ubuntu-20.04 - name: 'Static validation' - if: (fromJson(needs.job_initialize_pipeline.outputs.workflowInput)).staticValidation == 'true' - needs: - - job_initialize_pipeline - steps: - - name: 'Checkout' - uses: actions/checkout@v3 - with: - fetch-depth: 0 - - name: Set environment variables - uses: ./.github/actions/templates/setEnvironmentVariables - with: - variablesPath: ${{ env.variablesPath }} - - name: 'Run tests' - uses: ./.github/actions/templates/validateModulePester - with: - modulePath: '${{ env.modulePath }}' - moduleTestFilePath: '${{ env.moduleTestFilePath }}' - ############################# - # Deployment validation # - ############################# - job_module_deploy_validation: - runs-on: ubuntu-20.04 - name: 'Deploying' - if: | - !cancelled() && - (fromJson(needs.job_initialize_pipeline.outputs.workflowInput)).deploymentValidation == 'true' && - needs.job_module_static_validation.result != 'failure' + ############################## + # Call reusable workflow # + ############################## + call-workflow-passing-data: + name: 'Module' needs: - job_initialize_pipeline - - job_module_static_validation - strategy: - fail-fast: false - matrix: - moduleTestFilePaths: ${{ fromJson(needs.job_initialize_pipeline.outputs.moduleTestFilePaths) }} - steps: - - name: 'Checkout' - uses: actions/checkout@v3 - with: - fetch-depth: 0 - - name: Set environment variables - uses: ./.github/actions/templates/setEnvironmentVariables - with: - variablesPath: ${{ env.variablesPath }} - - name: 'Using test file [${{ matrix.moduleTestFilePaths }}]' - uses: ./.github/actions/templates/validateModuleDeployment - with: - templateFilePath: '${{ env.modulePath }}/${{ matrix.moduleTestFilePaths }}' - location: '${{ env.location }}' - subscriptionId: '${{ secrets.ARM_SUBSCRIPTION_ID }}' - managementGroupId: '${{ secrets.ARM_MGMTGROUP_ID }}' - removeDeployment: '${{ (fromJson(needs.job_initialize_pipeline.outputs.workflowInput)).removeDeployment }}' - - ################## - # Publishing # - ################## - job_publish_module: - name: 'Publishing' - if: github.ref == 'refs/heads/main' || github.ref == 'refs/heads/master' || github.event.inputs.prerelease == 'true' - runs-on: ubuntu-20.04 - needs: - - job_module_deploy_validation - steps: - - name: 'Checkout' - uses: actions/checkout@v3 - with: - fetch-depth: 0 - - name: Set environment variables - uses: ./.github/actions/templates/setEnvironmentVariables - with: - variablesPath: ${{ env.variablesPath }} - - name: 'Publishing' - uses: ./.github/actions/templates/publishModule - with: - templateFilePath: '${{ env.modulePath }}/deploy.bicep' - templateSpecsRGName: '${{ env.templateSpecsRGName }}' - templateSpecsRGLocation: '${{ env.templateSpecsRGLocation }}' - templateSpecsDescription: '${{ env.templateSpecsDescription }}' - templateSpecsDoPublish: '${{ env.templateSpecsDoPublish }}' - bicepRegistryName: '${{ env.bicepRegistryName }}' - bicepRegistryRGName: '${{ env.bicepRegistryRGName }}' - bicepRegistryRgLocation: '${{ env.bicepRegistryRgLocation }}' - bicepRegistryDoPublish: '${{ env.bicepRegistryDoPublish }}' - publishLatest: '${{ env.publishLatest }}' + uses: ./.github/workflows/template.module.yml + with: + workflowInput: '${{ needs.job_initialize_pipeline.outputs.workflowInput }}' + moduleTestFilePaths: '${{ needs.job_initialize_pipeline.outputs.moduleTestFilePaths }}' + modulePath: '${{ needs.job_initialize_pipeline.outputs.modulePath}}' + secrets: inherit diff --git a/.github/workflows/ms.insights.components.yml b/.github/workflows/ms.insights.components.yml index cb936c4756..c8ae81f101 100644 --- a/.github/workflows/ms.insights.components.yml +++ b/.github/workflows/ms.insights.components.yml @@ -1,4 +1,4 @@ -name: 'Insights: Components' +name: 'Insights - Components' on: workflow_dispatch: @@ -28,6 +28,7 @@ on: - main paths: - '.github/actions/templates/**' + - '.github/workflows/template.module.yml' - '.github/workflows/ms.insights.components.yml' - 'modules/Microsoft.Insights/components/**' - 'utilities/pipelines/**' @@ -35,14 +36,8 @@ on: - '!*/**/readme.md' env: - variablesPath: 'settings.yml' modulePath: 'modules/Microsoft.Insights/components' workflowPath: '.github/workflows/ms.insights.components.yml' - AZURE_CREDENTIALS: ${{ secrets.AZURE_CREDENTIALS }} - ARM_SUBSCRIPTION_ID: '${{ secrets.ARM_SUBSCRIPTION_ID }}' - ARM_MGMTGROUP_ID: '${{ secrets.ARM_MGMTGROUP_ID }}' - ARM_TENANT_ID: '${{ secrets.ARM_TENANT_ID }}' - TOKEN_NAMEPREFIX: '${{ secrets.TOKEN_NAMEPREFIX }}' concurrency: group: ${{ github.workflow }} @@ -72,94 +67,19 @@ jobs: outputs: workflowInput: ${{ steps.get-workflow-param.outputs.workflowInput }} moduleTestFilePaths: ${{ steps.get-module-test-file-paths.outputs.moduleTestFilePaths }} + modulePath: '${{ env.modulePath }}' - ######################### - # Static validation # - ######################### - job_module_static_validation: - runs-on: ubuntu-20.04 - name: 'Static validation' - if: (fromJson(needs.job_initialize_pipeline.outputs.workflowInput)).staticValidation == 'true' - needs: - - job_initialize_pipeline - steps: - - name: 'Checkout' - uses: actions/checkout@v3 - with: - fetch-depth: 0 - - name: Set environment variables - uses: ./.github/actions/templates/setEnvironmentVariables - with: - variablesPath: ${{ env.variablesPath }} - - name: 'Run tests' - uses: ./.github/actions/templates/validateModulePester - with: - modulePath: '${{ env.modulePath }}' - moduleTestFilePath: '${{ env.moduleTestFilePath }}' - ############################# - # Deployment validation # - ############################# - job_module_deploy_validation: - runs-on: ubuntu-20.04 - name: 'Deploying' - if: | - !cancelled() && - (fromJson(needs.job_initialize_pipeline.outputs.workflowInput)).deploymentValidation == 'true' && - needs.job_module_static_validation.result != 'failure' + ############################## + # Call reusable workflow # + ############################## + call-workflow-passing-data: + name: 'Module' needs: - job_initialize_pipeline - - job_module_static_validation - strategy: - fail-fast: false - matrix: - moduleTestFilePaths: ${{ fromJson(needs.job_initialize_pipeline.outputs.moduleTestFilePaths) }} - steps: - - name: 'Checkout' - uses: actions/checkout@v3 - with: - fetch-depth: 0 - - name: Set environment variables - uses: ./.github/actions/templates/setEnvironmentVariables - with: - variablesPath: ${{ env.variablesPath }} - - name: 'Using test file [${{ matrix.moduleTestFilePaths }}]' - uses: ./.github/actions/templates/validateModuleDeployment - with: - templateFilePath: '${{ env.modulePath }}/${{ matrix.moduleTestFilePaths }}' - location: '${{ env.location }}' - subscriptionId: '${{ secrets.ARM_SUBSCRIPTION_ID }}' - managementGroupId: '${{ secrets.ARM_MGMTGROUP_ID }}' - removeDeployment: '${{ (fromJson(needs.job_initialize_pipeline.outputs.workflowInput)).removeDeployment }}' - - ################## - # Publishing # - ################## - job_publish_module: - name: 'Publishing' - if: github.ref == 'refs/heads/main' || github.ref == 'refs/heads/master' || github.event.inputs.prerelease == 'true' - runs-on: ubuntu-20.04 - needs: - - job_module_deploy_validation - steps: - - name: 'Checkout' - uses: actions/checkout@v3 - with: - fetch-depth: 0 - - name: Set environment variables - uses: ./.github/actions/templates/setEnvironmentVariables - with: - variablesPath: ${{ env.variablesPath }} - - name: 'Publishing' - uses: ./.github/actions/templates/publishModule - with: - templateFilePath: '${{ env.modulePath }}/deploy.bicep' - templateSpecsRGName: '${{ env.templateSpecsRGName }}' - templateSpecsRGLocation: '${{ env.templateSpecsRGLocation }}' - templateSpecsDescription: '${{ env.templateSpecsDescription }}' - templateSpecsDoPublish: '${{ env.templateSpecsDoPublish }}' - bicepRegistryName: '${{ env.bicepRegistryName }}' - bicepRegistryRGName: '${{ env.bicepRegistryRGName }}' - bicepRegistryRgLocation: '${{ env.bicepRegistryRgLocation }}' - bicepRegistryDoPublish: '${{ env.bicepRegistryDoPublish }}' - publishLatest: '${{ env.publishLatest }}' + uses: ./.github/workflows/template.module.yml + with: + workflowInput: '${{ needs.job_initialize_pipeline.outputs.workflowInput }}' + moduleTestFilePaths: '${{ needs.job_initialize_pipeline.outputs.moduleTestFilePaths }}' + modulePath: '${{ needs.job_initialize_pipeline.outputs.modulePath}}' + secrets: inherit diff --git a/.github/workflows/ms.insights.datacollectionendpoints.yml b/.github/workflows/ms.insights.datacollectionendpoints.yml index 643164065a..e9d1d3414c 100644 --- a/.github/workflows/ms.insights.datacollectionendpoints.yml +++ b/.github/workflows/ms.insights.datacollectionendpoints.yml @@ -1,4 +1,4 @@ -name: 'Insights: DataCollectionEndpoints' +name: 'Insights - DataCollectionEndpoints' on: workflow_dispatch: @@ -28,6 +28,7 @@ on: - main paths: - '.github/actions/templates/**' + - '.github/workflows/template.module.yml' - '.github/workflows/ms.insights.datacollectionendpoints.yml' - 'modules/Microsoft.Insights/dataCollectionEndpoints/**' - 'utilities/pipelines/**' @@ -35,14 +36,8 @@ on: - '!*/**/readme.md' env: - variablesPath: 'settings.yml' modulePath: 'modules/Microsoft.Insights/dataCollectionEndpoints' workflowPath: '.github/workflows/ms.insights.datacollectionendpoints.yml' - AZURE_CREDENTIALS: ${{ secrets.AZURE_CREDENTIALS }} - ARM_SUBSCRIPTION_ID: '${{ secrets.ARM_SUBSCRIPTION_ID }}' - ARM_MGMTGROUP_ID: '${{ secrets.ARM_MGMTGROUP_ID }}' - ARM_TENANT_ID: '${{ secrets.ARM_TENANT_ID }}' - TOKEN_NAMEPREFIX: '${{ secrets.TOKEN_NAMEPREFIX }}' concurrency: group: ${{ github.workflow }} @@ -72,94 +67,19 @@ jobs: outputs: workflowInput: ${{ steps.get-workflow-param.outputs.workflowInput }} moduleTestFilePaths: ${{ steps.get-module-test-file-paths.outputs.moduleTestFilePaths }} + modulePath: '${{ env.modulePath }}' - ######################### - # Static validation # - ######################### - job_module_static_validation: - runs-on: ubuntu-20.04 - name: 'Static validation' - if: (fromJson(needs.job_initialize_pipeline.outputs.workflowInput)).staticValidation == 'true' - needs: - - job_initialize_pipeline - steps: - - name: 'Checkout' - uses: actions/checkout@v3 - with: - fetch-depth: 0 - - name: Set environment variables - uses: ./.github/actions/templates/setEnvironmentVariables - with: - variablesPath: ${{ env.variablesPath }} - - name: 'Run tests' - uses: ./.github/actions/templates/validateModulePester - with: - modulePath: '${{ env.modulePath }}' - moduleTestFilePath: '${{ env.moduleTestFilePath }}' - ############################# - # Deployment validation # - ############################# - job_module_deploy_validation: - runs-on: ubuntu-20.04 - name: 'Deploying' - if: | - !cancelled() && - (fromJson(needs.job_initialize_pipeline.outputs.workflowInput)).deploymentValidation == 'true' && - needs.job_module_static_validation.result != 'failure' + ############################## + # Call reusable workflow # + ############################## + call-workflow-passing-data: + name: 'Module' needs: - job_initialize_pipeline - - job_module_static_validation - strategy: - fail-fast: false - matrix: - moduleTestFilePaths: ${{ fromJson(needs.job_initialize_pipeline.outputs.moduleTestFilePaths) }} - steps: - - name: 'Checkout' - uses: actions/checkout@v3 - with: - fetch-depth: 0 - - name: Set environment variables - uses: ./.github/actions/templates/setEnvironmentVariables - with: - variablesPath: ${{ env.variablesPath }} - - name: 'Using test file [${{ matrix.moduleTestFilePaths }}]' - uses: ./.github/actions/templates/validateModuleDeployment - with: - templateFilePath: '${{ env.modulePath }}/${{ matrix.moduleTestFilePaths }}' - location: '${{ env.location }}' - subscriptionId: '${{ secrets.ARM_SUBSCRIPTION_ID }}' - managementGroupId: '${{ secrets.ARM_MGMTGROUP_ID }}' - removeDeployment: '${{ (fromJson(needs.job_initialize_pipeline.outputs.workflowInput)).removeDeployment }}' - - ################## - # Publishing # - ################## - job_publish_module: - name: 'Publishing' - if: github.ref == 'refs/heads/main' || github.ref == 'refs/heads/master' || github.event.inputs.prerelease == 'true' - runs-on: ubuntu-20.04 - needs: - - job_module_deploy_validation - steps: - - name: 'Checkout' - uses: actions/checkout@v3 - with: - fetch-depth: 0 - - name: Set environment variables - uses: ./.github/actions/templates/setEnvironmentVariables - with: - variablesPath: ${{ env.variablesPath }} - - name: 'Publishing' - uses: ./.github/actions/templates/publishModule - with: - templateFilePath: '${{ env.modulePath }}/deploy.bicep' - templateSpecsRGName: '${{ env.templateSpecsRGName }}' - templateSpecsRGLocation: '${{ env.templateSpecsRGLocation }}' - templateSpecsDescription: '${{ env.templateSpecsDescription }}' - templateSpecsDoPublish: '${{ env.templateSpecsDoPublish }}' - bicepRegistryName: '${{ env.bicepRegistryName }}' - bicepRegistryRGName: '${{ env.bicepRegistryRGName }}' - bicepRegistryRgLocation: '${{ env.bicepRegistryRgLocation }}' - bicepRegistryDoPublish: '${{ env.bicepRegistryDoPublish }}' - publishLatest: '${{ env.publishLatest }}' + uses: ./.github/workflows/template.module.yml + with: + workflowInput: '${{ needs.job_initialize_pipeline.outputs.workflowInput }}' + moduleTestFilePaths: '${{ needs.job_initialize_pipeline.outputs.moduleTestFilePaths }}' + modulePath: '${{ needs.job_initialize_pipeline.outputs.modulePath}}' + secrets: inherit diff --git a/.github/workflows/ms.insights.datacollectionrules.yml b/.github/workflows/ms.insights.datacollectionrules.yml index 8e11fc92d5..b6b836c139 100644 --- a/.github/workflows/ms.insights.datacollectionrules.yml +++ b/.github/workflows/ms.insights.datacollectionrules.yml @@ -1,4 +1,4 @@ -name: 'Insights: DataCollectionRules' +name: 'Insights - DataCollectionRules' on: workflow_dispatch: @@ -28,6 +28,7 @@ on: - main paths: - '.github/actions/templates/**' + - '.github/workflows/template.module.yml' - '.github/workflows/ms.insights.datacollectionrules.yml' - 'modules/Microsoft.Insights/dataCollectionRules/**' - 'utilities/pipelines/**' @@ -35,14 +36,8 @@ on: - '!*/**/readme.md' env: - variablesPath: 'settings.yml' modulePath: 'modules/Microsoft.Insights/dataCollectionRules' workflowPath: '.github/workflows/ms.insights.datacollectionrules.yml' - AZURE_CREDENTIALS: ${{ secrets.AZURE_CREDENTIALS }} - ARM_SUBSCRIPTION_ID: '${{ secrets.ARM_SUBSCRIPTION_ID }}' - ARM_MGMTGROUP_ID: '${{ secrets.ARM_MGMTGROUP_ID }}' - ARM_TENANT_ID: '${{ secrets.ARM_TENANT_ID }}' - TOKEN_NAMEPREFIX: '${{ secrets.TOKEN_NAMEPREFIX }}' concurrency: group: ${{ github.workflow }} @@ -72,94 +67,19 @@ jobs: outputs: workflowInput: ${{ steps.get-workflow-param.outputs.workflowInput }} moduleTestFilePaths: ${{ steps.get-module-test-file-paths.outputs.moduleTestFilePaths }} + modulePath: '${{ env.modulePath }}' - ######################### - # Static validation # - ######################### - job_module_static_validation: - runs-on: ubuntu-20.04 - name: 'Static validation' - if: (fromJson(needs.job_initialize_pipeline.outputs.workflowInput)).staticValidation == 'true' - needs: - - job_initialize_pipeline - steps: - - name: 'Checkout' - uses: actions/checkout@v3 - with: - fetch-depth: 0 - - name: Set environment variables - uses: ./.github/actions/templates/setEnvironmentVariables - with: - variablesPath: ${{ env.variablesPath }} - - name: 'Run tests' - uses: ./.github/actions/templates/validateModulePester - with: - modulePath: '${{ env.modulePath }}' - moduleTestFilePath: '${{ env.moduleTestFilePath }}' - ############################# - # Deployment validation # - ############################# - job_module_deploy_validation: - runs-on: ubuntu-20.04 - name: 'Deploying' - if: | - !cancelled() && - (fromJson(needs.job_initialize_pipeline.outputs.workflowInput)).deploymentValidation == 'true' && - needs.job_module_static_validation.result != 'failure' + ############################## + # Call reusable workflow # + ############################## + call-workflow-passing-data: + name: 'Module' needs: - job_initialize_pipeline - - job_module_static_validation - strategy: - fail-fast: false - matrix: - moduleTestFilePaths: ${{ fromJson(needs.job_initialize_pipeline.outputs.moduleTestFilePaths) }} - steps: - - name: 'Checkout' - uses: actions/checkout@v3 - with: - fetch-depth: 0 - - name: Set environment variables - uses: ./.github/actions/templates/setEnvironmentVariables - with: - variablesPath: ${{ env.variablesPath }} - - name: 'Using test file [${{ matrix.moduleTestFilePaths }}]' - uses: ./.github/actions/templates/validateModuleDeployment - with: - templateFilePath: '${{ env.modulePath }}/${{ matrix.moduleTestFilePaths }}' - location: '${{ env.location }}' - subscriptionId: '${{ secrets.ARM_SUBSCRIPTION_ID }}' - managementGroupId: '${{ secrets.ARM_MGMTGROUP_ID }}' - removeDeployment: '${{ (fromJson(needs.job_initialize_pipeline.outputs.workflowInput)).removeDeployment }}' - - ################## - # Publishing # - ################## - job_publish_module: - name: 'Publishing' - if: github.ref == 'refs/heads/main' || github.ref == 'refs/heads/master' || github.event.inputs.prerelease == 'true' - runs-on: ubuntu-20.04 - needs: - - job_module_deploy_validation - steps: - - name: 'Checkout' - uses: actions/checkout@v3 - with: - fetch-depth: 0 - - name: Set environment variables - uses: ./.github/actions/templates/setEnvironmentVariables - with: - variablesPath: ${{ env.variablesPath }} - - name: 'Publishing' - uses: ./.github/actions/templates/publishModule - with: - templateFilePath: '${{ env.modulePath }}/deploy.bicep' - templateSpecsRGName: '${{ env.templateSpecsRGName }}' - templateSpecsRGLocation: '${{ env.templateSpecsRGLocation }}' - templateSpecsDescription: '${{ env.templateSpecsDescription }}' - templateSpecsDoPublish: '${{ env.templateSpecsDoPublish }}' - bicepRegistryName: '${{ env.bicepRegistryName }}' - bicepRegistryRGName: '${{ env.bicepRegistryRGName }}' - bicepRegistryRgLocation: '${{ env.bicepRegistryRgLocation }}' - bicepRegistryDoPublish: '${{ env.bicepRegistryDoPublish }}' - publishLatest: '${{ env.publishLatest }}' + uses: ./.github/workflows/template.module.yml + with: + workflowInput: '${{ needs.job_initialize_pipeline.outputs.workflowInput }}' + moduleTestFilePaths: '${{ needs.job_initialize_pipeline.outputs.moduleTestFilePaths }}' + modulePath: '${{ needs.job_initialize_pipeline.outputs.modulePath}}' + secrets: inherit diff --git a/.github/workflows/ms.insights.diagnosticsettings.yml b/.github/workflows/ms.insights.diagnosticsettings.yml index 23783d532e..a47907e58c 100644 --- a/.github/workflows/ms.insights.diagnosticsettings.yml +++ b/.github/workflows/ms.insights.diagnosticsettings.yml @@ -1,4 +1,4 @@ -name: 'Insights: DiagnosticSettings' +name: 'Insights - DiagnosticSettings' on: workflow_dispatch: @@ -28,6 +28,7 @@ on: - main paths: - '.github/actions/templates/**' + - '.github/workflows/template.module.yml' - '.github/workflows/ms.insights.diagnosticsettings.yml' - 'modules/Microsoft.Insights/diagnosticsettings/**' - 'utilities/pipelines/**' @@ -35,14 +36,8 @@ on: - '!*/**/readme.md' env: - variablesPath: 'settings.yml' modulePath: 'modules/Microsoft.Insights/diagnosticSettings' workflowPath: '.github/workflows/ms.insights.diagnosticsettings.yml' - AZURE_CREDENTIALS: ${{ secrets.AZURE_CREDENTIALS }} - ARM_SUBSCRIPTION_ID: '${{ secrets.ARM_SUBSCRIPTION_ID }}' - ARM_MGMTGROUP_ID: '${{ secrets.ARM_MGMTGROUP_ID }}' - ARM_TENANT_ID: '${{ secrets.ARM_TENANT_ID }}' - TOKEN_NAMEPREFIX: '${{ secrets.TOKEN_NAMEPREFIX }}' concurrency: group: ${{ github.workflow }} @@ -72,94 +67,19 @@ jobs: outputs: workflowInput: ${{ steps.get-workflow-param.outputs.workflowInput }} moduleTestFilePaths: ${{ steps.get-module-test-file-paths.outputs.moduleTestFilePaths }} + modulePath: '${{ env.modulePath }}' - ######################### - # Static validation # - ######################### - job_module_static_validation: - runs-on: ubuntu-20.04 - name: 'Static validation' - if: (fromJson(needs.job_initialize_pipeline.outputs.workflowInput)).staticValidation == 'true' - needs: - - job_initialize_pipeline - steps: - - name: 'Checkout' - uses: actions/checkout@v3 - with: - fetch-depth: 0 - - name: Set environment variables - uses: ./.github/actions/templates/setEnvironmentVariables - with: - variablesPath: ${{ env.variablesPath }} - - name: 'Run tests' - uses: ./.github/actions/templates/validateModulePester - with: - modulePath: '${{ env.modulePath }}' - moduleTestFilePath: '${{ env.moduleTestFilePath }}' - ############################# - # Deployment validation # - ############################# - job_module_deploy_validation: - runs-on: ubuntu-20.04 - name: 'Deploying' - if: | - !cancelled() && - (fromJson(needs.job_initialize_pipeline.outputs.workflowInput)).deploymentValidation == 'true' && - needs.job_module_static_validation.result != 'failure' + ############################## + # Call reusable workflow # + ############################## + call-workflow-passing-data: + name: 'Module' needs: - job_initialize_pipeline - - job_module_static_validation - strategy: - fail-fast: false - matrix: - moduleTestFilePaths: ${{ fromJson(needs.job_initialize_pipeline.outputs.moduleTestFilePaths) }} - steps: - - name: 'Checkout' - uses: actions/checkout@v3 - with: - fetch-depth: 0 - - name: Set environment variables - uses: ./.github/actions/templates/setEnvironmentVariables - with: - variablesPath: ${{ env.variablesPath }} - - name: 'Using test file [${{ matrix.moduleTestFilePaths }}]' - uses: ./.github/actions/templates/validateModuleDeployment - with: - templateFilePath: '${{ env.modulePath }}/${{ matrix.moduleTestFilePaths }}' - location: '${{ env.location }}' - subscriptionId: '${{ secrets.ARM_SUBSCRIPTION_ID }}' - managementGroupId: '${{ secrets.ARM_MGMTGROUP_ID }}' - removeDeployment: '${{ (fromJson(needs.job_initialize_pipeline.outputs.workflowInput)).removeDeployment }}' - - ################## - # Publishing # - ################## - job_publish_module: - name: 'Publishing' - if: github.ref == 'refs/heads/main' || github.ref == 'refs/heads/master' || github.event.inputs.prerelease == 'true' - runs-on: ubuntu-20.04 - needs: - - job_module_deploy_validation - steps: - - name: 'Checkout' - uses: actions/checkout@v3 - with: - fetch-depth: 0 - - name: Set environment variables - uses: ./.github/actions/templates/setEnvironmentVariables - with: - variablesPath: ${{ env.variablesPath }} - - name: 'Publishing' - uses: ./.github/actions/templates/publishModule - with: - templateFilePath: '${{ env.modulePath }}/deploy.bicep' - templateSpecsRGName: '${{ env.templateSpecsRGName }}' - templateSpecsRGLocation: '${{ env.templateSpecsRGLocation }}' - templateSpecsDescription: '${{ env.templateSpecsDescription }}' - templateSpecsDoPublish: '${{ env.templateSpecsDoPublish }}' - bicepRegistryName: '${{ env.bicepRegistryName }}' - bicepRegistryRGName: '${{ env.bicepRegistryRGName }}' - bicepRegistryRgLocation: '${{ env.bicepRegistryRgLocation }}' - bicepRegistryDoPublish: '${{ env.bicepRegistryDoPublish }}' - publishLatest: '${{ env.publishLatest }}' + uses: ./.github/workflows/template.module.yml + with: + workflowInput: '${{ needs.job_initialize_pipeline.outputs.workflowInput }}' + moduleTestFilePaths: '${{ needs.job_initialize_pipeline.outputs.moduleTestFilePaths }}' + modulePath: '${{ needs.job_initialize_pipeline.outputs.modulePath}}' + secrets: inherit diff --git a/.github/workflows/ms.insights.metricalerts.yml b/.github/workflows/ms.insights.metricalerts.yml index 5a35d1d3f5..d34dcfa910 100644 --- a/.github/workflows/ms.insights.metricalerts.yml +++ b/.github/workflows/ms.insights.metricalerts.yml @@ -1,4 +1,4 @@ -name: 'Insights: MetricAlerts' +name: 'Insights - MetricAlerts' on: workflow_dispatch: @@ -28,6 +28,7 @@ on: - main paths: - '.github/actions/templates/**' + - '.github/workflows/template.module.yml' - '.github/workflows/ms.insights.metricalerts.yml' - 'modules/Microsoft.Insights/metricAlerts/**' - 'utilities/pipelines/**' @@ -35,14 +36,8 @@ on: - '!*/**/readme.md' env: - variablesPath: 'settings.yml' modulePath: 'modules/Microsoft.Insights/metricAlerts' workflowPath: '.github/workflows/ms.insights.metricalerts.yml' - AZURE_CREDENTIALS: ${{ secrets.AZURE_CREDENTIALS }} - ARM_SUBSCRIPTION_ID: '${{ secrets.ARM_SUBSCRIPTION_ID }}' - ARM_MGMTGROUP_ID: '${{ secrets.ARM_MGMTGROUP_ID }}' - ARM_TENANT_ID: '${{ secrets.ARM_TENANT_ID }}' - TOKEN_NAMEPREFIX: '${{ secrets.TOKEN_NAMEPREFIX }}' concurrency: group: ${{ github.workflow }} @@ -72,94 +67,19 @@ jobs: outputs: workflowInput: ${{ steps.get-workflow-param.outputs.workflowInput }} moduleTestFilePaths: ${{ steps.get-module-test-file-paths.outputs.moduleTestFilePaths }} + modulePath: '${{ env.modulePath }}' - ######################### - # Static validation # - ######################### - job_module_static_validation: - runs-on: ubuntu-20.04 - name: 'Static validation' - if: (fromJson(needs.job_initialize_pipeline.outputs.workflowInput)).staticValidation == 'true' - needs: - - job_initialize_pipeline - steps: - - name: 'Checkout' - uses: actions/checkout@v3 - with: - fetch-depth: 0 - - name: Set environment variables - uses: ./.github/actions/templates/setEnvironmentVariables - with: - variablesPath: ${{ env.variablesPath }} - - name: 'Run tests' - uses: ./.github/actions/templates/validateModulePester - with: - modulePath: '${{ env.modulePath }}' - moduleTestFilePath: '${{ env.moduleTestFilePath }}' - ############################# - # Deployment validation # - ############################# - job_module_deploy_validation: - runs-on: ubuntu-20.04 - name: 'Deploying' - if: | - !cancelled() && - (fromJson(needs.job_initialize_pipeline.outputs.workflowInput)).deploymentValidation == 'true' && - needs.job_module_static_validation.result != 'failure' + ############################## + # Call reusable workflow # + ############################## + call-workflow-passing-data: + name: 'Module' needs: - job_initialize_pipeline - - job_module_static_validation - strategy: - fail-fast: false - matrix: - moduleTestFilePaths: ${{ fromJson(needs.job_initialize_pipeline.outputs.moduleTestFilePaths) }} - steps: - - name: 'Checkout' - uses: actions/checkout@v3 - with: - fetch-depth: 0 - - name: Set environment variables - uses: ./.github/actions/templates/setEnvironmentVariables - with: - variablesPath: ${{ env.variablesPath }} - - name: 'Using test file [${{ matrix.moduleTestFilePaths }}]' - uses: ./.github/actions/templates/validateModuleDeployment - with: - templateFilePath: '${{ env.modulePath }}/${{ matrix.moduleTestFilePaths }}' - location: '${{ env.location }}' - subscriptionId: '${{ secrets.ARM_SUBSCRIPTION_ID }}' - managementGroupId: '${{ secrets.ARM_MGMTGROUP_ID }}' - removeDeployment: '${{ (fromJson(needs.job_initialize_pipeline.outputs.workflowInput)).removeDeployment }}' - - ################## - # Publishing # - ################## - job_publish_module: - name: 'Publishing' - if: github.ref == 'refs/heads/main' || github.ref == 'refs/heads/master' || github.event.inputs.prerelease == 'true' - runs-on: ubuntu-20.04 - needs: - - job_module_deploy_validation - steps: - - name: 'Checkout' - uses: actions/checkout@v3 - with: - fetch-depth: 0 - - name: Set environment variables - uses: ./.github/actions/templates/setEnvironmentVariables - with: - variablesPath: ${{ env.variablesPath }} - - name: 'Publishing' - uses: ./.github/actions/templates/publishModule - with: - templateFilePath: '${{ env.modulePath }}/deploy.bicep' - templateSpecsRGName: '${{ env.templateSpecsRGName }}' - templateSpecsRGLocation: '${{ env.templateSpecsRGLocation }}' - templateSpecsDescription: '${{ env.templateSpecsDescription }}' - templateSpecsDoPublish: '${{ env.templateSpecsDoPublish }}' - bicepRegistryName: '${{ env.bicepRegistryName }}' - bicepRegistryRGName: '${{ env.bicepRegistryRGName }}' - bicepRegistryRgLocation: '${{ env.bicepRegistryRgLocation }}' - bicepRegistryDoPublish: '${{ env.bicepRegistryDoPublish }}' - publishLatest: '${{ env.publishLatest }}' + uses: ./.github/workflows/template.module.yml + with: + workflowInput: '${{ needs.job_initialize_pipeline.outputs.workflowInput }}' + moduleTestFilePaths: '${{ needs.job_initialize_pipeline.outputs.moduleTestFilePaths }}' + modulePath: '${{ needs.job_initialize_pipeline.outputs.modulePath}}' + secrets: inherit diff --git a/.github/workflows/ms.insights.privatelinkscopes.yml b/.github/workflows/ms.insights.privatelinkscopes.yml index 45a9fed005..0b147b2c1d 100644 --- a/.github/workflows/ms.insights.privatelinkscopes.yml +++ b/.github/workflows/ms.insights.privatelinkscopes.yml @@ -1,4 +1,4 @@ -name: 'Insights: PrivateLinkScopes' +name: 'Insights - PrivateLinkScopes' on: workflow_dispatch: @@ -28,6 +28,7 @@ on: - main paths: - '.github/actions/templates/**' + - '.github/workflows/template.module.yml' - '.github/workflows/ms.insights.privatelinkscopes.yml' - 'modules/Microsoft.Insights/privateLinkScopes/**' - 'utilities/pipelines/**' @@ -35,14 +36,8 @@ on: - '!*/**/readme.md' env: - variablesPath: 'settings.yml' modulePath: 'modules/Microsoft.Insights/privateLinkScopes' workflowPath: '.github/workflows/ms.insights.privatelinkscopes.yml' - AZURE_CREDENTIALS: ${{ secrets.AZURE_CREDENTIALS }} - ARM_SUBSCRIPTION_ID: '${{ secrets.ARM_SUBSCRIPTION_ID }}' - ARM_MGMTGROUP_ID: '${{ secrets.ARM_MGMTGROUP_ID }}' - ARM_TENANT_ID: '${{ secrets.ARM_TENANT_ID }}' - TOKEN_NAMEPREFIX: '${{ secrets.TOKEN_NAMEPREFIX }}' concurrency: group: ${{ github.workflow }} @@ -72,94 +67,19 @@ jobs: outputs: workflowInput: ${{ steps.get-workflow-param.outputs.workflowInput }} moduleTestFilePaths: ${{ steps.get-module-test-file-paths.outputs.moduleTestFilePaths }} + modulePath: '${{ env.modulePath }}' - ######################### - # Static validation # - ######################### - job_module_static_validation: - runs-on: ubuntu-20.04 - name: 'Static validation' - if: (fromJson(needs.job_initialize_pipeline.outputs.workflowInput)).staticValidation == 'true' - needs: - - job_initialize_pipeline - steps: - - name: 'Checkout' - uses: actions/checkout@v3 - with: - fetch-depth: 0 - - name: Set environment variables - uses: ./.github/actions/templates/setEnvironmentVariables - with: - variablesPath: ${{ env.variablesPath }} - - name: 'Run tests' - uses: ./.github/actions/templates/validateModulePester - with: - modulePath: '${{ env.modulePath }}' - moduleTestFilePath: '${{ env.moduleTestFilePath }}' - ############################# - # Deployment validation # - ############################# - job_module_deploy_validation: - runs-on: ubuntu-20.04 - name: 'Deploying' - if: | - !cancelled() && - (fromJson(needs.job_initialize_pipeline.outputs.workflowInput)).deploymentValidation == 'true' && - needs.job_module_static_validation.result != 'failure' + ############################## + # Call reusable workflow # + ############################## + call-workflow-passing-data: + name: 'Module' needs: - job_initialize_pipeline - - job_module_static_validation - strategy: - fail-fast: false - matrix: - moduleTestFilePaths: ${{ fromJson(needs.job_initialize_pipeline.outputs.moduleTestFilePaths) }} - steps: - - name: 'Checkout' - uses: actions/checkout@v3 - with: - fetch-depth: 0 - - name: Set environment variables - uses: ./.github/actions/templates/setEnvironmentVariables - with: - variablesPath: ${{ env.variablesPath }} - - name: 'Using test file [${{ matrix.moduleTestFilePaths }}]' - uses: ./.github/actions/templates/validateModuleDeployment - with: - templateFilePath: '${{ env.modulePath }}/${{ matrix.moduleTestFilePaths }}' - location: '${{ env.location }}' - subscriptionId: '${{ secrets.ARM_SUBSCRIPTION_ID }}' - managementGroupId: '${{ secrets.ARM_MGMTGROUP_ID }}' - removeDeployment: '${{ (fromJson(needs.job_initialize_pipeline.outputs.workflowInput)).removeDeployment }}' - - ################## - # Publishing # - ################## - job_publish_module: - name: 'Publishing' - if: github.ref == 'refs/heads/main' || github.ref == 'refs/heads/master' || github.event.inputs.prerelease == 'true' - runs-on: ubuntu-20.04 - needs: - - job_module_deploy_validation - steps: - - name: 'Checkout' - uses: actions/checkout@v3 - with: - fetch-depth: 0 - - name: Set environment variables - uses: ./.github/actions/templates/setEnvironmentVariables - with: - variablesPath: ${{ env.variablesPath }} - - name: 'Publishing' - uses: ./.github/actions/templates/publishModule - with: - templateFilePath: '${{ env.modulePath }}/deploy.bicep' - templateSpecsRGName: '${{ env.templateSpecsRGName }}' - templateSpecsRGLocation: '${{ env.templateSpecsRGLocation }}' - templateSpecsDescription: '${{ env.templateSpecsDescription }}' - templateSpecsDoPublish: '${{ env.templateSpecsDoPublish }}' - bicepRegistryName: '${{ env.bicepRegistryName }}' - bicepRegistryRGName: '${{ env.bicepRegistryRGName }}' - bicepRegistryRgLocation: '${{ env.bicepRegistryRgLocation }}' - bicepRegistryDoPublish: '${{ env.bicepRegistryDoPublish }}' - publishLatest: '${{ env.publishLatest }}' + uses: ./.github/workflows/template.module.yml + with: + workflowInput: '${{ needs.job_initialize_pipeline.outputs.workflowInput }}' + moduleTestFilePaths: '${{ needs.job_initialize_pipeline.outputs.moduleTestFilePaths }}' + modulePath: '${{ needs.job_initialize_pipeline.outputs.modulePath}}' + secrets: inherit diff --git a/.github/workflows/ms.insights.scheduledqueryrules.yml b/.github/workflows/ms.insights.scheduledqueryrules.yml index ab93b02c0d..708793f628 100644 --- a/.github/workflows/ms.insights.scheduledqueryrules.yml +++ b/.github/workflows/ms.insights.scheduledqueryrules.yml @@ -1,4 +1,4 @@ -name: 'Insights: ScheduledQueryRules' +name: 'Insights - ScheduledQueryRules' on: workflow_dispatch: @@ -28,6 +28,7 @@ on: - main paths: - '.github/actions/templates/**' + - '.github/workflows/template.module.yml' - '.github/workflows/ms.insights.scheduledqueryrules.yml' - 'modules/Microsoft.Insights/scheduledQueryRules/**' - 'utilities/pipelines/**' @@ -35,14 +36,8 @@ on: - '!*/**/readme.md' env: - variablesPath: 'settings.yml' modulePath: 'modules/Microsoft.Insights/scheduledQueryRules' workflowPath: '.github/workflows/ms.insights.scheduledqueryrules.yml' - AZURE_CREDENTIALS: ${{ secrets.AZURE_CREDENTIALS }} - ARM_SUBSCRIPTION_ID: '${{ secrets.ARM_SUBSCRIPTION_ID }}' - ARM_MGMTGROUP_ID: '${{ secrets.ARM_MGMTGROUP_ID }}' - ARM_TENANT_ID: '${{ secrets.ARM_TENANT_ID }}' - TOKEN_NAMEPREFIX: '${{ secrets.TOKEN_NAMEPREFIX }}' concurrency: group: ${{ github.workflow }} @@ -72,94 +67,19 @@ jobs: outputs: workflowInput: ${{ steps.get-workflow-param.outputs.workflowInput }} moduleTestFilePaths: ${{ steps.get-module-test-file-paths.outputs.moduleTestFilePaths }} + modulePath: '${{ env.modulePath }}' - ######################### - # Static validation # - ######################### - job_module_static_validation: - runs-on: ubuntu-20.04 - name: 'Static validation' - if: (fromJson(needs.job_initialize_pipeline.outputs.workflowInput)).staticValidation == 'true' - needs: - - job_initialize_pipeline - steps: - - name: 'Checkout' - uses: actions/checkout@v3 - with: - fetch-depth: 0 - - name: Set environment variables - uses: ./.github/actions/templates/setEnvironmentVariables - with: - variablesPath: ${{ env.variablesPath }} - - name: 'Run tests' - uses: ./.github/actions/templates/validateModulePester - with: - modulePath: '${{ env.modulePath }}' - moduleTestFilePath: '${{ env.moduleTestFilePath }}' - ############################# - # Deployment validation # - ############################# - job_module_deploy_validation: - runs-on: ubuntu-20.04 - name: 'Deploying' - if: | - !cancelled() && - (fromJson(needs.job_initialize_pipeline.outputs.workflowInput)).deploymentValidation == 'true' && - needs.job_module_static_validation.result != 'failure' + ############################## + # Call reusable workflow # + ############################## + call-workflow-passing-data: + name: 'Module' needs: - job_initialize_pipeline - - job_module_static_validation - strategy: - fail-fast: false - matrix: - moduleTestFilePaths: ${{ fromJson(needs.job_initialize_pipeline.outputs.moduleTestFilePaths) }} - steps: - - name: 'Checkout' - uses: actions/checkout@v3 - with: - fetch-depth: 0 - - name: Set environment variables - uses: ./.github/actions/templates/setEnvironmentVariables - with: - variablesPath: ${{ env.variablesPath }} - - name: 'Using test file [${{ matrix.moduleTestFilePaths }}]' - uses: ./.github/actions/templates/validateModuleDeployment - with: - templateFilePath: '${{ env.modulePath }}/${{ matrix.moduleTestFilePaths }}' - location: '${{ env.location }}' - subscriptionId: '${{ secrets.ARM_SUBSCRIPTION_ID }}' - managementGroupId: '${{ secrets.ARM_MGMTGROUP_ID }}' - removeDeployment: '${{ (fromJson(needs.job_initialize_pipeline.outputs.workflowInput)).removeDeployment }}' - - ################## - # Publishing # - ################## - job_publish_module: - name: 'Publishing' - if: github.ref == 'refs/heads/main' || github.ref == 'refs/heads/master' || github.event.inputs.prerelease == 'true' - runs-on: ubuntu-20.04 - needs: - - job_module_deploy_validation - steps: - - name: 'Checkout' - uses: actions/checkout@v3 - with: - fetch-depth: 0 - - name: Set environment variables - uses: ./.github/actions/templates/setEnvironmentVariables - with: - variablesPath: ${{ env.variablesPath }} - - name: 'Publishing' - uses: ./.github/actions/templates/publishModule - with: - templateFilePath: '${{ env.modulePath }}/deploy.bicep' - templateSpecsRGName: '${{ env.templateSpecsRGName }}' - templateSpecsRGLocation: '${{ env.templateSpecsRGLocation }}' - templateSpecsDescription: '${{ env.templateSpecsDescription }}' - templateSpecsDoPublish: '${{ env.templateSpecsDoPublish }}' - bicepRegistryName: '${{ env.bicepRegistryName }}' - bicepRegistryRGName: '${{ env.bicepRegistryRGName }}' - bicepRegistryRgLocation: '${{ env.bicepRegistryRgLocation }}' - bicepRegistryDoPublish: '${{ env.bicepRegistryDoPublish }}' - publishLatest: '${{ env.publishLatest }}' + uses: ./.github/workflows/template.module.yml + with: + workflowInput: '${{ needs.job_initialize_pipeline.outputs.workflowInput }}' + moduleTestFilePaths: '${{ needs.job_initialize_pipeline.outputs.moduleTestFilePaths }}' + modulePath: '${{ needs.job_initialize_pipeline.outputs.modulePath}}' + secrets: inherit diff --git a/.github/workflows/ms.keyvault.vaults.yml b/.github/workflows/ms.keyvault.vaults.yml index e94ff60d14..a45960cbd8 100644 --- a/.github/workflows/ms.keyvault.vaults.yml +++ b/.github/workflows/ms.keyvault.vaults.yml @@ -1,4 +1,4 @@ -name: 'KeyVault: Vaults' +name: 'KeyVault - Vaults' on: workflow_dispatch: @@ -28,6 +28,7 @@ on: - main paths: - '.github/actions/templates/**' + - '.github/workflows/template.module.yml' - '.github/workflows/ms.keyvault.vaults.yml' - 'modules/Microsoft.KeyVault/vaults/**' - 'utilities/pipelines/**' @@ -35,14 +36,8 @@ on: - '!*/**/readme.md' env: - variablesPath: 'settings.yml' modulePath: 'modules/Microsoft.KeyVault/vaults' workflowPath: '.github/workflows/ms.keyvault.vaults.yml' - AZURE_CREDENTIALS: ${{ secrets.AZURE_CREDENTIALS }} - ARM_SUBSCRIPTION_ID: '${{ secrets.ARM_SUBSCRIPTION_ID }}' - ARM_MGMTGROUP_ID: '${{ secrets.ARM_MGMTGROUP_ID }}' - ARM_TENANT_ID: '${{ secrets.ARM_TENANT_ID }}' - TOKEN_NAMEPREFIX: '${{ secrets.TOKEN_NAMEPREFIX }}' concurrency: group: ${{ github.workflow }} @@ -72,94 +67,19 @@ jobs: outputs: workflowInput: ${{ steps.get-workflow-param.outputs.workflowInput }} moduleTestFilePaths: ${{ steps.get-module-test-file-paths.outputs.moduleTestFilePaths }} + modulePath: '${{ env.modulePath }}' - ######################### - # Static validation # - ######################### - job_module_static_validation: - runs-on: ubuntu-20.04 - name: 'Static validation' - if: (fromJson(needs.job_initialize_pipeline.outputs.workflowInput)).staticValidation == 'true' - needs: - - job_initialize_pipeline - steps: - - name: 'Checkout' - uses: actions/checkout@v3 - with: - fetch-depth: 0 - - name: Set environment variables - uses: ./.github/actions/templates/setEnvironmentVariables - with: - variablesPath: ${{ env.variablesPath }} - - name: 'Run tests' - uses: ./.github/actions/templates/validateModulePester - with: - modulePath: '${{ env.modulePath }}' - moduleTestFilePath: '${{ env.moduleTestFilePath }}' - ############################# - # Deployment validation # - ############################# - job_module_deploy_validation: - runs-on: ubuntu-20.04 - name: 'Deploying' - if: | - !cancelled() && - (fromJson(needs.job_initialize_pipeline.outputs.workflowInput)).deploymentValidation == 'true' && - needs.job_module_static_validation.result != 'failure' + ############################## + # Call reusable workflow # + ############################## + call-workflow-passing-data: + name: 'Module' needs: - job_initialize_pipeline - - job_module_static_validation - strategy: - fail-fast: false - matrix: - moduleTestFilePaths: ${{ fromJson(needs.job_initialize_pipeline.outputs.moduleTestFilePaths) }} - steps: - - name: 'Checkout' - uses: actions/checkout@v3 - with: - fetch-depth: 0 - - name: Set environment variables - uses: ./.github/actions/templates/setEnvironmentVariables - with: - variablesPath: ${{ env.variablesPath }} - - name: 'Using test file [${{ matrix.moduleTestFilePaths }}]' - uses: ./.github/actions/templates/validateModuleDeployment - with: - templateFilePath: '${{ env.modulePath }}/${{ matrix.moduleTestFilePaths }}' - location: '${{ env.location }}' - subscriptionId: '${{ secrets.ARM_SUBSCRIPTION_ID }}' - managementGroupId: '${{ secrets.ARM_MGMTGROUP_ID }}' - removeDeployment: '${{ (fromJson(needs.job_initialize_pipeline.outputs.workflowInput)).removeDeployment }}' - - ################## - # Publishing # - ################## - job_publish_module: - name: 'Publishing' - if: github.ref == 'refs/heads/main' || github.ref == 'refs/heads/master' || github.event.inputs.prerelease == 'true' - runs-on: ubuntu-20.04 - needs: - - job_module_deploy_validation - steps: - - name: 'Checkout' - uses: actions/checkout@v3 - with: - fetch-depth: 0 - - name: Set environment variables - uses: ./.github/actions/templates/setEnvironmentVariables - with: - variablesPath: ${{ env.variablesPath }} - - name: 'Publishing' - uses: ./.github/actions/templates/publishModule - with: - templateFilePath: '${{ env.modulePath }}/deploy.bicep' - templateSpecsRGName: '${{ env.templateSpecsRGName }}' - templateSpecsRGLocation: '${{ env.templateSpecsRGLocation }}' - templateSpecsDescription: '${{ env.templateSpecsDescription }}' - templateSpecsDoPublish: '${{ env.templateSpecsDoPublish }}' - bicepRegistryName: '${{ env.bicepRegistryName }}' - bicepRegistryRGName: '${{ env.bicepRegistryRGName }}' - bicepRegistryRgLocation: '${{ env.bicepRegistryRgLocation }}' - bicepRegistryDoPublish: '${{ env.bicepRegistryDoPublish }}' - publishLatest: '${{ env.publishLatest }}' + uses: ./.github/workflows/template.module.yml + with: + workflowInput: '${{ needs.job_initialize_pipeline.outputs.workflowInput }}' + moduleTestFilePaths: '${{ needs.job_initialize_pipeline.outputs.moduleTestFilePaths }}' + modulePath: '${{ needs.job_initialize_pipeline.outputs.modulePath}}' + secrets: inherit diff --git a/.github/workflows/ms.kubernetesconfiguration.extensions.yml b/.github/workflows/ms.kubernetesconfiguration.extensions.yml index 983955ffd9..ca740cb462 100644 --- a/.github/workflows/ms.kubernetesconfiguration.extensions.yml +++ b/.github/workflows/ms.kubernetesconfiguration.extensions.yml @@ -1,4 +1,4 @@ -name: 'KubernetesConfiguration: Extensions' +name: 'KubernetesConfiguration - Extensions' on: workflow_dispatch: @@ -28,6 +28,7 @@ on: - main paths: - '.github/actions/templates/**' + - '.github/workflows/template.module.yml' - '.github/workflows/ms.kubernetesconfiguration.extensions.yml' - 'modules/Microsoft.KubernetesConfiguration/extensions/**' - 'utilities/pipelines/**' @@ -35,14 +36,8 @@ on: - '!*/**/readme.md' env: - variablesPath: 'settings.yml' modulePath: 'modules/Microsoft.KubernetesConfiguration/extensions' workflowPath: '.github/workflows/ms.kubernetesconfiguration.extensions.yml' - AZURE_CREDENTIALS: ${{ secrets.AZURE_CREDENTIALS }} - ARM_SUBSCRIPTION_ID: '${{ secrets.ARM_SUBSCRIPTION_ID }}' - ARM_MGMTGROUP_ID: '${{ secrets.ARM_MGMTGROUP_ID }}' - ARM_TENANT_ID: '${{ secrets.ARM_TENANT_ID }}' - TOKEN_NAMEPREFIX: '${{ secrets.TOKEN_NAMEPREFIX }}' concurrency: group: ${{ github.workflow }} @@ -72,94 +67,19 @@ jobs: outputs: workflowInput: ${{ steps.get-workflow-param.outputs.workflowInput }} moduleTestFilePaths: ${{ steps.get-module-test-file-paths.outputs.moduleTestFilePaths }} + modulePath: '${{ env.modulePath }}' - ######################### - # Static validation # - ######################### - job_module_static_validation: - runs-on: ubuntu-20.04 - name: 'Static validation' - if: (fromJson(needs.job_initialize_pipeline.outputs.workflowInput)).staticValidation == 'true' - needs: - - job_initialize_pipeline - steps: - - name: 'Checkout' - uses: actions/checkout@v3 - with: - fetch-depth: 0 - - name: Set environment variables - uses: ./.github/actions/templates/setEnvironmentVariables - with: - variablesPath: ${{ env.variablesPath }} - - name: 'Run tests' - uses: ./.github/actions/templates/validateModulePester - with: - modulePath: '${{ env.modulePath }}' - moduleTestFilePath: '${{ env.moduleTestFilePath }}' - ############################# - # Deployment validation # - ############################# - job_module_deploy_validation: - runs-on: ubuntu-20.04 - name: 'Deploying' - if: | - !cancelled() && - (fromJson(needs.job_initialize_pipeline.outputs.workflowInput)).deploymentValidation == 'true' && - needs.job_module_static_validation.result != 'failure' + ############################## + # Call reusable workflow # + ############################## + call-workflow-passing-data: + name: 'Module' needs: - job_initialize_pipeline - - job_module_static_validation - strategy: - fail-fast: false - matrix: - moduleTestFilePaths: ${{ fromJson(needs.job_initialize_pipeline.outputs.moduleTestFilePaths) }} - steps: - - name: 'Checkout' - uses: actions/checkout@v3 - with: - fetch-depth: 0 - - name: Set environment variables - uses: ./.github/actions/templates/setEnvironmentVariables - with: - variablesPath: ${{ env.variablesPath }} - - name: 'Using test file [${{ matrix.moduleTestFilePaths }}]' - uses: ./.github/actions/templates/validateModuleDeployment - with: - templateFilePath: '${{ env.modulePath }}/${{ matrix.moduleTestFilePaths }}' - location: '${{ env.location }}' - subscriptionId: '${{ secrets.ARM_SUBSCRIPTION_ID }}' - managementGroupId: '${{ secrets.ARM_MGMTGROUP_ID }}' - removeDeployment: '${{ (fromJson(needs.job_initialize_pipeline.outputs.workflowInput)).removeDeployment }}' - - ################## - # Publishing # - ################## - job_publish_module: - name: 'Publishing' - if: github.ref == 'refs/heads/main' || github.ref == 'refs/heads/master' || github.event.inputs.prerelease == 'true' - runs-on: ubuntu-20.04 - needs: - - job_module_deploy_validation - steps: - - name: 'Checkout' - uses: actions/checkout@v3 - with: - fetch-depth: 0 - - name: Set environment variables - uses: ./.github/actions/templates/setEnvironmentVariables - with: - variablesPath: ${{ env.variablesPath }} - - name: 'Publishing' - uses: ./.github/actions/templates/publishModule - with: - templateFilePath: '${{ env.modulePath }}/deploy.bicep' - templateSpecsRGName: '${{ env.templateSpecsRGName }}' - templateSpecsRGLocation: '${{ env.templateSpecsRGLocation }}' - templateSpecsDescription: '${{ env.templateSpecsDescription }}' - templateSpecsDoPublish: '${{ env.templateSpecsDoPublish }}' - bicepRegistryName: '${{ env.bicepRegistryName }}' - bicepRegistryRGName: '${{ env.bicepRegistryRGName }}' - bicepRegistryRgLocation: '${{ env.bicepRegistryRgLocation }}' - bicepRegistryDoPublish: '${{ env.bicepRegistryDoPublish }}' - publishLatest: '${{ env.publishLatest }}' + uses: ./.github/workflows/template.module.yml + with: + workflowInput: '${{ needs.job_initialize_pipeline.outputs.workflowInput }}' + moduleTestFilePaths: '${{ needs.job_initialize_pipeline.outputs.moduleTestFilePaths }}' + modulePath: '${{ needs.job_initialize_pipeline.outputs.modulePath}}' + secrets: inherit diff --git a/.github/workflows/ms.kubernetesconfiguration.fluxconfigurations.yml b/.github/workflows/ms.kubernetesconfiguration.fluxconfigurations.yml index 7ddd9e5dba..244bfbe67a 100644 --- a/.github/workflows/ms.kubernetesconfiguration.fluxconfigurations.yml +++ b/.github/workflows/ms.kubernetesconfiguration.fluxconfigurations.yml @@ -1,4 +1,4 @@ -name: 'KubernetesConfiguration: FluxConfigurations' +name: 'KubernetesConfiguration - FluxConfigurations' on: workflow_dispatch: @@ -28,6 +28,7 @@ on: - main paths: - '.github/actions/templates/**' + - '.github/workflows/template.module.yml' - '.github/workflows/ms.kubernetesconfiguration.fluxconfigurations.yml' - 'modules/Microsoft.KubernetesConfiguration/fluxConfigurations/**' - 'utilities/pipelines/**' @@ -35,14 +36,8 @@ on: - '!*/**/readme.md' env: - variablesPath: 'settings.yml' modulePath: 'modules/Microsoft.KubernetesConfiguration/fluxConfigurations' workflowPath: '.github/workflows/ms.kubernetesconfiguration.fluxconfigurations.yml' - AZURE_CREDENTIALS: ${{ secrets.AZURE_CREDENTIALS }} - ARM_SUBSCRIPTION_ID: '${{ secrets.ARM_SUBSCRIPTION_ID }}' - ARM_MGMTGROUP_ID: '${{ secrets.ARM_MGMTGROUP_ID }}' - ARM_TENANT_ID: '${{ secrets.ARM_TENANT_ID }}' - TOKEN_NAMEPREFIX: '${{ secrets.TOKEN_NAMEPREFIX }}' concurrency: group: ${{ github.workflow }} @@ -72,94 +67,19 @@ jobs: outputs: workflowInput: ${{ steps.get-workflow-param.outputs.workflowInput }} moduleTestFilePaths: ${{ steps.get-module-test-file-paths.outputs.moduleTestFilePaths }} + modulePath: '${{ env.modulePath }}' - ######################### - # Static validation # - ######################### - job_module_static_validation: - runs-on: ubuntu-20.04 - name: 'Static validation' - if: (fromJson(needs.job_initialize_pipeline.outputs.workflowInput)).staticValidation == 'true' - needs: - - job_initialize_pipeline - steps: - - name: 'Checkout' - uses: actions/checkout@v3 - with: - fetch-depth: 0 - - name: Set environment variables - uses: ./.github/actions/templates/setEnvironmentVariables - with: - variablesPath: ${{ env.variablesPath }} - - name: 'Run tests' - uses: ./.github/actions/templates/validateModulePester - with: - modulePath: '${{ env.modulePath }}' - moduleTestFilePath: '${{ env.moduleTestFilePath }}' - ############################# - # Deployment validation # - ############################# - job_module_deploy_validation: - runs-on: ubuntu-20.04 - name: 'Deploying' - if: | - !cancelled() && - (fromJson(needs.job_initialize_pipeline.outputs.workflowInput)).deploymentValidation == 'true' && - needs.job_module_static_validation.result != 'failure' + ############################## + # Call reusable workflow # + ############################## + call-workflow-passing-data: + name: 'Module' needs: - job_initialize_pipeline - - job_module_static_validation - strategy: - fail-fast: false - matrix: - moduleTestFilePaths: ${{ fromJson(needs.job_initialize_pipeline.outputs.moduleTestFilePaths) }} - steps: - - name: 'Checkout' - uses: actions/checkout@v3 - with: - fetch-depth: 0 - - name: Set environment variables - uses: ./.github/actions/templates/setEnvironmentVariables - with: - variablesPath: ${{ env.variablesPath }} - - name: 'Using test file [${{ matrix.moduleTestFilePaths }}]' - uses: ./.github/actions/templates/validateModuleDeployment - with: - templateFilePath: '${{ env.modulePath }}/${{ matrix.moduleTestFilePaths }}' - location: '${{ env.location }}' - subscriptionId: '${{ secrets.ARM_SUBSCRIPTION_ID }}' - managementGroupId: '${{ secrets.ARM_MGMTGROUP_ID }}' - removeDeployment: '${{ (fromJson(needs.job_initialize_pipeline.outputs.workflowInput)).removeDeployment }}' - - ################## - # Publishing # - ################## - job_publish_module: - name: 'Publishing' - if: github.ref == 'refs/heads/main' || github.ref == 'refs/heads/master' || github.event.inputs.prerelease == 'true' - runs-on: ubuntu-20.04 - needs: - - job_module_deploy_validation - steps: - - name: 'Checkout' - uses: actions/checkout@v3 - with: - fetch-depth: 0 - - name: Set environment variables - uses: ./.github/actions/templates/setEnvironmentVariables - with: - variablesPath: ${{ env.variablesPath }} - - name: 'Publishing' - uses: ./.github/actions/templates/publishModule - with: - templateFilePath: '${{ env.modulePath }}/deploy.bicep' - templateSpecsRGName: '${{ env.templateSpecsRGName }}' - templateSpecsRGLocation: '${{ env.templateSpecsRGLocation }}' - templateSpecsDescription: '${{ env.templateSpecsDescription }}' - templateSpecsDoPublish: '${{ env.templateSpecsDoPublish }}' - bicepRegistryName: '${{ env.bicepRegistryName }}' - bicepRegistryRGName: '${{ env.bicepRegistryRGName }}' - bicepRegistryRgLocation: '${{ env.bicepRegistryRgLocation }}' - bicepRegistryDoPublish: '${{ env.bicepRegistryDoPublish }}' - publishLatest: '${{ env.publishLatest }}' + uses: ./.github/workflows/template.module.yml + with: + workflowInput: '${{ needs.job_initialize_pipeline.outputs.workflowInput }}' + moduleTestFilePaths: '${{ needs.job_initialize_pipeline.outputs.moduleTestFilePaths }}' + modulePath: '${{ needs.job_initialize_pipeline.outputs.modulePath}}' + secrets: inherit diff --git a/.github/workflows/ms.logic.workflows.yml b/.github/workflows/ms.logic.workflows.yml index da2ce8b803..4d2f0f0e47 100644 --- a/.github/workflows/ms.logic.workflows.yml +++ b/.github/workflows/ms.logic.workflows.yml @@ -1,4 +1,4 @@ -name: 'Logic: Workflows' +name: 'Logic - Workflows' on: workflow_dispatch: @@ -28,6 +28,7 @@ on: - main paths: - '.github/actions/templates/**' + - '.github/workflows/template.module.yml' - '.github/workflows/ms.logic.workflows.yml' - 'modules/Microsoft.Logic/workflows/**' - 'utilities/pipelines/**' @@ -35,14 +36,8 @@ on: - '!*/**/readme.md' env: - variablesPath: 'settings.yml' modulePath: 'modules/Microsoft.Logic/workflows' workflowPath: '.github/workflows/ms.logic.workflows.yml' - AZURE_CREDENTIALS: ${{ secrets.AZURE_CREDENTIALS }} - ARM_SUBSCRIPTION_ID: '${{ secrets.ARM_SUBSCRIPTION_ID }}' - ARM_MGMTGROUP_ID: '${{ secrets.ARM_MGMTGROUP_ID }}' - ARM_TENANT_ID: '${{ secrets.ARM_TENANT_ID }}' - TOKEN_NAMEPREFIX: '${{ secrets.TOKEN_NAMEPREFIX }}' concurrency: group: ${{ github.workflow }} @@ -72,94 +67,19 @@ jobs: outputs: workflowInput: ${{ steps.get-workflow-param.outputs.workflowInput }} moduleTestFilePaths: ${{ steps.get-module-test-file-paths.outputs.moduleTestFilePaths }} + modulePath: '${{ env.modulePath }}' - ######################### - # Static validation # - ######################### - job_module_static_validation: - runs-on: ubuntu-20.04 - name: 'Static validation' - if: (fromJson(needs.job_initialize_pipeline.outputs.workflowInput)).staticValidation == 'true' - needs: - - job_initialize_pipeline - steps: - - name: 'Checkout' - uses: actions/checkout@v3 - with: - fetch-depth: 0 - - name: Set environment variables - uses: ./.github/actions/templates/setEnvironmentVariables - with: - variablesPath: ${{ env.variablesPath }} - - name: 'Run tests' - uses: ./.github/actions/templates/validateModulePester - with: - modulePath: '${{ env.modulePath }}' - moduleTestFilePath: '${{ env.moduleTestFilePath }}' - ############################# - # Deployment validation # - ############################# - job_module_deploy_validation: - runs-on: ubuntu-20.04 - name: 'Deploying' - if: | - !cancelled() && - (fromJson(needs.job_initialize_pipeline.outputs.workflowInput)).deploymentValidation == 'true' && - needs.job_module_static_validation.result != 'failure' + ############################## + # Call reusable workflow # + ############################## + call-workflow-passing-data: + name: 'Module' needs: - job_initialize_pipeline - - job_module_static_validation - strategy: - fail-fast: false - matrix: - moduleTestFilePaths: ${{ fromJson(needs.job_initialize_pipeline.outputs.moduleTestFilePaths) }} - steps: - - name: 'Checkout' - uses: actions/checkout@v3 - with: - fetch-depth: 0 - - name: Set environment variables - uses: ./.github/actions/templates/setEnvironmentVariables - with: - variablesPath: ${{ env.variablesPath }} - - name: 'Using test file [${{ matrix.moduleTestFilePaths }}]' - uses: ./.github/actions/templates/validateModuleDeployment - with: - templateFilePath: '${{ env.modulePath }}/${{ matrix.moduleTestFilePaths }}' - location: '${{ env.location }}' - subscriptionId: '${{ secrets.ARM_SUBSCRIPTION_ID }}' - managementGroupId: '${{ secrets.ARM_MGMTGROUP_ID }}' - removeDeployment: '${{ (fromJson(needs.job_initialize_pipeline.outputs.workflowInput)).removeDeployment }}' - - ################## - # Publishing # - ################## - job_publish_module: - name: 'Publishing' - if: github.ref == 'refs/heads/main' || github.ref == 'refs/heads/master' || github.event.inputs.prerelease == 'true' - runs-on: ubuntu-20.04 - needs: - - job_module_deploy_validation - steps: - - name: 'Checkout' - uses: actions/checkout@v3 - with: - fetch-depth: 0 - - name: Set environment variables - uses: ./.github/actions/templates/setEnvironmentVariables - with: - variablesPath: ${{ env.variablesPath }} - - name: 'Publishing' - uses: ./.github/actions/templates/publishModule - with: - templateFilePath: '${{ env.modulePath }}/deploy.bicep' - templateSpecsRGName: '${{ env.templateSpecsRGName }}' - templateSpecsRGLocation: '${{ env.templateSpecsRGLocation }}' - templateSpecsDescription: '${{ env.templateSpecsDescription }}' - templateSpecsDoPublish: '${{ env.templateSpecsDoPublish }}' - bicepRegistryName: '${{ env.bicepRegistryName }}' - bicepRegistryRGName: '${{ env.bicepRegistryRGName }}' - bicepRegistryRgLocation: '${{ env.bicepRegistryRgLocation }}' - bicepRegistryDoPublish: '${{ env.bicepRegistryDoPublish }}' - publishLatest: '${{ env.publishLatest }}' + uses: ./.github/workflows/template.module.yml + with: + workflowInput: '${{ needs.job_initialize_pipeline.outputs.workflowInput }}' + moduleTestFilePaths: '${{ needs.job_initialize_pipeline.outputs.moduleTestFilePaths }}' + modulePath: '${{ needs.job_initialize_pipeline.outputs.modulePath}}' + secrets: inherit diff --git a/.github/workflows/ms.machinelearningservices.workspaces.yml b/.github/workflows/ms.machinelearningservices.workspaces.yml index 3c1aa598be..b50c605b20 100644 --- a/.github/workflows/ms.machinelearningservices.workspaces.yml +++ b/.github/workflows/ms.machinelearningservices.workspaces.yml @@ -1,4 +1,4 @@ -name: 'MachineLearningServices: Workspaces' +name: 'MachineLearningServices - Workspaces' on: workflow_dispatch: @@ -28,6 +28,7 @@ on: - main paths: - '.github/actions/templates/**' + - '.github/workflows/template.module.yml' - '.github/workflows/ms.machinelearningservices.workspaces.yml' - 'modules/Microsoft.MachineLearningServices/workspaces/**' - 'utilities/pipelines/**' @@ -35,14 +36,8 @@ on: - '!*/**/readme.md' env: - variablesPath: 'settings.yml' modulePath: 'modules/Microsoft.MachineLearningServices/workspaces' workflowPath: '.github/workflows/ms.machinelearningservices.workspaces.yml' - AZURE_CREDENTIALS: ${{ secrets.AZURE_CREDENTIALS }} - ARM_SUBSCRIPTION_ID: '${{ secrets.ARM_SUBSCRIPTION_ID }}' - ARM_MGMTGROUP_ID: '${{ secrets.ARM_MGMTGROUP_ID }}' - ARM_TENANT_ID: '${{ secrets.ARM_TENANT_ID }}' - TOKEN_NAMEPREFIX: '${{ secrets.TOKEN_NAMEPREFIX }}' concurrency: group: ${{ github.workflow }} @@ -72,94 +67,19 @@ jobs: outputs: workflowInput: ${{ steps.get-workflow-param.outputs.workflowInput }} moduleTestFilePaths: ${{ steps.get-module-test-file-paths.outputs.moduleTestFilePaths }} + modulePath: '${{ env.modulePath }}' - ######################### - # Static validation # - ######################### - job_module_static_validation: - runs-on: ubuntu-20.04 - name: 'Static validation' - if: (fromJson(needs.job_initialize_pipeline.outputs.workflowInput)).staticValidation == 'true' - needs: - - job_initialize_pipeline - steps: - - name: 'Checkout' - uses: actions/checkout@v3 - with: - fetch-depth: 0 - - name: Set environment variables - uses: ./.github/actions/templates/setEnvironmentVariables - with: - variablesPath: ${{ env.variablesPath }} - - name: 'Run tests' - uses: ./.github/actions/templates/validateModulePester - with: - modulePath: '${{ env.modulePath }}' - moduleTestFilePath: '${{ env.moduleTestFilePath }}' - ############################# - # Deployment validation # - ############################# - job_module_deploy_validation: - runs-on: ubuntu-20.04 - name: 'Deploying' - if: | - !cancelled() && - (fromJson(needs.job_initialize_pipeline.outputs.workflowInput)).deploymentValidation == 'true' && - needs.job_module_static_validation.result != 'failure' + ############################## + # Call reusable workflow # + ############################## + call-workflow-passing-data: + name: 'Module' needs: - job_initialize_pipeline - - job_module_static_validation - strategy: - fail-fast: false - matrix: - moduleTestFilePaths: ${{ fromJson(needs.job_initialize_pipeline.outputs.moduleTestFilePaths) }} - steps: - - name: 'Checkout' - uses: actions/checkout@v3 - with: - fetch-depth: 0 - - name: Set environment variables - uses: ./.github/actions/templates/setEnvironmentVariables - with: - variablesPath: ${{ env.variablesPath }} - - name: 'Using test file [${{ matrix.moduleTestFilePaths }}]' - uses: ./.github/actions/templates/validateModuleDeployment - with: - templateFilePath: '${{ env.modulePath }}/${{ matrix.moduleTestFilePaths }}' - location: '${{ env.location }}' - subscriptionId: '${{ secrets.ARM_SUBSCRIPTION_ID }}' - managementGroupId: '${{ secrets.ARM_MGMTGROUP_ID }}' - removeDeployment: '${{ (fromJson(needs.job_initialize_pipeline.outputs.workflowInput)).removeDeployment }}' - - ################## - # Publishing # - ################## - job_publish_module: - name: 'Publishing' - if: github.ref == 'refs/heads/main' || github.ref == 'refs/heads/master' || github.event.inputs.prerelease == 'true' - runs-on: ubuntu-20.04 - needs: - - job_module_deploy_validation - steps: - - name: 'Checkout' - uses: actions/checkout@v3 - with: - fetch-depth: 0 - - name: Set environment variables - uses: ./.github/actions/templates/setEnvironmentVariables - with: - variablesPath: ${{ env.variablesPath }} - - name: 'Publishing' - uses: ./.github/actions/templates/publishModule - with: - templateFilePath: '${{ env.modulePath }}/deploy.bicep' - templateSpecsRGName: '${{ env.templateSpecsRGName }}' - templateSpecsRGLocation: '${{ env.templateSpecsRGLocation }}' - templateSpecsDescription: '${{ env.templateSpecsDescription }}' - templateSpecsDoPublish: '${{ env.templateSpecsDoPublish }}' - bicepRegistryName: '${{ env.bicepRegistryName }}' - bicepRegistryRGName: '${{ env.bicepRegistryRGName }}' - bicepRegistryRgLocation: '${{ env.bicepRegistryRgLocation }}' - bicepRegistryDoPublish: '${{ env.bicepRegistryDoPublish }}' - publishLatest: '${{ env.publishLatest }}' + uses: ./.github/workflows/template.module.yml + with: + workflowInput: '${{ needs.job_initialize_pipeline.outputs.workflowInput }}' + moduleTestFilePaths: '${{ needs.job_initialize_pipeline.outputs.moduleTestFilePaths }}' + modulePath: '${{ needs.job_initialize_pipeline.outputs.modulePath}}' + secrets: inherit diff --git a/.github/workflows/ms.maintenance.maintenanceconfigurations.yml b/.github/workflows/ms.maintenance.maintenanceconfigurations.yml index a8a0888595..16ba750af1 100644 --- a/.github/workflows/ms.maintenance.maintenanceconfigurations.yml +++ b/.github/workflows/ms.maintenance.maintenanceconfigurations.yml @@ -1,4 +1,4 @@ -name: 'Maintenance: MaintenanceConfigurations' +name: 'Maintenance - MaintenanceConfigurations' on: workflow_dispatch: @@ -28,6 +28,7 @@ on: - main paths: - '.github/actions/templates/**' + - '.github/workflows/template.module.yml' - '.github/workflows/ms.maintenance.maintenanceconfigurations.yml' - 'modules/Microsoft.Maintenance/maintenanceConfigurations/**' - 'utilities/pipelines/**' @@ -35,14 +36,8 @@ on: - '!*/**/readme.md' env: - variablesPath: 'settings.yml' modulePath: 'modules/Microsoft.Maintenance/maintenanceConfigurations' workflowPath: '.github/workflows/ms.maintenance.maintenanceconfigurations.yml' - AZURE_CREDENTIALS: ${{ secrets.AZURE_CREDENTIALS }} - ARM_SUBSCRIPTION_ID: '${{ secrets.ARM_SUBSCRIPTION_ID }}' - ARM_MGMTGROUP_ID: '${{ secrets.ARM_MGMTGROUP_ID }}' - ARM_TENANT_ID: '${{ secrets.ARM_TENANT_ID }}' - TOKEN_NAMEPREFIX: '${{ secrets.TOKEN_NAMEPREFIX }}' concurrency: group: ${{ github.workflow }} @@ -72,94 +67,19 @@ jobs: outputs: workflowInput: ${{ steps.get-workflow-param.outputs.workflowInput }} moduleTestFilePaths: ${{ steps.get-module-test-file-paths.outputs.moduleTestFilePaths }} + modulePath: '${{ env.modulePath }}' - ######################### - # Static validation # - ######################### - job_module_static_validation: - runs-on: ubuntu-20.04 - name: 'Static validation' - if: (fromJson(needs.job_initialize_pipeline.outputs.workflowInput)).staticValidation == 'true' - needs: - - job_initialize_pipeline - steps: - - name: 'Checkout' - uses: actions/checkout@v3 - with: - fetch-depth: 0 - - name: Set environment variables - uses: ./.github/actions/templates/setEnvironmentVariables - with: - variablesPath: ${{ env.variablesPath }} - - name: 'Run tests' - uses: ./.github/actions/templates/validateModulePester - with: - modulePath: '${{ env.modulePath }}' - moduleTestFilePath: '${{ env.moduleTestFilePath }}' - ############################# - # Deployment validation # - ############################# - job_module_deploy_validation: - runs-on: ubuntu-20.04 - name: 'Deploying' - if: | - !cancelled() && - (fromJson(needs.job_initialize_pipeline.outputs.workflowInput)).deploymentValidation == 'true' && - needs.job_module_static_validation.result != 'failure' + ############################## + # Call reusable workflow # + ############################## + call-workflow-passing-data: + name: 'Module' needs: - job_initialize_pipeline - - job_module_static_validation - strategy: - fail-fast: false - matrix: - moduleTestFilePaths: ${{ fromJson(needs.job_initialize_pipeline.outputs.moduleTestFilePaths) }} - steps: - - name: 'Checkout' - uses: actions/checkout@v3 - with: - fetch-depth: 0 - - name: Set environment variables - uses: ./.github/actions/templates/setEnvironmentVariables - with: - variablesPath: ${{ env.variablesPath }} - - name: 'Using test file [${{ matrix.moduleTestFilePaths }}]' - uses: ./.github/actions/templates/validateModuleDeployment - with: - templateFilePath: '${{ env.modulePath }}/${{ matrix.moduleTestFilePaths }}' - location: '${{ env.location }}' - subscriptionId: '${{ secrets.ARM_SUBSCRIPTION_ID }}' - managementGroupId: '${{ secrets.ARM_MGMTGROUP_ID }}' - removeDeployment: '${{ (fromJson(needs.job_initialize_pipeline.outputs.workflowInput)).removeDeployment }}' - - ################## - # Publishing # - ################## - job_publish_module: - name: 'Publishing' - if: github.ref == 'refs/heads/main' || github.ref == 'refs/heads/master' || github.event.inputs.prerelease == 'true' - runs-on: ubuntu-20.04 - needs: - - job_module_deploy_validation - steps: - - name: 'Checkout' - uses: actions/checkout@v3 - with: - fetch-depth: 0 - - name: Set environment variables - uses: ./.github/actions/templates/setEnvironmentVariables - with: - variablesPath: ${{ env.variablesPath }} - - name: 'Publishing' - uses: ./.github/actions/templates/publishModule - with: - templateFilePath: '${{ env.modulePath }}/deploy.bicep' - templateSpecsRGName: '${{ env.templateSpecsRGName }}' - templateSpecsRGLocation: '${{ env.templateSpecsRGLocation }}' - templateSpecsDescription: '${{ env.templateSpecsDescription }}' - templateSpecsDoPublish: '${{ env.templateSpecsDoPublish }}' - bicepRegistryName: '${{ env.bicepRegistryName }}' - bicepRegistryRGName: '${{ env.bicepRegistryRGName }}' - bicepRegistryRgLocation: '${{ env.bicepRegistryRgLocation }}' - bicepRegistryDoPublish: '${{ env.bicepRegistryDoPublish }}' - publishLatest: '${{ env.publishLatest }}' + uses: ./.github/workflows/template.module.yml + with: + workflowInput: '${{ needs.job_initialize_pipeline.outputs.workflowInput }}' + moduleTestFilePaths: '${{ needs.job_initialize_pipeline.outputs.moduleTestFilePaths }}' + modulePath: '${{ needs.job_initialize_pipeline.outputs.modulePath}}' + secrets: inherit diff --git a/.github/workflows/ms.managedidentity.userassignedidentities.yml b/.github/workflows/ms.managedidentity.userassignedidentities.yml index 79cf32c4f0..02b951079f 100644 --- a/.github/workflows/ms.managedidentity.userassignedidentities.yml +++ b/.github/workflows/ms.managedidentity.userassignedidentities.yml @@ -1,4 +1,4 @@ -name: 'ManagedIdentity: UserAssignedIdentities' +name: 'ManagedIdentity - UserAssignedIdentities' on: workflow_dispatch: @@ -28,6 +28,7 @@ on: - main paths: - '.github/actions/templates/**' + - '.github/workflows/template.module.yml' - '.github/workflows/ms.managedidentity.userassignedidentities.yml' - 'modules/Microsoft.ManagedIdentity/userAssignedIdentities/**' - 'utilities/pipelines/**' @@ -35,14 +36,8 @@ on: - '!*/**/readme.md' env: - variablesPath: 'settings.yml' modulePath: 'modules/Microsoft.ManagedIdentity/userAssignedIdentities' workflowPath: '.github/workflows/ms.managedidentity.userassignedidentities.yml' - AZURE_CREDENTIALS: ${{ secrets.AZURE_CREDENTIALS }} - ARM_SUBSCRIPTION_ID: '${{ secrets.ARM_SUBSCRIPTION_ID }}' - ARM_MGMTGROUP_ID: '${{ secrets.ARM_MGMTGROUP_ID }}' - ARM_TENANT_ID: '${{ secrets.ARM_TENANT_ID }}' - TOKEN_NAMEPREFIX: '${{ secrets.TOKEN_NAMEPREFIX }}' concurrency: group: ${{ github.workflow }} @@ -72,94 +67,19 @@ jobs: outputs: workflowInput: ${{ steps.get-workflow-param.outputs.workflowInput }} moduleTestFilePaths: ${{ steps.get-module-test-file-paths.outputs.moduleTestFilePaths }} + modulePath: '${{ env.modulePath }}' - ######################### - # Static validation # - ######################### - job_module_static_validation: - runs-on: ubuntu-20.04 - name: 'Static validation' - if: (fromJson(needs.job_initialize_pipeline.outputs.workflowInput)).staticValidation == 'true' - needs: - - job_initialize_pipeline - steps: - - name: 'Checkout' - uses: actions/checkout@v3 - with: - fetch-depth: 0 - - name: Set environment variables - uses: ./.github/actions/templates/setEnvironmentVariables - with: - variablesPath: ${{ env.variablesPath }} - - name: 'Run tests' - uses: ./.github/actions/templates/validateModulePester - with: - modulePath: '${{ env.modulePath }}' - moduleTestFilePath: '${{ env.moduleTestFilePath }}' - ############################# - # Deployment validation # - ############################# - job_module_deploy_validation: - runs-on: ubuntu-20.04 - name: 'Deploying' - if: | - !cancelled() && - (fromJson(needs.job_initialize_pipeline.outputs.workflowInput)).deploymentValidation == 'true' && - needs.job_module_static_validation.result != 'failure' + ############################## + # Call reusable workflow # + ############################## + call-workflow-passing-data: + name: 'Module' needs: - job_initialize_pipeline - - job_module_static_validation - strategy: - fail-fast: false - matrix: - moduleTestFilePaths: ${{ fromJson(needs.job_initialize_pipeline.outputs.moduleTestFilePaths) }} - steps: - - name: 'Checkout' - uses: actions/checkout@v3 - with: - fetch-depth: 0 - - name: Set environment variables - uses: ./.github/actions/templates/setEnvironmentVariables - with: - variablesPath: ${{ env.variablesPath }} - - name: 'Using test file [${{ matrix.moduleTestFilePaths }}]' - uses: ./.github/actions/templates/validateModuleDeployment - with: - templateFilePath: '${{ env.modulePath }}/${{ matrix.moduleTestFilePaths }}' - location: '${{ env.location }}' - subscriptionId: '${{ secrets.ARM_SUBSCRIPTION_ID }}' - managementGroupId: '${{ secrets.ARM_MGMTGROUP_ID }}' - removeDeployment: '${{ (fromJson(needs.job_initialize_pipeline.outputs.workflowInput)).removeDeployment }}' - - ################## - # Publishing # - ################## - job_publish_module: - name: 'Publishing' - if: github.ref == 'refs/heads/main' || github.ref == 'refs/heads/master' || github.event.inputs.prerelease == 'true' - runs-on: ubuntu-20.04 - needs: - - job_module_deploy_validation - steps: - - name: 'Checkout' - uses: actions/checkout@v3 - with: - fetch-depth: 0 - - name: Set environment variables - uses: ./.github/actions/templates/setEnvironmentVariables - with: - variablesPath: ${{ env.variablesPath }} - - name: 'Publishing' - uses: ./.github/actions/templates/publishModule - with: - templateFilePath: '${{ env.modulePath }}/deploy.bicep' - templateSpecsRGName: '${{ env.templateSpecsRGName }}' - templateSpecsRGLocation: '${{ env.templateSpecsRGLocation }}' - templateSpecsDescription: '${{ env.templateSpecsDescription }}' - templateSpecsDoPublish: '${{ env.templateSpecsDoPublish }}' - bicepRegistryName: '${{ env.bicepRegistryName }}' - bicepRegistryRGName: '${{ env.bicepRegistryRGName }}' - bicepRegistryRgLocation: '${{ env.bicepRegistryRgLocation }}' - bicepRegistryDoPublish: '${{ env.bicepRegistryDoPublish }}' - publishLatest: '${{ env.publishLatest }}' + uses: ./.github/workflows/template.module.yml + with: + workflowInput: '${{ needs.job_initialize_pipeline.outputs.workflowInput }}' + moduleTestFilePaths: '${{ needs.job_initialize_pipeline.outputs.moduleTestFilePaths }}' + modulePath: '${{ needs.job_initialize_pipeline.outputs.modulePath}}' + secrets: inherit diff --git a/.github/workflows/ms.managedservices.registrationdefinitions.yml b/.github/workflows/ms.managedservices.registrationdefinitions.yml index 726758b34a..9396823635 100644 --- a/.github/workflows/ms.managedservices.registrationdefinitions.yml +++ b/.github/workflows/ms.managedservices.registrationdefinitions.yml @@ -1,4 +1,4 @@ -name: 'ManagedServices: RegistrationDefinitions' +name: 'ManagedServices - RegistrationDefinitions' on: workflow_dispatch: @@ -28,6 +28,7 @@ on: - main paths: - '.github/actions/templates/**' + - '.github/workflows/template.module.yml' - '.github/workflows/ms.managedservices.registrationdefinitions.yml' - 'modules/Microsoft.ManagedServices/registrationDefinitions/**' - 'utilities/pipelines/**' @@ -35,14 +36,8 @@ on: - '!*/**/readme.md' env: - variablesPath: 'settings.yml' modulePath: 'modules/Microsoft.ManagedServices/registrationDefinitions' workflowPath: '.github/workflows/ms.managedservices.registrationdefinitions.yml' - AZURE_CREDENTIALS: ${{ secrets.AZURE_CREDENTIALS }} - ARM_SUBSCRIPTION_ID: '${{ secrets.ARM_SUBSCRIPTION_ID }}' - ARM_MGMTGROUP_ID: '${{ secrets.ARM_MGMTGROUP_ID }}' - ARM_TENANT_ID: '${{ secrets.ARM_TENANT_ID }}' - TOKEN_NAMEPREFIX: '${{ secrets.TOKEN_NAMEPREFIX }}' concurrency: group: ${{ github.workflow }} @@ -72,94 +67,19 @@ jobs: outputs: workflowInput: ${{ steps.get-workflow-param.outputs.workflowInput }} moduleTestFilePaths: ${{ steps.get-module-test-file-paths.outputs.moduleTestFilePaths }} + modulePath: '${{ env.modulePath }}' - ######################### - # Static validation # - ######################### - job_module_static_validation: - runs-on: ubuntu-20.04 - name: 'Static validation' - if: (fromJson(needs.job_initialize_pipeline.outputs.workflowInput)).staticValidation == 'true' - needs: - - job_initialize_pipeline - steps: - - name: 'Checkout' - uses: actions/checkout@v3 - with: - fetch-depth: 0 - - name: Set environment variables - uses: ./.github/actions/templates/setEnvironmentVariables - with: - variablesPath: ${{ env.variablesPath }} - - name: 'Run tests' - uses: ./.github/actions/templates/validateModulePester - with: - modulePath: '${{ env.modulePath }}' - moduleTestFilePath: '${{ env.moduleTestFilePath }}' - ############################# - # Deployment validation # - ############################# - job_module_deploy_validation: - runs-on: ubuntu-20.04 - name: 'Deploying' - if: | - !cancelled() && - (fromJson(needs.job_initialize_pipeline.outputs.workflowInput)).deploymentValidation == 'true' && - needs.job_module_static_validation.result != 'failure' + ############################## + # Call reusable workflow # + ############################## + call-workflow-passing-data: + name: 'Module' needs: - job_initialize_pipeline - - job_module_static_validation - strategy: - fail-fast: false - matrix: - moduleTestFilePaths: ${{ fromJson(needs.job_initialize_pipeline.outputs.moduleTestFilePaths) }} - steps: - - name: 'Checkout' - uses: actions/checkout@v3 - with: - fetch-depth: 0 - - name: Set environment variables - uses: ./.github/actions/templates/setEnvironmentVariables - with: - variablesPath: ${{ env.variablesPath }} - - name: 'Using test file [${{ matrix.moduleTestFilePaths }}]' - uses: ./.github/actions/templates/validateModuleDeployment - with: - templateFilePath: '${{ env.modulePath }}/${{ matrix.moduleTestFilePaths }}' - location: '${{ env.location }}' - subscriptionId: '${{ secrets.ARM_SUBSCRIPTION_ID }}' - managementGroupId: '${{ secrets.ARM_MGMTGROUP_ID }}' - removeDeployment: '${{ (fromJson(needs.job_initialize_pipeline.outputs.workflowInput)).removeDeployment }}' - - ################## - # Publishing # - ################## - job_publish_module: - name: 'Publishing' - if: github.ref == 'refs/heads/main' || github.ref == 'refs/heads/master' || github.event.inputs.prerelease == 'true' - runs-on: ubuntu-20.04 - needs: - - job_module_deploy_validation - steps: - - name: 'Checkout' - uses: actions/checkout@v3 - with: - fetch-depth: 0 - - name: Set environment variables - uses: ./.github/actions/templates/setEnvironmentVariables - with: - variablesPath: ${{ env.variablesPath }} - - name: 'Publishing' - uses: ./.github/actions/templates/publishModule - with: - templateFilePath: '${{ env.modulePath }}/deploy.bicep' - templateSpecsRGName: '${{ env.templateSpecsRGName }}' - templateSpecsRGLocation: '${{ env.templateSpecsRGLocation }}' - templateSpecsDescription: '${{ env.templateSpecsDescription }}' - templateSpecsDoPublish: '${{ env.templateSpecsDoPublish }}' - bicepRegistryName: '${{ env.bicepRegistryName }}' - bicepRegistryRGName: '${{ env.bicepRegistryRGName }}' - bicepRegistryRgLocation: '${{ env.bicepRegistryRgLocation }}' - bicepRegistryDoPublish: '${{ env.bicepRegistryDoPublish }}' - publishLatest: '${{ env.publishLatest }}' + uses: ./.github/workflows/template.module.yml + with: + workflowInput: '${{ needs.job_initialize_pipeline.outputs.workflowInput }}' + moduleTestFilePaths: '${{ needs.job_initialize_pipeline.outputs.moduleTestFilePaths }}' + modulePath: '${{ needs.job_initialize_pipeline.outputs.modulePath}}' + secrets: inherit diff --git a/.github/workflows/ms.management.managementgroups.yml b/.github/workflows/ms.management.managementgroups.yml index 5a6da11be2..e7f5bc058c 100644 --- a/.github/workflows/ms.management.managementgroups.yml +++ b/.github/workflows/ms.management.managementgroups.yml @@ -1,4 +1,4 @@ -name: 'Management: ManagementGroups' +name: 'Management - ManagementGroups' on: workflow_dispatch: @@ -28,6 +28,7 @@ on: - main paths: - '.github/actions/templates/**' + - '.github/workflows/template.module.yml' - '.github/workflows/ms.management.managementgroups.yml' - 'modules/Microsoft.Management/managementGroups/**' - 'utilities/pipelines/**' @@ -35,14 +36,8 @@ on: - '!*/**/readme.md' env: - variablesPath: 'settings.yml' modulePath: 'modules/Microsoft.Management/managementGroups' workflowPath: '.github/workflows/ms.management.managementgroups.yml' - AZURE_CREDENTIALS: ${{ secrets.AZURE_CREDENTIALS }} - ARM_SUBSCRIPTION_ID: '${{ secrets.ARM_SUBSCRIPTION_ID }}' - ARM_MGMTGROUP_ID: '${{ secrets.ARM_MGMTGROUP_ID }}' - ARM_TENANT_ID: '${{ secrets.ARM_TENANT_ID }}' - TOKEN_NAMEPREFIX: '${{ secrets.TOKEN_NAMEPREFIX }}' concurrency: group: ${{ github.workflow }} @@ -72,94 +67,19 @@ jobs: outputs: workflowInput: ${{ steps.get-workflow-param.outputs.workflowInput }} moduleTestFilePaths: ${{ steps.get-module-test-file-paths.outputs.moduleTestFilePaths }} + modulePath: '${{ env.modulePath }}' - ######################### - # Static validation # - ######################### - job_module_static_validation: - runs-on: ubuntu-20.04 - name: 'Static validation' - if: (fromJson(needs.job_initialize_pipeline.outputs.workflowInput)).staticValidation == 'true' - needs: - - job_initialize_pipeline - steps: - - name: 'Checkout' - uses: actions/checkout@v3 - with: - fetch-depth: 0 - - name: Set environment variables - uses: ./.github/actions/templates/setEnvironmentVariables - with: - variablesPath: ${{ env.variablesPath }} - - name: 'Run tests' - uses: ./.github/actions/templates/validateModulePester - with: - modulePath: '${{ env.modulePath }}' - moduleTestFilePath: '${{ env.moduleTestFilePath }}' - ############################# - # Deployment validation # - ############################# - job_module_deploy_validation: - runs-on: ubuntu-20.04 - name: 'Deploying' - if: | - !cancelled() && - (fromJson(needs.job_initialize_pipeline.outputs.workflowInput)).deploymentValidation == 'true' && - needs.job_module_static_validation.result != 'failure' + ############################## + # Call reusable workflow # + ############################## + call-workflow-passing-data: + name: 'Module' needs: - job_initialize_pipeline - - job_module_static_validation - strategy: - fail-fast: false - matrix: - moduleTestFilePaths: ${{ fromJson(needs.job_initialize_pipeline.outputs.moduleTestFilePaths) }} - steps: - - name: 'Checkout' - uses: actions/checkout@v3 - with: - fetch-depth: 0 - - name: Set environment variables - uses: ./.github/actions/templates/setEnvironmentVariables - with: - variablesPath: ${{ env.variablesPath }} - - name: 'Using test file [${{ matrix.moduleTestFilePaths }}]' - uses: ./.github/actions/templates/validateModuleDeployment - with: - templateFilePath: '${{ env.modulePath }}/${{ matrix.moduleTestFilePaths }}' - location: '${{ env.location }}' - subscriptionId: '${{ secrets.ARM_SUBSCRIPTION_ID }}' - managementGroupId: '${{ secrets.ARM_MGMTGROUP_ID }}' - removeDeployment: '${{ (fromJson(needs.job_initialize_pipeline.outputs.workflowInput)).removeDeployment }}' - - ################## - # Publishing # - ################## - job_publish_module: - name: 'Publishing' - if: github.ref == 'refs/heads/main' || github.ref == 'refs/heads/master' || github.event.inputs.prerelease == 'true' - runs-on: ubuntu-20.04 - needs: - - job_module_deploy_validation - steps: - - name: 'Checkout' - uses: actions/checkout@v3 - with: - fetch-depth: 0 - - name: Set environment variables - uses: ./.github/actions/templates/setEnvironmentVariables - with: - variablesPath: ${{ env.variablesPath }} - - name: 'Publishing' - uses: ./.github/actions/templates/publishModule - with: - templateFilePath: '${{ env.modulePath }}/deploy.bicep' - templateSpecsRGName: '${{ env.templateSpecsRGName }}' - templateSpecsRGLocation: '${{ env.templateSpecsRGLocation }}' - templateSpecsDescription: '${{ env.templateSpecsDescription }}' - templateSpecsDoPublish: '${{ env.templateSpecsDoPublish }}' - bicepRegistryName: '${{ env.bicepRegistryName }}' - bicepRegistryRGName: '${{ env.bicepRegistryRGName }}' - bicepRegistryRgLocation: '${{ env.bicepRegistryRgLocation }}' - bicepRegistryDoPublish: '${{ env.bicepRegistryDoPublish }}' - publishLatest: '${{ env.publishLatest }}' + uses: ./.github/workflows/template.module.yml + with: + workflowInput: '${{ needs.job_initialize_pipeline.outputs.workflowInput }}' + moduleTestFilePaths: '${{ needs.job_initialize_pipeline.outputs.moduleTestFilePaths }}' + modulePath: '${{ needs.job_initialize_pipeline.outputs.modulePath}}' + secrets: inherit diff --git a/.github/workflows/ms.netapp.netappaccounts.yml b/.github/workflows/ms.netapp.netappaccounts.yml index 96c0d36cf1..b354ee3f2c 100644 --- a/.github/workflows/ms.netapp.netappaccounts.yml +++ b/.github/workflows/ms.netapp.netappaccounts.yml @@ -1,4 +1,4 @@ -name: 'NetApp: NetAppAccounts' +name: 'NetApp - NetAppAccounts' on: workflow_dispatch: @@ -28,6 +28,7 @@ on: - main paths: - '.github/actions/templates/**' + - '.github/workflows/template.module.yml' - '.github/workflows/ms.netapp.netappaccounts.yml' - 'modules/Microsoft.NetApp/netAppAccounts/**' - 'utilities/pipelines/**' @@ -35,14 +36,8 @@ on: - '!*/**/readme.md' env: - variablesPath: 'settings.yml' modulePath: 'modules/Microsoft.NetApp/netAppAccounts' workflowPath: '.github/workflows/ms.netapp.netappaccounts.yml' - AZURE_CREDENTIALS: ${{ secrets.AZURE_CREDENTIALS }} - ARM_SUBSCRIPTION_ID: '${{ secrets.ARM_SUBSCRIPTION_ID }}' - ARM_MGMTGROUP_ID: '${{ secrets.ARM_MGMTGROUP_ID }}' - ARM_TENANT_ID: '${{ secrets.ARM_TENANT_ID }}' - TOKEN_NAMEPREFIX: '${{ secrets.TOKEN_NAMEPREFIX }}' concurrency: group: ${{ github.workflow }} @@ -72,94 +67,19 @@ jobs: outputs: workflowInput: ${{ steps.get-workflow-param.outputs.workflowInput }} moduleTestFilePaths: ${{ steps.get-module-test-file-paths.outputs.moduleTestFilePaths }} + modulePath: '${{ env.modulePath }}' - ######################### - # Static validation # - ######################### - job_module_static_validation: - runs-on: ubuntu-20.04 - name: 'Static validation' - if: (fromJson(needs.job_initialize_pipeline.outputs.workflowInput)).staticValidation == 'true' - needs: - - job_initialize_pipeline - steps: - - name: 'Checkout' - uses: actions/checkout@v3 - with: - fetch-depth: 0 - - name: Set environment variables - uses: ./.github/actions/templates/setEnvironmentVariables - with: - variablesPath: ${{ env.variablesPath }} - - name: 'Run tests' - uses: ./.github/actions/templates/validateModulePester - with: - modulePath: '${{ env.modulePath }}' - moduleTestFilePath: '${{ env.moduleTestFilePath }}' - ############################# - # Deployment validation # - ############################# - job_module_deploy_validation: - runs-on: ubuntu-20.04 - name: 'Deploying' - if: | - !cancelled() && - (fromJson(needs.job_initialize_pipeline.outputs.workflowInput)).deploymentValidation == 'true' && - needs.job_module_static_validation.result != 'failure' + ############################## + # Call reusable workflow # + ############################## + call-workflow-passing-data: + name: 'Module' needs: - job_initialize_pipeline - - job_module_static_validation - strategy: - fail-fast: false - matrix: - moduleTestFilePaths: ${{ fromJson(needs.job_initialize_pipeline.outputs.moduleTestFilePaths) }} - steps: - - name: 'Checkout' - uses: actions/checkout@v3 - with: - fetch-depth: 0 - - name: Set environment variables - uses: ./.github/actions/templates/setEnvironmentVariables - with: - variablesPath: ${{ env.variablesPath }} - - name: 'Using test file [${{ matrix.moduleTestFilePaths }}]' - uses: ./.github/actions/templates/validateModuleDeployment - with: - templateFilePath: '${{ env.modulePath }}/${{ matrix.moduleTestFilePaths }}' - location: '${{ env.location }}' - subscriptionId: '${{ secrets.ARM_SUBSCRIPTION_ID }}' - managementGroupId: '${{ secrets.ARM_MGMTGROUP_ID }}' - removeDeployment: '${{ (fromJson(needs.job_initialize_pipeline.outputs.workflowInput)).removeDeployment }}' - - ################## - # Publishing # - ################## - job_publish_module: - name: 'Publishing' - if: github.ref == 'refs/heads/main' || github.ref == 'refs/heads/master' || github.event.inputs.prerelease == 'true' - runs-on: ubuntu-20.04 - needs: - - job_module_deploy_validation - steps: - - name: 'Checkout' - uses: actions/checkout@v3 - with: - fetch-depth: 0 - - name: Set environment variables - uses: ./.github/actions/templates/setEnvironmentVariables - with: - variablesPath: ${{ env.variablesPath }} - - name: 'Publishing' - uses: ./.github/actions/templates/publishModule - with: - templateFilePath: '${{ env.modulePath }}/deploy.bicep' - templateSpecsRGName: '${{ env.templateSpecsRGName }}' - templateSpecsRGLocation: '${{ env.templateSpecsRGLocation }}' - templateSpecsDescription: '${{ env.templateSpecsDescription }}' - templateSpecsDoPublish: '${{ env.templateSpecsDoPublish }}' - bicepRegistryName: '${{ env.bicepRegistryName }}' - bicepRegistryRGName: '${{ env.bicepRegistryRGName }}' - bicepRegistryRgLocation: '${{ env.bicepRegistryRgLocation }}' - bicepRegistryDoPublish: '${{ env.bicepRegistryDoPublish }}' - publishLatest: '${{ env.publishLatest }}' + uses: ./.github/workflows/template.module.yml + with: + workflowInput: '${{ needs.job_initialize_pipeline.outputs.workflowInput }}' + moduleTestFilePaths: '${{ needs.job_initialize_pipeline.outputs.moduleTestFilePaths }}' + modulePath: '${{ needs.job_initialize_pipeline.outputs.modulePath}}' + secrets: inherit diff --git a/.github/workflows/ms.network.applicationgateways.yml b/.github/workflows/ms.network.applicationgateways.yml index 610c7acae8..267562a0de 100644 --- a/.github/workflows/ms.network.applicationgateways.yml +++ b/.github/workflows/ms.network.applicationgateways.yml @@ -1,4 +1,4 @@ -name: 'Network: ApplicationGateways' +name: 'Network - ApplicationGateways' on: workflow_dispatch: @@ -28,6 +28,7 @@ on: - main paths: - '.github/actions/templates/**' + - '.github/workflows/template.module.yml' - '.github/workflows/ms.network.applicationgateways.yml' - 'modules/Microsoft.Network/applicationGateways/**' - 'utilities/pipelines/**' @@ -35,14 +36,8 @@ on: - '!*/**/readme.md' env: - variablesPath: 'settings.yml' modulePath: 'modules/Microsoft.Network/applicationGateways' workflowPath: '.github/workflows/ms.network.applicationgateways.yml' - AZURE_CREDENTIALS: ${{ secrets.AZURE_CREDENTIALS }} - ARM_SUBSCRIPTION_ID: '${{ secrets.ARM_SUBSCRIPTION_ID }}' - ARM_MGMTGROUP_ID: '${{ secrets.ARM_MGMTGROUP_ID }}' - ARM_TENANT_ID: '${{ secrets.ARM_TENANT_ID }}' - TOKEN_NAMEPREFIX: '${{ secrets.TOKEN_NAMEPREFIX }}' concurrency: group: ${{ github.workflow }} @@ -72,94 +67,19 @@ jobs: outputs: workflowInput: ${{ steps.get-workflow-param.outputs.workflowInput }} moduleTestFilePaths: ${{ steps.get-module-test-file-paths.outputs.moduleTestFilePaths }} + modulePath: '${{ env.modulePath }}' - ######################### - # Static validation # - ######################### - job_module_static_validation: - runs-on: ubuntu-20.04 - name: 'Static validation' - if: (fromJson(needs.job_initialize_pipeline.outputs.workflowInput)).staticValidation == 'true' - needs: - - job_initialize_pipeline - steps: - - name: 'Checkout' - uses: actions/checkout@v3 - with: - fetch-depth: 0 - - name: Set environment variables - uses: ./.github/actions/templates/setEnvironmentVariables - with: - variablesPath: ${{ env.variablesPath }} - - name: 'Run tests' - uses: ./.github/actions/templates/validateModulePester - with: - modulePath: '${{ env.modulePath }}' - moduleTestFilePath: '${{ env.moduleTestFilePath }}' - ############################# - # Deployment validation # - ############################# - job_module_deploy_validation: - runs-on: ubuntu-20.04 - name: 'Deploying' - if: | - !cancelled() && - (fromJson(needs.job_initialize_pipeline.outputs.workflowInput)).deploymentValidation == 'true' && - needs.job_module_static_validation.result != 'failure' + ############################## + # Call reusable workflow # + ############################## + call-workflow-passing-data: + name: 'Module' needs: - job_initialize_pipeline - - job_module_static_validation - strategy: - fail-fast: false - matrix: - moduleTestFilePaths: ${{ fromJson(needs.job_initialize_pipeline.outputs.moduleTestFilePaths) }} - steps: - - name: 'Checkout' - uses: actions/checkout@v3 - with: - fetch-depth: 0 - - name: Set environment variables - uses: ./.github/actions/templates/setEnvironmentVariables - with: - variablesPath: ${{ env.variablesPath }} - - name: 'Using test file [${{ matrix.moduleTestFilePaths }}]' - uses: ./.github/actions/templates/validateModuleDeployment - with: - templateFilePath: '${{ env.modulePath }}/${{ matrix.moduleTestFilePaths }}' - location: '${{ env.location }}' - subscriptionId: '${{ secrets.ARM_SUBSCRIPTION_ID }}' - managementGroupId: '${{ secrets.ARM_MGMTGROUP_ID }}' - removeDeployment: '${{ (fromJson(needs.job_initialize_pipeline.outputs.workflowInput)).removeDeployment }}' - - ################## - # Publishing # - ################## - job_publish_module: - name: 'Publishing' - if: github.ref == 'refs/heads/main' || github.ref == 'refs/heads/master' || github.event.inputs.prerelease == 'true' - runs-on: ubuntu-20.04 - needs: - - job_module_deploy_validation - steps: - - name: 'Checkout' - uses: actions/checkout@v3 - with: - fetch-depth: 0 - - name: Set environment variables - uses: ./.github/actions/templates/setEnvironmentVariables - with: - variablesPath: ${{ env.variablesPath }} - - name: 'Publishing' - uses: ./.github/actions/templates/publishModule - with: - templateFilePath: '${{ env.modulePath }}/deploy.bicep' - templateSpecsRGName: '${{ env.templateSpecsRGName }}' - templateSpecsRGLocation: '${{ env.templateSpecsRGLocation }}' - templateSpecsDescription: '${{ env.templateSpecsDescription }}' - templateSpecsDoPublish: '${{ env.templateSpecsDoPublish }}' - bicepRegistryName: '${{ env.bicepRegistryName }}' - bicepRegistryRGName: '${{ env.bicepRegistryRGName }}' - bicepRegistryRgLocation: '${{ env.bicepRegistryRgLocation }}' - bicepRegistryDoPublish: '${{ env.bicepRegistryDoPublish }}' - publishLatest: '${{ env.publishLatest }}' + uses: ./.github/workflows/template.module.yml + with: + workflowInput: '${{ needs.job_initialize_pipeline.outputs.workflowInput }}' + moduleTestFilePaths: '${{ needs.job_initialize_pipeline.outputs.moduleTestFilePaths }}' + modulePath: '${{ needs.job_initialize_pipeline.outputs.modulePath}}' + secrets: inherit diff --git a/.github/workflows/ms.network.applicationgatewaywebapplicationfirewallpolicies.yml b/.github/workflows/ms.network.applicationgatewaywebapplicationfirewallpolicies.yml index 5d8268aa67..db2c9a168e 100644 --- a/.github/workflows/ms.network.applicationgatewaywebapplicationfirewallpolicies.yml +++ b/.github/workflows/ms.network.applicationgatewaywebapplicationfirewallpolicies.yml @@ -1,4 +1,4 @@ -name: 'Network: ApplicationGatewayWebApplicationFirewallPolicies' +name: 'Network - ApplicationGatewayWebApplicationFirewallPolicies' on: workflow_dispatch: @@ -28,6 +28,7 @@ on: - main paths: - '.github/actions/templates/**' + - '.github/workflows/template.module.yml' - '.github/workflows/ms.network.applicationgatewaywebapplicationfirewallpolicies.yml' - 'modules/Microsoft.Network/applicationGatewayWebApplicationFirewallPolicies/**' - 'utilities/pipelines/**' @@ -35,14 +36,8 @@ on: - '!*/**/readme.md' env: - variablesPath: 'settings.yml' modulePath: 'modules/Microsoft.Network/applicationGatewayWebApplicationFirewallPolicies' workflowPath: '.github/workflows/ms.network.applicationgatewaywebapplicationfirewallpolicies.yml' - AZURE_CREDENTIALS: ${{ secrets.AZURE_CREDENTIALS }} - ARM_SUBSCRIPTION_ID: '${{ secrets.ARM_SUBSCRIPTION_ID }}' - ARM_MGMTGROUP_ID: '${{ secrets.ARM_MGMTGROUP_ID }}' - ARM_TENANT_ID: '${{ secrets.ARM_TENANT_ID }}' - TOKEN_NAMEPREFIX: '${{ secrets.TOKEN_NAMEPREFIX }}' concurrency: group: ${{ github.workflow }} @@ -72,94 +67,19 @@ jobs: outputs: workflowInput: ${{ steps.get-workflow-param.outputs.workflowInput }} moduleTestFilePaths: ${{ steps.get-module-test-file-paths.outputs.moduleTestFilePaths }} + modulePath: '${{ env.modulePath }}' - ######################### - # Static validation # - ######################### - job_module_static_validation: - runs-on: ubuntu-20.04 - name: 'Static validation' - if: (fromJson(needs.job_initialize_pipeline.outputs.workflowInput)).staticValidation == 'true' - needs: - - job_initialize_pipeline - steps: - - name: 'Checkout' - uses: actions/checkout@v3 - with: - fetch-depth: 0 - - name: Set environment variables - uses: ./.github/actions/templates/setEnvironmentVariables - with: - variablesPath: ${{ env.variablesPath }} - - name: 'Run tests' - uses: ./.github/actions/templates/validateModulePester - with: - modulePath: '${{ env.modulePath }}' - moduleTestFilePath: '${{ env.moduleTestFilePath }}' - ############################# - # Deployment validation # - ############################# - job_module_deploy_validation: - runs-on: ubuntu-20.04 - name: 'Deploying' - if: | - !cancelled() && - (fromJson(needs.job_initialize_pipeline.outputs.workflowInput)).deploymentValidation == 'true' && - needs.job_module_static_validation.result != 'failure' + ############################## + # Call reusable workflow # + ############################## + call-workflow-passing-data: + name: 'Module' needs: - job_initialize_pipeline - - job_module_static_validation - strategy: - fail-fast: false - matrix: - moduleTestFilePaths: ${{ fromJson(needs.job_initialize_pipeline.outputs.moduleTestFilePaths) }} - steps: - - name: 'Checkout' - uses: actions/checkout@v3 - with: - fetch-depth: 0 - - name: Set environment variables - uses: ./.github/actions/templates/setEnvironmentVariables - with: - variablesPath: ${{ env.variablesPath }} - - name: 'Using test file [${{ matrix.moduleTestFilePaths }}]' - uses: ./.github/actions/templates/validateModuleDeployment - with: - templateFilePath: '${{ env.modulePath }}/${{ matrix.moduleTestFilePaths }}' - location: '${{ env.location }}' - subscriptionId: '${{ secrets.ARM_SUBSCRIPTION_ID }}' - managementGroupId: '${{ secrets.ARM_MGMTGROUP_ID }}' - removeDeployment: '${{ (fromJson(needs.job_initialize_pipeline.outputs.workflowInput)).removeDeployment }}' - - ################## - # Publishing # - ################## - job_publish_module: - name: 'Publishing' - if: github.ref == 'refs/heads/main' || github.ref == 'refs/heads/master' || github.event.inputs.prerelease == 'true' - runs-on: ubuntu-20.04 - needs: - - job_module_deploy_validation - steps: - - name: 'Checkout' - uses: actions/checkout@v3 - with: - fetch-depth: 0 - - name: Set environment variables - uses: ./.github/actions/templates/setEnvironmentVariables - with: - variablesPath: ${{ env.variablesPath }} - - name: 'Publishing' - uses: ./.github/actions/templates/publishModule - with: - templateFilePath: '${{ env.modulePath }}/deploy.bicep' - templateSpecsRGName: '${{ env.templateSpecsRGName }}' - templateSpecsRGLocation: '${{ env.templateSpecsRGLocation }}' - templateSpecsDescription: '${{ env.templateSpecsDescription }}' - templateSpecsDoPublish: '${{ env.templateSpecsDoPublish }}' - bicepRegistryName: '${{ env.bicepRegistryName }}' - bicepRegistryRGName: '${{ env.bicepRegistryRGName }}' - bicepRegistryRgLocation: '${{ env.bicepRegistryRgLocation }}' - bicepRegistryDoPublish: '${{ env.bicepRegistryDoPublish }}' - publishLatest: '${{ env.publishLatest }}' + uses: ./.github/workflows/template.module.yml + with: + workflowInput: '${{ needs.job_initialize_pipeline.outputs.workflowInput }}' + moduleTestFilePaths: '${{ needs.job_initialize_pipeline.outputs.moduleTestFilePaths }}' + modulePath: '${{ needs.job_initialize_pipeline.outputs.modulePath}}' + secrets: inherit diff --git a/.github/workflows/ms.network.applicationsecuritygroups.yml b/.github/workflows/ms.network.applicationsecuritygroups.yml index 3210d091af..34f70b5307 100644 --- a/.github/workflows/ms.network.applicationsecuritygroups.yml +++ b/.github/workflows/ms.network.applicationsecuritygroups.yml @@ -1,4 +1,4 @@ -name: 'Network: ApplicationSecurityGroups' +name: 'Network - ApplicationSecurityGroups' on: workflow_dispatch: @@ -28,6 +28,7 @@ on: - main paths: - '.github/actions/templates/**' + - '.github/workflows/template.module.yml' - '.github/workflows/ms.network.applicationsecuritygroups.yml' - 'modules/Microsoft.Network/applicationSecurityGroups/**' - 'utilities/pipelines/**' @@ -35,14 +36,8 @@ on: - '!*/**/readme.md' env: - variablesPath: 'settings.yml' modulePath: 'modules/Microsoft.Network/applicationSecurityGroups' workflowPath: '.github/workflows/ms.network.applicationsecuritygroups.yml' - AZURE_CREDENTIALS: ${{ secrets.AZURE_CREDENTIALS }} - ARM_SUBSCRIPTION_ID: '${{ secrets.ARM_SUBSCRIPTION_ID }}' - ARM_MGMTGROUP_ID: '${{ secrets.ARM_MGMTGROUP_ID }}' - ARM_TENANT_ID: '${{ secrets.ARM_TENANT_ID }}' - TOKEN_NAMEPREFIX: '${{ secrets.TOKEN_NAMEPREFIX }}' concurrency: group: ${{ github.workflow }} @@ -72,94 +67,19 @@ jobs: outputs: workflowInput: ${{ steps.get-workflow-param.outputs.workflowInput }} moduleTestFilePaths: ${{ steps.get-module-test-file-paths.outputs.moduleTestFilePaths }} + modulePath: '${{ env.modulePath }}' - ######################### - # Static validation # - ######################### - job_module_static_validation: - runs-on: ubuntu-20.04 - name: 'Static validation' - if: (fromJson(needs.job_initialize_pipeline.outputs.workflowInput)).staticValidation == 'true' - needs: - - job_initialize_pipeline - steps: - - name: 'Checkout' - uses: actions/checkout@v3 - with: - fetch-depth: 0 - - name: Set environment variables - uses: ./.github/actions/templates/setEnvironmentVariables - with: - variablesPath: ${{ env.variablesPath }} - - name: 'Run tests' - uses: ./.github/actions/templates/validateModulePester - with: - modulePath: '${{ env.modulePath }}' - moduleTestFilePath: '${{ env.moduleTestFilePath }}' - ############################# - # Deployment validation # - ############################# - job_module_deploy_validation: - runs-on: ubuntu-20.04 - name: 'Deploying' - if: | - !cancelled() && - (fromJson(needs.job_initialize_pipeline.outputs.workflowInput)).deploymentValidation == 'true' && - needs.job_module_static_validation.result != 'failure' + ############################## + # Call reusable workflow # + ############################## + call-workflow-passing-data: + name: 'Module' needs: - job_initialize_pipeline - - job_module_static_validation - strategy: - fail-fast: false - matrix: - moduleTestFilePaths: ${{ fromJson(needs.job_initialize_pipeline.outputs.moduleTestFilePaths) }} - steps: - - name: 'Checkout' - uses: actions/checkout@v3 - with: - fetch-depth: 0 - - name: Set environment variables - uses: ./.github/actions/templates/setEnvironmentVariables - with: - variablesPath: ${{ env.variablesPath }} - - name: 'Using test file [${{ matrix.moduleTestFilePaths }}]' - uses: ./.github/actions/templates/validateModuleDeployment - with: - templateFilePath: '${{ env.modulePath }}/${{ matrix.moduleTestFilePaths }}' - location: '${{ env.location }}' - subscriptionId: '${{ secrets.ARM_SUBSCRIPTION_ID }}' - managementGroupId: '${{ secrets.ARM_MGMTGROUP_ID }}' - removeDeployment: '${{ (fromJson(needs.job_initialize_pipeline.outputs.workflowInput)).removeDeployment }}' - - ################## - # Publishing # - ################## - job_publish_module: - name: 'Publishing' - if: github.ref == 'refs/heads/main' || github.ref == 'refs/heads/master' || github.event.inputs.prerelease == 'true' - runs-on: ubuntu-20.04 - needs: - - job_module_deploy_validation - steps: - - name: 'Checkout' - uses: actions/checkout@v3 - with: - fetch-depth: 0 - - name: Set environment variables - uses: ./.github/actions/templates/setEnvironmentVariables - with: - variablesPath: ${{ env.variablesPath }} - - name: 'Publishing' - uses: ./.github/actions/templates/publishModule - with: - templateFilePath: '${{ env.modulePath }}/deploy.bicep' - templateSpecsRGName: '${{ env.templateSpecsRGName }}' - templateSpecsRGLocation: '${{ env.templateSpecsRGLocation }}' - templateSpecsDescription: '${{ env.templateSpecsDescription }}' - templateSpecsDoPublish: '${{ env.templateSpecsDoPublish }}' - bicepRegistryName: '${{ env.bicepRegistryName }}' - bicepRegistryRGName: '${{ env.bicepRegistryRGName }}' - bicepRegistryRgLocation: '${{ env.bicepRegistryRgLocation }}' - bicepRegistryDoPublish: '${{ env.bicepRegistryDoPublish }}' - publishLatest: '${{ env.publishLatest }}' + uses: ./.github/workflows/template.module.yml + with: + workflowInput: '${{ needs.job_initialize_pipeline.outputs.workflowInput }}' + moduleTestFilePaths: '${{ needs.job_initialize_pipeline.outputs.moduleTestFilePaths }}' + modulePath: '${{ needs.job_initialize_pipeline.outputs.modulePath}}' + secrets: inherit diff --git a/.github/workflows/ms.network.azurefirewalls.yml b/.github/workflows/ms.network.azurefirewalls.yml index be1aea66c4..caf46d0a6c 100644 --- a/.github/workflows/ms.network.azurefirewalls.yml +++ b/.github/workflows/ms.network.azurefirewalls.yml @@ -1,4 +1,4 @@ -name: 'Network: AzureFirewalls' +name: 'Network - AzureFirewalls' on: workflow_dispatch: @@ -28,6 +28,7 @@ on: - main paths: - '.github/actions/templates/**' + - '.github/workflows/template.module.yml' - '.github/workflows/ms.network.azurefirewalls.yml' - 'modules/Microsoft.Network/azureFirewalls/**' - 'utilities/pipelines/**' @@ -35,14 +36,8 @@ on: - '!*/**/readme.md' env: - variablesPath: 'settings.yml' modulePath: 'modules/Microsoft.Network/azureFirewalls' workflowPath: '.github/workflows/ms.network.azurefirewalls.yml' - AZURE_CREDENTIALS: ${{ secrets.AZURE_CREDENTIALS }} - ARM_SUBSCRIPTION_ID: '${{ secrets.ARM_SUBSCRIPTION_ID }}' - ARM_MGMTGROUP_ID: '${{ secrets.ARM_MGMTGROUP_ID }}' - ARM_TENANT_ID: '${{ secrets.ARM_TENANT_ID }}' - TOKEN_NAMEPREFIX: '${{ secrets.TOKEN_NAMEPREFIX }}' concurrency: group: ${{ github.workflow }} @@ -72,94 +67,19 @@ jobs: outputs: workflowInput: ${{ steps.get-workflow-param.outputs.workflowInput }} moduleTestFilePaths: ${{ steps.get-module-test-file-paths.outputs.moduleTestFilePaths }} + modulePath: '${{ env.modulePath }}' - ######################### - # Static validation # - ######################### - job_module_static_validation: - runs-on: ubuntu-20.04 - name: 'Static validation' - if: (fromJson(needs.job_initialize_pipeline.outputs.workflowInput)).staticValidation == 'true' - needs: - - job_initialize_pipeline - steps: - - name: 'Checkout' - uses: actions/checkout@v3 - with: - fetch-depth: 0 - - name: Set environment variables - uses: ./.github/actions/templates/setEnvironmentVariables - with: - variablesPath: ${{ env.variablesPath }} - - name: 'Run tests' - uses: ./.github/actions/templates/validateModulePester - with: - modulePath: '${{ env.modulePath }}' - moduleTestFilePath: '${{ env.moduleTestFilePath }}' - ############################# - # Deployment validation # - ############################# - job_module_deploy_validation: - runs-on: ubuntu-20.04 - name: 'Deploying' - if: | - !cancelled() && - (fromJson(needs.job_initialize_pipeline.outputs.workflowInput)).deploymentValidation == 'true' && - needs.job_module_static_validation.result != 'failure' + ############################## + # Call reusable workflow # + ############################## + call-workflow-passing-data: + name: 'Module' needs: - job_initialize_pipeline - - job_module_static_validation - strategy: - fail-fast: false - matrix: - moduleTestFilePaths: ${{ fromJson(needs.job_initialize_pipeline.outputs.moduleTestFilePaths) }} - steps: - - name: 'Checkout' - uses: actions/checkout@v3 - with: - fetch-depth: 0 - - name: Set environment variables - uses: ./.github/actions/templates/setEnvironmentVariables - with: - variablesPath: ${{ env.variablesPath }} - - name: 'Using test file [${{ matrix.moduleTestFilePaths }}]' - uses: ./.github/actions/templates/validateModuleDeployment - with: - templateFilePath: '${{ env.modulePath }}/${{ matrix.moduleTestFilePaths }}' - location: '${{ env.location }}' - subscriptionId: '${{ secrets.ARM_SUBSCRIPTION_ID }}' - managementGroupId: '${{ secrets.ARM_MGMTGROUP_ID }}' - removeDeployment: '${{ (fromJson(needs.job_initialize_pipeline.outputs.workflowInput)).removeDeployment }}' - - ################## - # Publishing # - ################## - job_publish_module: - name: 'Publishing' - if: github.ref == 'refs/heads/main' || github.ref == 'refs/heads/master' || github.event.inputs.prerelease == 'true' - runs-on: ubuntu-20.04 - needs: - - job_module_deploy_validation - steps: - - name: 'Checkout' - uses: actions/checkout@v3 - with: - fetch-depth: 0 - - name: Set environment variables - uses: ./.github/actions/templates/setEnvironmentVariables - with: - variablesPath: ${{ env.variablesPath }} - - name: 'Publishing' - uses: ./.github/actions/templates/publishModule - with: - templateFilePath: '${{ env.modulePath }}/deploy.bicep' - templateSpecsRGName: '${{ env.templateSpecsRGName }}' - templateSpecsRGLocation: '${{ env.templateSpecsRGLocation }}' - templateSpecsDescription: '${{ env.templateSpecsDescription }}' - templateSpecsDoPublish: '${{ env.templateSpecsDoPublish }}' - bicepRegistryName: '${{ env.bicepRegistryName }}' - bicepRegistryRGName: '${{ env.bicepRegistryRGName }}' - bicepRegistryRgLocation: '${{ env.bicepRegistryRgLocation }}' - bicepRegistryDoPublish: '${{ env.bicepRegistryDoPublish }}' - publishLatest: '${{ env.publishLatest }}' + uses: ./.github/workflows/template.module.yml + with: + workflowInput: '${{ needs.job_initialize_pipeline.outputs.workflowInput }}' + moduleTestFilePaths: '${{ needs.job_initialize_pipeline.outputs.moduleTestFilePaths }}' + modulePath: '${{ needs.job_initialize_pipeline.outputs.modulePath}}' + secrets: inherit diff --git a/.github/workflows/ms.network.bastionhosts.yml b/.github/workflows/ms.network.bastionhosts.yml index e012f6f64f..66e190ce95 100644 --- a/.github/workflows/ms.network.bastionhosts.yml +++ b/.github/workflows/ms.network.bastionhosts.yml @@ -1,4 +1,4 @@ -name: 'Network: BastionHosts' +name: 'Network - BastionHosts' on: workflow_dispatch: @@ -28,6 +28,7 @@ on: - main paths: - '.github/actions/templates/**' + - '.github/workflows/template.module.yml' - '.github/workflows/ms.network.bastionhosts.yml' - 'modules/Microsoft.Network/bastionHosts/**' - 'utilities/pipelines/**' @@ -35,14 +36,8 @@ on: - '!*/**/readme.md' env: - variablesPath: 'settings.yml' modulePath: 'modules/Microsoft.Network/bastionHosts' workflowPath: '.github/workflows/ms.network.bastionhosts.yml' - AZURE_CREDENTIALS: ${{ secrets.AZURE_CREDENTIALS }} - ARM_SUBSCRIPTION_ID: '${{ secrets.ARM_SUBSCRIPTION_ID }}' - ARM_MGMTGROUP_ID: '${{ secrets.ARM_MGMTGROUP_ID }}' - ARM_TENANT_ID: '${{ secrets.ARM_TENANT_ID }}' - TOKEN_NAMEPREFIX: '${{ secrets.TOKEN_NAMEPREFIX }}' concurrency: group: ${{ github.workflow }} @@ -72,94 +67,19 @@ jobs: outputs: workflowInput: ${{ steps.get-workflow-param.outputs.workflowInput }} moduleTestFilePaths: ${{ steps.get-module-test-file-paths.outputs.moduleTestFilePaths }} + modulePath: '${{ env.modulePath }}' - ######################### - # Static validation # - ######################### - job_module_static_validation: - runs-on: ubuntu-20.04 - name: 'Static validation' - if: (fromJson(needs.job_initialize_pipeline.outputs.workflowInput)).staticValidation == 'true' - needs: - - job_initialize_pipeline - steps: - - name: 'Checkout' - uses: actions/checkout@v3 - with: - fetch-depth: 0 - - name: Set environment variables - uses: ./.github/actions/templates/setEnvironmentVariables - with: - variablesPath: ${{ env.variablesPath }} - - name: 'Run tests' - uses: ./.github/actions/templates/validateModulePester - with: - modulePath: '${{ env.modulePath }}' - moduleTestFilePath: '${{ env.moduleTestFilePath }}' - ############################# - # Deployment validation # - ############################# - job_module_deploy_validation: - runs-on: ubuntu-20.04 - name: 'Deploying' - if: | - !cancelled() && - (fromJson(needs.job_initialize_pipeline.outputs.workflowInput)).deploymentValidation == 'true' && - needs.job_module_static_validation.result != 'failure' + ############################## + # Call reusable workflow # + ############################## + call-workflow-passing-data: + name: 'Module' needs: - job_initialize_pipeline - - job_module_static_validation - strategy: - fail-fast: false - matrix: - moduleTestFilePaths: ${{ fromJson(needs.job_initialize_pipeline.outputs.moduleTestFilePaths) }} - steps: - - name: 'Checkout' - uses: actions/checkout@v3 - with: - fetch-depth: 0 - - name: Set environment variables - uses: ./.github/actions/templates/setEnvironmentVariables - with: - variablesPath: ${{ env.variablesPath }} - - name: 'Using test file [${{ matrix.moduleTestFilePaths }}]' - uses: ./.github/actions/templates/validateModuleDeployment - with: - templateFilePath: '${{ env.modulePath }}/${{ matrix.moduleTestFilePaths }}' - location: '${{ env.location }}' - subscriptionId: '${{ secrets.ARM_SUBSCRIPTION_ID }}' - managementGroupId: '${{ secrets.ARM_MGMTGROUP_ID }}' - removeDeployment: '${{ (fromJson(needs.job_initialize_pipeline.outputs.workflowInput)).removeDeployment }}' - - ################## - # Publishing # - ################## - job_publish_module: - name: 'Publishing' - if: github.ref == 'refs/heads/main' || github.ref == 'refs/heads/master' || github.event.inputs.prerelease == 'true' - runs-on: ubuntu-20.04 - needs: - - job_module_deploy_validation - steps: - - name: 'Checkout' - uses: actions/checkout@v3 - with: - fetch-depth: 0 - - name: Set environment variables - uses: ./.github/actions/templates/setEnvironmentVariables - with: - variablesPath: ${{ env.variablesPath }} - - name: 'Publishing' - uses: ./.github/actions/templates/publishModule - with: - templateFilePath: '${{ env.modulePath }}/deploy.bicep' - templateSpecsRGName: '${{ env.templateSpecsRGName }}' - templateSpecsRGLocation: '${{ env.templateSpecsRGLocation }}' - templateSpecsDescription: '${{ env.templateSpecsDescription }}' - templateSpecsDoPublish: '${{ env.templateSpecsDoPublish }}' - bicepRegistryName: '${{ env.bicepRegistryName }}' - bicepRegistryRGName: '${{ env.bicepRegistryRGName }}' - bicepRegistryRgLocation: '${{ env.bicepRegistryRgLocation }}' - bicepRegistryDoPublish: '${{ env.bicepRegistryDoPublish }}' - publishLatest: '${{ env.publishLatest }}' + uses: ./.github/workflows/template.module.yml + with: + workflowInput: '${{ needs.job_initialize_pipeline.outputs.workflowInput }}' + moduleTestFilePaths: '${{ needs.job_initialize_pipeline.outputs.moduleTestFilePaths }}' + modulePath: '${{ needs.job_initialize_pipeline.outputs.modulePath}}' + secrets: inherit diff --git a/.github/workflows/ms.network.connections.yml b/.github/workflows/ms.network.connections.yml index 3e2eeab4b1..36d56d3190 100644 --- a/.github/workflows/ms.network.connections.yml +++ b/.github/workflows/ms.network.connections.yml @@ -1,4 +1,4 @@ -name: 'Network: Connections' +name: 'Network - Connections' on: workflow_dispatch: @@ -28,6 +28,7 @@ on: - main paths: - '.github/actions/templates/**' + - '.github/workflows/template.module.yml' - '.github/workflows/ms.network.connections.yml' - 'modules/Microsoft.Network/connections/**' - 'utilities/pipelines/**' @@ -35,14 +36,8 @@ on: - '!*/**/readme.md' env: - variablesPath: 'settings.yml' modulePath: 'modules/Microsoft.Network/connections' workflowPath: '.github/workflows/ms.network.connections.yml' - AZURE_CREDENTIALS: ${{ secrets.AZURE_CREDENTIALS }} - ARM_SUBSCRIPTION_ID: '${{ secrets.ARM_SUBSCRIPTION_ID }}' - ARM_MGMTGROUP_ID: '${{ secrets.ARM_MGMTGROUP_ID }}' - ARM_TENANT_ID: '${{ secrets.ARM_TENANT_ID }}' - TOKEN_NAMEPREFIX: '${{ secrets.TOKEN_NAMEPREFIX }}' concurrency: group: ${{ github.workflow }} @@ -72,94 +67,19 @@ jobs: outputs: workflowInput: ${{ steps.get-workflow-param.outputs.workflowInput }} moduleTestFilePaths: ${{ steps.get-module-test-file-paths.outputs.moduleTestFilePaths }} + modulePath: '${{ env.modulePath }}' - ######################### - # Static validation # - ######################### - job_module_static_validation: - runs-on: ubuntu-20.04 - name: 'Static validation' - if: (fromJson(needs.job_initialize_pipeline.outputs.workflowInput)).staticValidation == 'true' - needs: - - job_initialize_pipeline - steps: - - name: 'Checkout' - uses: actions/checkout@v3 - with: - fetch-depth: 0 - - name: Set environment variables - uses: ./.github/actions/templates/setEnvironmentVariables - with: - variablesPath: ${{ env.variablesPath }} - - name: 'Run tests' - uses: ./.github/actions/templates/validateModulePester - with: - modulePath: '${{ env.modulePath }}' - moduleTestFilePath: '${{ env.moduleTestFilePath }}' - ############################# - # Deployment validation # - ############################# - job_module_deploy_validation: - runs-on: ubuntu-20.04 - name: 'Deploying' - if: | - !cancelled() && - (fromJson(needs.job_initialize_pipeline.outputs.workflowInput)).deploymentValidation == 'true' && - needs.job_module_static_validation.result != 'failure' + ############################## + # Call reusable workflow # + ############################## + call-workflow-passing-data: + name: 'Module' needs: - job_initialize_pipeline - - job_module_static_validation - strategy: - fail-fast: false - matrix: - moduleTestFilePaths: ${{ fromJson(needs.job_initialize_pipeline.outputs.moduleTestFilePaths) }} - steps: - - name: 'Checkout' - uses: actions/checkout@v3 - with: - fetch-depth: 0 - - name: Set environment variables - uses: ./.github/actions/templates/setEnvironmentVariables - with: - variablesPath: ${{ env.variablesPath }} - - name: 'Using test file [${{ matrix.moduleTestFilePaths }}]' - uses: ./.github/actions/templates/validateModuleDeployment - with: - templateFilePath: '${{ env.modulePath }}/${{ matrix.moduleTestFilePaths }}' - location: '${{ env.location }}' - subscriptionId: '${{ secrets.ARM_SUBSCRIPTION_ID }}' - managementGroupId: '${{ secrets.ARM_MGMTGROUP_ID }}' - removeDeployment: '${{ (fromJson(needs.job_initialize_pipeline.outputs.workflowInput)).removeDeployment }}' - - ################## - # Publishing # - ################## - job_publish_module: - name: 'Publishing' - if: github.ref == 'refs/heads/main' || github.ref == 'refs/heads/master' || github.event.inputs.prerelease == 'true' - runs-on: ubuntu-20.04 - needs: - - job_module_deploy_validation - steps: - - name: 'Checkout' - uses: actions/checkout@v3 - with: - fetch-depth: 0 - - name: Set environment variables - uses: ./.github/actions/templates/setEnvironmentVariables - with: - variablesPath: ${{ env.variablesPath }} - - name: 'Publishing' - uses: ./.github/actions/templates/publishModule - with: - templateFilePath: '${{ env.modulePath }}/deploy.bicep' - templateSpecsRGName: '${{ env.templateSpecsRGName }}' - templateSpecsRGLocation: '${{ env.templateSpecsRGLocation }}' - templateSpecsDescription: '${{ env.templateSpecsDescription }}' - templateSpecsDoPublish: '${{ env.templateSpecsDoPublish }}' - bicepRegistryName: '${{ env.bicepRegistryName }}' - bicepRegistryRGName: '${{ env.bicepRegistryRGName }}' - bicepRegistryRgLocation: '${{ env.bicepRegistryRgLocation }}' - bicepRegistryDoPublish: '${{ env.bicepRegistryDoPublish }}' - publishLatest: '${{ env.publishLatest }}' + uses: ./.github/workflows/template.module.yml + with: + workflowInput: '${{ needs.job_initialize_pipeline.outputs.workflowInput }}' + moduleTestFilePaths: '${{ needs.job_initialize_pipeline.outputs.moduleTestFilePaths }}' + modulePath: '${{ needs.job_initialize_pipeline.outputs.modulePath}}' + secrets: inherit diff --git a/.github/workflows/ms.network.ddosprotectionplans.yml b/.github/workflows/ms.network.ddosprotectionplans.yml index 2267fa31dd..ab55d63526 100644 --- a/.github/workflows/ms.network.ddosprotectionplans.yml +++ b/.github/workflows/ms.network.ddosprotectionplans.yml @@ -1,4 +1,4 @@ -name: 'Network: DdosProtectionPlans' +name: 'Network - DdosProtectionPlans' on: workflow_dispatch: @@ -28,6 +28,7 @@ on: - main paths: - '.github/actions/templates/**' + - '.github/workflows/template.module.yml' - '.github/workflows/ms.network.ddosprotectionplans.yml' - 'modules/Microsoft.Network/ddosProtectionPlans/**' - 'utilities/pipelines/**' @@ -35,14 +36,8 @@ on: - '!*/**/readme.md' env: - variablesPath: 'settings.yml' modulePath: 'modules/Microsoft.Network/ddosProtectionPlans' workflowPath: '.github/workflows/ms.network.ddosprotectionplans.yml' - AZURE_CREDENTIALS: ${{ secrets.AZURE_CREDENTIALS }} - ARM_SUBSCRIPTION_ID: '${{ secrets.ARM_SUBSCRIPTION_ID }}' - ARM_MGMTGROUP_ID: '${{ secrets.ARM_MGMTGROUP_ID }}' - ARM_TENANT_ID: '${{ secrets.ARM_TENANT_ID }}' - TOKEN_NAMEPREFIX: '${{ secrets.TOKEN_NAMEPREFIX }}' concurrency: group: ${{ github.workflow }} @@ -72,94 +67,19 @@ jobs: outputs: workflowInput: ${{ steps.get-workflow-param.outputs.workflowInput }} moduleTestFilePaths: ${{ steps.get-module-test-file-paths.outputs.moduleTestFilePaths }} + modulePath: '${{ env.modulePath }}' - ######################### - # Static validation # - ######################### - job_module_static_validation: - runs-on: ubuntu-20.04 - name: 'Static validation' - if: (fromJson(needs.job_initialize_pipeline.outputs.workflowInput)).staticValidation == 'true' - needs: - - job_initialize_pipeline - steps: - - name: 'Checkout' - uses: actions/checkout@v3 - with: - fetch-depth: 0 - - name: Set environment variables - uses: ./.github/actions/templates/setEnvironmentVariables - with: - variablesPath: ${{ env.variablesPath }} - - name: 'Run tests' - uses: ./.github/actions/templates/validateModulePester - with: - modulePath: '${{ env.modulePath }}' - moduleTestFilePath: '${{ env.moduleTestFilePath }}' - ############################# - # Deployment validation # - ############################# - job_module_deploy_validation: - runs-on: ubuntu-20.04 - name: 'Deploying' - if: | - !cancelled() && - (fromJson(needs.job_initialize_pipeline.outputs.workflowInput)).deploymentValidation == 'true' && - needs.job_module_static_validation.result != 'failure' + ############################## + # Call reusable workflow # + ############################## + call-workflow-passing-data: + name: 'Module' needs: - job_initialize_pipeline - - job_module_static_validation - strategy: - fail-fast: false - matrix: - moduleTestFilePaths: ${{ fromJson(needs.job_initialize_pipeline.outputs.moduleTestFilePaths) }} - steps: - - name: 'Checkout' - uses: actions/checkout@v3 - with: - fetch-depth: 0 - - name: Set environment variables - uses: ./.github/actions/templates/setEnvironmentVariables - with: - variablesPath: ${{ env.variablesPath }} - - name: 'Using test file [${{ matrix.moduleTestFilePaths }}]' - uses: ./.github/actions/templates/validateModuleDeployment - with: - templateFilePath: '${{ env.modulePath }}/${{ matrix.moduleTestFilePaths }}' - location: '${{ env.location }}' - subscriptionId: '${{ secrets.ARM_SUBSCRIPTION_ID }}' - managementGroupId: '${{ secrets.ARM_MGMTGROUP_ID }}' - removeDeployment: '${{ (fromJson(needs.job_initialize_pipeline.outputs.workflowInput)).removeDeployment }}' - - ################## - # Publishing # - ################## - job_publish_module: - name: 'Publishing' - if: github.ref == 'refs/heads/main' || github.ref == 'refs/heads/master' || github.event.inputs.prerelease == 'true' - runs-on: ubuntu-20.04 - needs: - - job_module_deploy_validation - steps: - - name: 'Checkout' - uses: actions/checkout@v3 - with: - fetch-depth: 0 - - name: Set environment variables - uses: ./.github/actions/templates/setEnvironmentVariables - with: - variablesPath: ${{ env.variablesPath }} - - name: 'Publishing' - uses: ./.github/actions/templates/publishModule - with: - templateFilePath: '${{ env.modulePath }}/deploy.bicep' - templateSpecsRGName: '${{ env.templateSpecsRGName }}' - templateSpecsRGLocation: '${{ env.templateSpecsRGLocation }}' - templateSpecsDescription: '${{ env.templateSpecsDescription }}' - templateSpecsDoPublish: '${{ env.templateSpecsDoPublish }}' - bicepRegistryName: '${{ env.bicepRegistryName }}' - bicepRegistryRGName: '${{ env.bicepRegistryRGName }}' - bicepRegistryRgLocation: '${{ env.bicepRegistryRgLocation }}' - bicepRegistryDoPublish: '${{ env.bicepRegistryDoPublish }}' - publishLatest: '${{ env.publishLatest }}' + uses: ./.github/workflows/template.module.yml + with: + workflowInput: '${{ needs.job_initialize_pipeline.outputs.workflowInput }}' + moduleTestFilePaths: '${{ needs.job_initialize_pipeline.outputs.moduleTestFilePaths }}' + modulePath: '${{ needs.job_initialize_pipeline.outputs.modulePath}}' + secrets: inherit diff --git a/.github/workflows/ms.network.dnsresolvers.yml b/.github/workflows/ms.network.dnsresolvers.yml index 293b94a77a..55740c6383 100644 --- a/.github/workflows/ms.network.dnsresolvers.yml +++ b/.github/workflows/ms.network.dnsresolvers.yml @@ -1,4 +1,4 @@ -name: 'Network: DNS Resolvers' +name: 'Network - DNS Resolvers' on: workflow_dispatch: @@ -28,6 +28,7 @@ on: - main paths: - '.github/actions/templates/**' + - '.github/workflows/template.module.yml' - '.github/workflows/ms.network.dnsresolvers.yml' - 'modules/Microsoft.Network/dnsResolvers/**' - 'utilities/pipelines/**' @@ -35,14 +36,8 @@ on: - '!*/**/readme.md' env: - variablesPath: 'settings.yml' modulePath: 'modules/Microsoft.Network/dnsResolvers' workflowPath: '.github/workflows/ms.network.dnsresolvers.yml' - AZURE_CREDENTIALS: ${{ secrets.AZURE_CREDENTIALS }} - ARM_SUBSCRIPTION_ID: '${{ secrets.ARM_SUBSCRIPTION_ID }}' - ARM_MGMTGROUP_ID: '${{ secrets.ARM_MGMTGROUP_ID }}' - ARM_TENANT_ID: '${{ secrets.ARM_TENANT_ID }}' - TOKEN_NAMEPREFIX: '${{ secrets.TOKEN_NAMEPREFIX }}' concurrency: group: ${{ github.workflow }} @@ -72,94 +67,19 @@ jobs: outputs: workflowInput: ${{ steps.get-workflow-param.outputs.workflowInput }} moduleTestFilePaths: ${{ steps.get-module-test-file-paths.outputs.moduleTestFilePaths }} + modulePath: '${{ env.modulePath }}' - ######################### - # Static validation # - ######################### - job_module_static_validation: - runs-on: ubuntu-20.04 - name: 'Static validation' - if: (fromJson(needs.job_initialize_pipeline.outputs.workflowInput)).staticValidation == 'true' - needs: - - job_initialize_pipeline - steps: - - name: 'Checkout' - uses: actions/checkout@v3 - with: - fetch-depth: 0 - - name: Set environment variables - uses: ./.github/actions/templates/setEnvironmentVariables - with: - variablesPath: ${{ env.variablesPath }} - - name: 'Run tests' - uses: ./.github/actions/templates/validateModulePester - with: - modulePath: '${{ env.modulePath }}' - moduleTestFilePath: '${{ env.moduleTestFilePath }}' - ############################# - # Deployment validation # - ############################# - job_module_deploy_validation: - runs-on: ubuntu-20.04 - name: 'Deploying' - if: | - !cancelled() && - (fromJson(needs.job_initialize_pipeline.outputs.workflowInput)).deploymentValidation == 'true' && - needs.job_module_static_validation.result != 'failure' + ############################## + # Call reusable workflow # + ############################## + call-workflow-passing-data: + name: 'Module' needs: - job_initialize_pipeline - - job_module_static_validation - strategy: - fail-fast: false - matrix: - moduleTestFilePaths: ${{ fromJson(needs.job_initialize_pipeline.outputs.moduleTestFilePaths) }} - steps: - - name: 'Checkout' - uses: actions/checkout@v3 - with: - fetch-depth: 0 - - name: Set environment variables - uses: ./.github/actions/templates/setEnvironmentVariables - with: - variablesPath: ${{ env.variablesPath }} - - name: 'Using test file [${{ matrix.moduleTestFilePaths }}]' - uses: ./.github/actions/templates/validateModuleDeployment - with: - templateFilePath: '${{ env.modulePath }}/${{ matrix.moduleTestFilePaths }}' - location: '${{ env.location }}' - subscriptionId: '${{ secrets.ARM_SUBSCRIPTION_ID }}' - managementGroupId: '${{ secrets.ARM_MGMTGROUP_ID }}' - removeDeployment: '${{ (fromJson(needs.job_initialize_pipeline.outputs.workflowInput)).removeDeployment }}' - - ################## - # Publishing # - ################## - job_publish_module: - name: 'Publishing' - if: github.ref == 'refs/heads/main' || github.ref == 'refs/heads/master' || github.event.inputs.prerelease == 'true' - runs-on: ubuntu-20.04 - needs: - - job_module_deploy_validation - steps: - - name: 'Checkout' - uses: actions/checkout@v3 - with: - fetch-depth: 0 - - name: Set environment variables - uses: ./.github/actions/templates/setEnvironmentVariables - with: - variablesPath: ${{ env.variablesPath }} - - name: 'Publishing' - uses: ./.github/actions/templates/publishModule - with: - templateFilePath: '${{ env.modulePath }}/deploy.bicep' - templateSpecsRGName: '${{ env.templateSpecsRGName }}' - templateSpecsRGLocation: '${{ env.templateSpecsRGLocation }}' - templateSpecsDescription: '${{ env.templateSpecsDescription }}' - templateSpecsDoPublish: '${{ env.templateSpecsDoPublish }}' - bicepRegistryName: '${{ env.bicepRegistryName }}' - bicepRegistryRGName: '${{ env.bicepRegistryRGName }}' - bicepRegistryRgLocation: '${{ env.bicepRegistryRgLocation }}' - bicepRegistryDoPublish: '${{ env.bicepRegistryDoPublish }}' - publishLatest: '${{ env.publishLatest }}' + uses: ./.github/workflows/template.module.yml + with: + workflowInput: '${{ needs.job_initialize_pipeline.outputs.workflowInput }}' + moduleTestFilePaths: '${{ needs.job_initialize_pipeline.outputs.moduleTestFilePaths }}' + modulePath: '${{ needs.job_initialize_pipeline.outputs.modulePath}}' + secrets: inherit diff --git a/.github/workflows/ms.network.expressroutecircuits.yml b/.github/workflows/ms.network.expressroutecircuits.yml index 2b283225d4..da0cb7e333 100644 --- a/.github/workflows/ms.network.expressroutecircuits.yml +++ b/.github/workflows/ms.network.expressroutecircuits.yml @@ -1,4 +1,4 @@ -name: 'Network: ExpressRouteCircuits' +name: 'Network - ExpressRouteCircuits' on: workflow_dispatch: @@ -28,6 +28,7 @@ on: - main paths: - '.github/actions/templates/**' + - '.github/workflows/template.module.yml' - '.github/workflows/ms.network.expressroutecircuits.yml' - 'modules/Microsoft.Network/expressRouteCircuits/**' - 'utilities/pipelines/**' @@ -35,14 +36,8 @@ on: - '!*/**/readme.md' env: - variablesPath: 'settings.yml' modulePath: 'modules/Microsoft.Network/expressRouteCircuits' workflowPath: '.github/workflows/ms.network.expressroutecircuits.yml' - AZURE_CREDENTIALS: ${{ secrets.AZURE_CREDENTIALS }} - ARM_SUBSCRIPTION_ID: '${{ secrets.ARM_SUBSCRIPTION_ID }}' - ARM_MGMTGROUP_ID: '${{ secrets.ARM_MGMTGROUP_ID }}' - ARM_TENANT_ID: '${{ secrets.ARM_TENANT_ID }}' - TOKEN_NAMEPREFIX: '${{ secrets.TOKEN_NAMEPREFIX }}' concurrency: group: ${{ github.workflow }} @@ -72,94 +67,19 @@ jobs: outputs: workflowInput: ${{ steps.get-workflow-param.outputs.workflowInput }} moduleTestFilePaths: ${{ steps.get-module-test-file-paths.outputs.moduleTestFilePaths }} + modulePath: '${{ env.modulePath }}' - ######################### - # Static validation # - ######################### - job_module_static_validation: - runs-on: ubuntu-20.04 - name: 'Static validation' - if: (fromJson(needs.job_initialize_pipeline.outputs.workflowInput)).staticValidation == 'true' - needs: - - job_initialize_pipeline - steps: - - name: 'Checkout' - uses: actions/checkout@v3 - with: - fetch-depth: 0 - - name: Set environment variables - uses: ./.github/actions/templates/setEnvironmentVariables - with: - variablesPath: ${{ env.variablesPath }} - - name: 'Run tests' - uses: ./.github/actions/templates/validateModulePester - with: - modulePath: '${{ env.modulePath }}' - moduleTestFilePath: '${{ env.moduleTestFilePath }}' - ############################# - # Deployment validation # - ############################# - job_module_deploy_validation: - runs-on: ubuntu-20.04 - name: 'Deploying' - if: | - !cancelled() && - (fromJson(needs.job_initialize_pipeline.outputs.workflowInput)).deploymentValidation == 'true' && - needs.job_module_static_validation.result != 'failure' + ############################## + # Call reusable workflow # + ############################## + call-workflow-passing-data: + name: 'Module' needs: - job_initialize_pipeline - - job_module_static_validation - strategy: - fail-fast: false - matrix: - moduleTestFilePaths: ${{ fromJson(needs.job_initialize_pipeline.outputs.moduleTestFilePaths) }} - steps: - - name: 'Checkout' - uses: actions/checkout@v3 - with: - fetch-depth: 0 - - name: Set environment variables - uses: ./.github/actions/templates/setEnvironmentVariables - with: - variablesPath: ${{ env.variablesPath }} - - name: 'Using test file [${{ matrix.moduleTestFilePaths }}]' - uses: ./.github/actions/templates/validateModuleDeployment - with: - templateFilePath: '${{ env.modulePath }}/${{ matrix.moduleTestFilePaths }}' - location: '${{ env.location }}' - subscriptionId: '${{ secrets.ARM_SUBSCRIPTION_ID }}' - managementGroupId: '${{ secrets.ARM_MGMTGROUP_ID }}' - removeDeployment: '${{ (fromJson(needs.job_initialize_pipeline.outputs.workflowInput)).removeDeployment }}' - - ################## - # Publishing # - ################## - job_publish_module: - name: 'Publishing' - if: github.ref == 'refs/heads/main' || github.ref == 'refs/heads/master' || github.event.inputs.prerelease == 'true' - runs-on: ubuntu-20.04 - needs: - - job_module_deploy_validation - steps: - - name: 'Checkout' - uses: actions/checkout@v3 - with: - fetch-depth: 0 - - name: Set environment variables - uses: ./.github/actions/templates/setEnvironmentVariables - with: - variablesPath: ${{ env.variablesPath }} - - name: 'Publishing' - uses: ./.github/actions/templates/publishModule - with: - templateFilePath: '${{ env.modulePath }}/deploy.bicep' - templateSpecsRGName: '${{ env.templateSpecsRGName }}' - templateSpecsRGLocation: '${{ env.templateSpecsRGLocation }}' - templateSpecsDescription: '${{ env.templateSpecsDescription }}' - templateSpecsDoPublish: '${{ env.templateSpecsDoPublish }}' - bicepRegistryName: '${{ env.bicepRegistryName }}' - bicepRegistryRGName: '${{ env.bicepRegistryRGName }}' - bicepRegistryRgLocation: '${{ env.bicepRegistryRgLocation }}' - bicepRegistryDoPublish: '${{ env.bicepRegistryDoPublish }}' - publishLatest: '${{ env.publishLatest }}' + uses: ./.github/workflows/template.module.yml + with: + workflowInput: '${{ needs.job_initialize_pipeline.outputs.workflowInput }}' + moduleTestFilePaths: '${{ needs.job_initialize_pipeline.outputs.moduleTestFilePaths }}' + modulePath: '${{ needs.job_initialize_pipeline.outputs.modulePath}}' + secrets: inherit diff --git a/.github/workflows/ms.network.firewallpolicies.yml b/.github/workflows/ms.network.firewallpolicies.yml index 2b6d2218aa..117b7dc120 100644 --- a/.github/workflows/ms.network.firewallpolicies.yml +++ b/.github/workflows/ms.network.firewallpolicies.yml @@ -1,4 +1,4 @@ -name: 'Network: FirewallPolicies' +name: 'Network - FirewallPolicies' on: workflow_dispatch: @@ -28,6 +28,7 @@ on: - main paths: - '.github/actions/templates/**' + - '.github/workflows/template.module.yml' - '.github/workflows/ms.network.firewallpolicies.yml' - 'modules/Microsoft.Network/firewallPolicies/**' - 'utilities/pipelines/**' @@ -35,14 +36,8 @@ on: - '!*/**/readme.md' env: - variablesPath: 'settings.yml' modulePath: 'modules/Microsoft.Network/firewallPolicies' workflowPath: '.github/workflows/ms.network.firewallpolicies.yml' - AZURE_CREDENTIALS: ${{ secrets.AZURE_CREDENTIALS }} - ARM_SUBSCRIPTION_ID: '${{ secrets.ARM_SUBSCRIPTION_ID }}' - ARM_MGMTGROUP_ID: '${{ secrets.ARM_MGMTGROUP_ID }}' - ARM_TENANT_ID: '${{ secrets.ARM_TENANT_ID }}' - TOKEN_NAMEPREFIX: '${{ secrets.TOKEN_NAMEPREFIX }}' concurrency: group: ${{ github.workflow }} @@ -72,94 +67,19 @@ jobs: outputs: workflowInput: ${{ steps.get-workflow-param.outputs.workflowInput }} moduleTestFilePaths: ${{ steps.get-module-test-file-paths.outputs.moduleTestFilePaths }} + modulePath: '${{ env.modulePath }}' - ######################### - # Static validation # - ######################### - job_module_static_validation: - runs-on: ubuntu-20.04 - name: 'Static validation' - if: (fromJson(needs.job_initialize_pipeline.outputs.workflowInput)).staticValidation == 'true' - needs: - - job_initialize_pipeline - steps: - - name: 'Checkout' - uses: actions/checkout@v3 - with: - fetch-depth: 0 - - name: Set environment variables - uses: ./.github/actions/templates/setEnvironmentVariables - with: - variablesPath: ${{ env.variablesPath }} - - name: 'Run tests' - uses: ./.github/actions/templates/validateModulePester - with: - modulePath: '${{ env.modulePath }}' - moduleTestFilePath: '${{ env.moduleTestFilePath }}' - ############################# - # Deployment validation # - ############################# - job_module_deploy_validation: - runs-on: ubuntu-20.04 - name: 'Deploying' - if: | - !cancelled() && - (fromJson(needs.job_initialize_pipeline.outputs.workflowInput)).deploymentValidation == 'true' && - needs.job_module_static_validation.result != 'failure' + ############################## + # Call reusable workflow # + ############################## + call-workflow-passing-data: + name: 'Module' needs: - job_initialize_pipeline - - job_module_static_validation - strategy: - fail-fast: false - matrix: - moduleTestFilePaths: ${{ fromJson(needs.job_initialize_pipeline.outputs.moduleTestFilePaths) }} - steps: - - name: 'Checkout' - uses: actions/checkout@v3 - with: - fetch-depth: 0 - - name: Set environment variables - uses: ./.github/actions/templates/setEnvironmentVariables - with: - variablesPath: ${{ env.variablesPath }} - - name: 'Using test file [${{ matrix.moduleTestFilePaths }}]' - uses: ./.github/actions/templates/validateModuleDeployment - with: - templateFilePath: '${{ env.modulePath }}/${{ matrix.moduleTestFilePaths }}' - location: '${{ env.location }}' - subscriptionId: '${{ secrets.ARM_SUBSCRIPTION_ID }}' - managementGroupId: '${{ secrets.ARM_MGMTGROUP_ID }}' - removeDeployment: '${{ (fromJson(needs.job_initialize_pipeline.outputs.workflowInput)).removeDeployment }}' - - ################## - # Publishing # - ################## - job_publish_module: - name: 'Publishing' - if: github.ref == 'refs/heads/main' || github.ref == 'refs/heads/master' || github.event.inputs.prerelease == 'true' - runs-on: ubuntu-20.04 - needs: - - job_module_deploy_validation - steps: - - name: 'Checkout' - uses: actions/checkout@v3 - with: - fetch-depth: 0 - - name: Set environment variables - uses: ./.github/actions/templates/setEnvironmentVariables - with: - variablesPath: ${{ env.variablesPath }} - - name: 'Publishing' - uses: ./.github/actions/templates/publishModule - with: - templateFilePath: '${{ env.modulePath }}/deploy.bicep' - templateSpecsRGName: '${{ env.templateSpecsRGName }}' - templateSpecsRGLocation: '${{ env.templateSpecsRGLocation }}' - templateSpecsDescription: '${{ env.templateSpecsDescription }}' - templateSpecsDoPublish: '${{ env.templateSpecsDoPublish }}' - bicepRegistryName: '${{ env.bicepRegistryName }}' - bicepRegistryRGName: '${{ env.bicepRegistryRGName }}' - bicepRegistryRgLocation: '${{ env.bicepRegistryRgLocation }}' - bicepRegistryDoPublish: '${{ env.bicepRegistryDoPublish }}' - publishLatest: '${{ env.publishLatest }}' + uses: ./.github/workflows/template.module.yml + with: + workflowInput: '${{ needs.job_initialize_pipeline.outputs.workflowInput }}' + moduleTestFilePaths: '${{ needs.job_initialize_pipeline.outputs.moduleTestFilePaths }}' + modulePath: '${{ needs.job_initialize_pipeline.outputs.modulePath}}' + secrets: inherit diff --git a/.github/workflows/ms.network.frontdoors.yml b/.github/workflows/ms.network.frontdoors.yml index be1aa277ad..927fc473a4 100644 --- a/.github/workflows/ms.network.frontdoors.yml +++ b/.github/workflows/ms.network.frontdoors.yml @@ -1,4 +1,4 @@ -name: 'Network: Frontdoors' +name: 'Network - Frontdoors' on: workflow_dispatch: @@ -28,6 +28,7 @@ on: - main paths: - '.github/actions/templates/**' + - '.github/workflows/template.module.yml' - '.github/workflows/ms.network.frontdoors.yml' - 'modules/Microsoft.Network/frontDoors/**' - 'utilities/pipelines/**' @@ -35,14 +36,8 @@ on: - '!*/**/readme.md' env: - variablesPath: 'settings.yml' modulePath: 'modules/Microsoft.Network/frontDoors' workflowPath: '.github/workflows/ms.network.frontdoors.yml' - AZURE_CREDENTIALS: ${{ secrets.AZURE_CREDENTIALS }} - ARM_SUBSCRIPTION_ID: '${{ secrets.ARM_SUBSCRIPTION_ID }}' - ARM_MGMTGROUP_ID: '${{ secrets.ARM_MGMTGROUP_ID }}' - ARM_TENANT_ID: '${{ secrets.ARM_TENANT_ID }}' - TOKEN_NAMEPREFIX: '${{ secrets.TOKEN_NAMEPREFIX }}' concurrency: group: ${{ github.workflow }} @@ -72,94 +67,19 @@ jobs: outputs: workflowInput: ${{ steps.get-workflow-param.outputs.workflowInput }} moduleTestFilePaths: ${{ steps.get-module-test-file-paths.outputs.moduleTestFilePaths }} + modulePath: '${{ env.modulePath }}' - ######################### - # Static validation # - ######################### - job_module_static_validation: - runs-on: ubuntu-20.04 - name: 'Static validation' - if: (fromJson(needs.job_initialize_pipeline.outputs.workflowInput)).staticValidation == 'true' - needs: - - job_initialize_pipeline - steps: - - name: 'Checkout' - uses: actions/checkout@v3 - with: - fetch-depth: 0 - - name: Set environment variables - uses: ./.github/actions/templates/setEnvironmentVariables - with: - variablesPath: ${{ env.variablesPath }} - - name: 'Run tests' - uses: ./.github/actions/templates/validateModulePester - with: - modulePath: '${{ env.modulePath }}' - moduleTestFilePath: '${{ env.moduleTestFilePath }}' - ############################# - # Deployment validation # - ############################# - job_module_deploy_validation: - runs-on: ubuntu-20.04 - name: 'Deploying' - if: | - !cancelled() && - (fromJson(needs.job_initialize_pipeline.outputs.workflowInput)).deploymentValidation == 'true' && - needs.job_module_static_validation.result != 'failure' + ############################## + # Call reusable workflow # + ############################## + call-workflow-passing-data: + name: 'Module' needs: - job_initialize_pipeline - - job_module_static_validation - strategy: - fail-fast: false - matrix: - moduleTestFilePaths: ${{ fromJson(needs.job_initialize_pipeline.outputs.moduleTestFilePaths) }} - steps: - - name: 'Checkout' - uses: actions/checkout@v3 - with: - fetch-depth: 0 - - name: Set environment variables - uses: ./.github/actions/templates/setEnvironmentVariables - with: - variablesPath: ${{ env.variablesPath }} - - name: 'Using test file [${{ matrix.moduleTestFilePaths }}]' - uses: ./.github/actions/templates/validateModuleDeployment - with: - templateFilePath: '${{ env.modulePath }}/${{ matrix.moduleTestFilePaths }}' - location: '${{ env.location }}' - subscriptionId: '${{ secrets.ARM_SUBSCRIPTION_ID }}' - managementGroupId: '${{ secrets.ARM_MGMTGROUP_ID }}' - removeDeployment: '${{ (fromJson(needs.job_initialize_pipeline.outputs.workflowInput)).removeDeployment }}' - - ################## - # Publishing # - ################## - job_publish_module: - name: 'Publishing' - if: github.ref == 'refs/heads/main' || github.ref == 'refs/heads/master' || github.event.inputs.prerelease == 'true' - runs-on: ubuntu-20.04 - needs: - - job_module_deploy_validation - steps: - - name: 'Checkout' - uses: actions/checkout@v3 - with: - fetch-depth: 0 - - name: Set environment variables - uses: ./.github/actions/templates/setEnvironmentVariables - with: - variablesPath: ${{ env.variablesPath }} - - name: 'Publishing' - uses: ./.github/actions/templates/publishModule - with: - templateFilePath: '${{ env.modulePath }}/deploy.bicep' - templateSpecsRGName: '${{ env.templateSpecsRGName }}' - templateSpecsRGLocation: '${{ env.templateSpecsRGLocation }}' - templateSpecsDescription: '${{ env.templateSpecsDescription }}' - templateSpecsDoPublish: '${{ env.templateSpecsDoPublish }}' - bicepRegistryName: '${{ env.bicepRegistryName }}' - bicepRegistryRGName: '${{ env.bicepRegistryRGName }}' - bicepRegistryRgLocation: '${{ env.bicepRegistryRgLocation }}' - bicepRegistryDoPublish: '${{ env.bicepRegistryDoPublish }}' - publishLatest: '${{ env.publishLatest }}' + uses: ./.github/workflows/template.module.yml + with: + workflowInput: '${{ needs.job_initialize_pipeline.outputs.workflowInput }}' + moduleTestFilePaths: '${{ needs.job_initialize_pipeline.outputs.moduleTestFilePaths }}' + modulePath: '${{ needs.job_initialize_pipeline.outputs.modulePath}}' + secrets: inherit diff --git a/.github/workflows/ms.network.ipgroups.yml b/.github/workflows/ms.network.ipgroups.yml index b94cf3e7e3..c92d7ae964 100644 --- a/.github/workflows/ms.network.ipgroups.yml +++ b/.github/workflows/ms.network.ipgroups.yml @@ -1,4 +1,4 @@ -name: 'Network: IpGroups' +name: 'Network - IpGroups' on: workflow_dispatch: @@ -28,6 +28,7 @@ on: - main paths: - '.github/actions/templates/**' + - '.github/workflows/template.module.yml' - '.github/workflows/ms.network.ipgroups.yml' - 'modules/Microsoft.Network/ipGroups/**' - 'utilities/pipelines/**' @@ -35,14 +36,8 @@ on: - '!*/**/readme.md' env: - variablesPath: 'settings.yml' modulePath: 'modules/Microsoft.Network/ipGroups' workflowPath: '.github/workflows/ms.network.ipgroups.yml' - AZURE_CREDENTIALS: ${{ secrets.AZURE_CREDENTIALS }} - ARM_SUBSCRIPTION_ID: '${{ secrets.ARM_SUBSCRIPTION_ID }}' - ARM_MGMTGROUP_ID: '${{ secrets.ARM_MGMTGROUP_ID }}' - ARM_TENANT_ID: '${{ secrets.ARM_TENANT_ID }}' - TOKEN_NAMEPREFIX: '${{ secrets.TOKEN_NAMEPREFIX }}' concurrency: group: ${{ github.workflow }} @@ -72,94 +67,19 @@ jobs: outputs: workflowInput: ${{ steps.get-workflow-param.outputs.workflowInput }} moduleTestFilePaths: ${{ steps.get-module-test-file-paths.outputs.moduleTestFilePaths }} + modulePath: '${{ env.modulePath }}' - ######################### - # Static validation # - ######################### - job_module_static_validation: - runs-on: ubuntu-20.04 - name: 'Static validation' - if: (fromJson(needs.job_initialize_pipeline.outputs.workflowInput)).staticValidation == 'true' - needs: - - job_initialize_pipeline - steps: - - name: 'Checkout' - uses: actions/checkout@v3 - with: - fetch-depth: 0 - - name: Set environment variables - uses: ./.github/actions/templates/setEnvironmentVariables - with: - variablesPath: ${{ env.variablesPath }} - - name: 'Run tests' - uses: ./.github/actions/templates/validateModulePester - with: - modulePath: '${{ env.modulePath }}' - moduleTestFilePath: '${{ env.moduleTestFilePath }}' - ############################# - # Deployment validation # - ############################# - job_module_deploy_validation: - runs-on: ubuntu-20.04 - name: 'Deploying' - if: | - !cancelled() && - (fromJson(needs.job_initialize_pipeline.outputs.workflowInput)).deploymentValidation == 'true' && - needs.job_module_static_validation.result != 'failure' + ############################## + # Call reusable workflow # + ############################## + call-workflow-passing-data: + name: 'Module' needs: - job_initialize_pipeline - - job_module_static_validation - strategy: - fail-fast: false - matrix: - moduleTestFilePaths: ${{ fromJson(needs.job_initialize_pipeline.outputs.moduleTestFilePaths) }} - steps: - - name: 'Checkout' - uses: actions/checkout@v3 - with: - fetch-depth: 0 - - name: Set environment variables - uses: ./.github/actions/templates/setEnvironmentVariables - with: - variablesPath: ${{ env.variablesPath }} - - name: 'Using test file [${{ matrix.moduleTestFilePaths }}]' - uses: ./.github/actions/templates/validateModuleDeployment - with: - templateFilePath: '${{ env.modulePath }}/${{ matrix.moduleTestFilePaths }}' - location: '${{ env.location }}' - subscriptionId: '${{ secrets.ARM_SUBSCRIPTION_ID }}' - managementGroupId: '${{ secrets.ARM_MGMTGROUP_ID }}' - removeDeployment: '${{ (fromJson(needs.job_initialize_pipeline.outputs.workflowInput)).removeDeployment }}' - - ################## - # Publishing # - ################## - job_publish_module: - name: 'Publishing' - if: github.ref == 'refs/heads/main' || github.ref == 'refs/heads/master' || github.event.inputs.prerelease == 'true' - runs-on: ubuntu-20.04 - needs: - - job_module_deploy_validation - steps: - - name: 'Checkout' - uses: actions/checkout@v3 - with: - fetch-depth: 0 - - name: Set environment variables - uses: ./.github/actions/templates/setEnvironmentVariables - with: - variablesPath: ${{ env.variablesPath }} - - name: 'Publishing' - uses: ./.github/actions/templates/publishModule - with: - templateFilePath: '${{ env.modulePath }}/deploy.bicep' - templateSpecsRGName: '${{ env.templateSpecsRGName }}' - templateSpecsRGLocation: '${{ env.templateSpecsRGLocation }}' - templateSpecsDescription: '${{ env.templateSpecsDescription }}' - templateSpecsDoPublish: '${{ env.templateSpecsDoPublish }}' - bicepRegistryName: '${{ env.bicepRegistryName }}' - bicepRegistryRGName: '${{ env.bicepRegistryRGName }}' - bicepRegistryRgLocation: '${{ env.bicepRegistryRgLocation }}' - bicepRegistryDoPublish: '${{ env.bicepRegistryDoPublish }}' - publishLatest: '${{ env.publishLatest }}' + uses: ./.github/workflows/template.module.yml + with: + workflowInput: '${{ needs.job_initialize_pipeline.outputs.workflowInput }}' + moduleTestFilePaths: '${{ needs.job_initialize_pipeline.outputs.moduleTestFilePaths }}' + modulePath: '${{ needs.job_initialize_pipeline.outputs.modulePath}}' + secrets: inherit diff --git a/.github/workflows/ms.network.loadbalancers.yml b/.github/workflows/ms.network.loadbalancers.yml index 896d6c75ed..dc649f3faf 100644 --- a/.github/workflows/ms.network.loadbalancers.yml +++ b/.github/workflows/ms.network.loadbalancers.yml @@ -1,4 +1,4 @@ -name: 'Network: LoadBalancers' +name: 'Network - LoadBalancers' on: workflow_dispatch: @@ -28,6 +28,7 @@ on: - main paths: - '.github/actions/templates/**' + - '.github/workflows/template.module.yml' - '.github/workflows/ms.network.loadbalancers.yml' - 'modules/Microsoft.Network/loadBalancers/**' - 'utilities/pipelines/**' @@ -35,14 +36,8 @@ on: - '!*/**/readme.md' env: - variablesPath: 'settings.yml' modulePath: 'modules/Microsoft.Network/loadBalancers' workflowPath: '.github/workflows/ms.network.loadbalancers.yml' - AZURE_CREDENTIALS: ${{ secrets.AZURE_CREDENTIALS }} - ARM_SUBSCRIPTION_ID: '${{ secrets.ARM_SUBSCRIPTION_ID }}' - ARM_MGMTGROUP_ID: '${{ secrets.ARM_MGMTGROUP_ID }}' - ARM_TENANT_ID: '${{ secrets.ARM_TENANT_ID }}' - TOKEN_NAMEPREFIX: '${{ secrets.TOKEN_NAMEPREFIX }}' concurrency: group: ${{ github.workflow }} @@ -72,94 +67,19 @@ jobs: outputs: workflowInput: ${{ steps.get-workflow-param.outputs.workflowInput }} moduleTestFilePaths: ${{ steps.get-module-test-file-paths.outputs.moduleTestFilePaths }} + modulePath: '${{ env.modulePath }}' - ######################### - # Static validation # - ######################### - job_module_static_validation: - runs-on: ubuntu-20.04 - name: 'Static validation' - if: (fromJson(needs.job_initialize_pipeline.outputs.workflowInput)).staticValidation == 'true' - needs: - - job_initialize_pipeline - steps: - - name: 'Checkout' - uses: actions/checkout@v3 - with: - fetch-depth: 0 - - name: Set environment variables - uses: ./.github/actions/templates/setEnvironmentVariables - with: - variablesPath: ${{ env.variablesPath }} - - name: 'Run tests' - uses: ./.github/actions/templates/validateModulePester - with: - modulePath: '${{ env.modulePath }}' - moduleTestFilePath: '${{ env.moduleTestFilePath }}' - ############################# - # Deployment validation # - ############################# - job_module_deploy_validation: - runs-on: ubuntu-20.04 - name: 'Deploying' - if: | - !cancelled() && - (fromJson(needs.job_initialize_pipeline.outputs.workflowInput)).deploymentValidation == 'true' && - needs.job_module_static_validation.result != 'failure' + ############################## + # Call reusable workflow # + ############################## + call-workflow-passing-data: + name: 'Module' needs: - job_initialize_pipeline - - job_module_static_validation - strategy: - fail-fast: false - matrix: - moduleTestFilePaths: ${{ fromJson(needs.job_initialize_pipeline.outputs.moduleTestFilePaths) }} - steps: - - name: 'Checkout' - uses: actions/checkout@v3 - with: - fetch-depth: 0 - - name: Set environment variables - uses: ./.github/actions/templates/setEnvironmentVariables - with: - variablesPath: ${{ env.variablesPath }} - - name: 'Using test file [${{ matrix.moduleTestFilePaths }}]' - uses: ./.github/actions/templates/validateModuleDeployment - with: - templateFilePath: '${{ env.modulePath }}/${{ matrix.moduleTestFilePaths }}' - location: '${{ env.location }}' - subscriptionId: '${{ secrets.ARM_SUBSCRIPTION_ID }}' - managementGroupId: '${{ secrets.ARM_MGMTGROUP_ID }}' - removeDeployment: '${{ (fromJson(needs.job_initialize_pipeline.outputs.workflowInput)).removeDeployment }}' - - ################## - # Publishing # - ################## - job_publish_module: - name: 'Publishing' - if: github.ref == 'refs/heads/main' || github.ref == 'refs/heads/master' || github.event.inputs.prerelease == 'true' - runs-on: ubuntu-20.04 - needs: - - job_module_deploy_validation - steps: - - name: 'Checkout' - uses: actions/checkout@v3 - with: - fetch-depth: 0 - - name: Set environment variables - uses: ./.github/actions/templates/setEnvironmentVariables - with: - variablesPath: ${{ env.variablesPath }} - - name: 'Publishing' - uses: ./.github/actions/templates/publishModule - with: - templateFilePath: '${{ env.modulePath }}/deploy.bicep' - templateSpecsRGName: '${{ env.templateSpecsRGName }}' - templateSpecsRGLocation: '${{ env.templateSpecsRGLocation }}' - templateSpecsDescription: '${{ env.templateSpecsDescription }}' - templateSpecsDoPublish: '${{ env.templateSpecsDoPublish }}' - bicepRegistryName: '${{ env.bicepRegistryName }}' - bicepRegistryRGName: '${{ env.bicepRegistryRGName }}' - bicepRegistryRgLocation: '${{ env.bicepRegistryRgLocation }}' - bicepRegistryDoPublish: '${{ env.bicepRegistryDoPublish }}' - publishLatest: '${{ env.publishLatest }}' + uses: ./.github/workflows/template.module.yml + with: + workflowInput: '${{ needs.job_initialize_pipeline.outputs.workflowInput }}' + moduleTestFilePaths: '${{ needs.job_initialize_pipeline.outputs.moduleTestFilePaths }}' + modulePath: '${{ needs.job_initialize_pipeline.outputs.modulePath}}' + secrets: inherit diff --git a/.github/workflows/ms.network.localnetworkgateways.yml b/.github/workflows/ms.network.localnetworkgateways.yml index 473c3b107c..38c21daf80 100644 --- a/.github/workflows/ms.network.localnetworkgateways.yml +++ b/.github/workflows/ms.network.localnetworkgateways.yml @@ -1,4 +1,4 @@ -name: 'Network: LocalNetworkGateways' +name: 'Network - LocalNetworkGateways' on: workflow_dispatch: @@ -28,6 +28,7 @@ on: - main paths: - '.github/actions/templates/**' + - '.github/workflows/template.module.yml' - '.github/workflows/ms.network.localnetworkgateways.yml' - 'modules/Microsoft.Network/localNetworkGateways/**' - 'utilities/pipelines/**' @@ -35,14 +36,8 @@ on: - '!*/**/readme.md' env: - variablesPath: 'settings.yml' modulePath: 'modules/Microsoft.Network/localNetworkGateways' workflowPath: '.github/workflows/ms.network.localnetworkgateways.yml' - AZURE_CREDENTIALS: ${{ secrets.AZURE_CREDENTIALS }} - ARM_SUBSCRIPTION_ID: '${{ secrets.ARM_SUBSCRIPTION_ID }}' - ARM_MGMTGROUP_ID: '${{ secrets.ARM_MGMTGROUP_ID }}' - ARM_TENANT_ID: '${{ secrets.ARM_TENANT_ID }}' - TOKEN_NAMEPREFIX: '${{ secrets.TOKEN_NAMEPREFIX }}' concurrency: group: ${{ github.workflow }} @@ -72,94 +67,19 @@ jobs: outputs: workflowInput: ${{ steps.get-workflow-param.outputs.workflowInput }} moduleTestFilePaths: ${{ steps.get-module-test-file-paths.outputs.moduleTestFilePaths }} + modulePath: '${{ env.modulePath }}' - ######################### - # Static validation # - ######################### - job_module_static_validation: - runs-on: ubuntu-20.04 - name: 'Static validation' - if: (fromJson(needs.job_initialize_pipeline.outputs.workflowInput)).staticValidation == 'true' - needs: - - job_initialize_pipeline - steps: - - name: 'Checkout' - uses: actions/checkout@v3 - with: - fetch-depth: 0 - - name: Set environment variables - uses: ./.github/actions/templates/setEnvironmentVariables - with: - variablesPath: ${{ env.variablesPath }} - - name: 'Run tests' - uses: ./.github/actions/templates/validateModulePester - with: - modulePath: '${{ env.modulePath }}' - moduleTestFilePath: '${{ env.moduleTestFilePath }}' - ############################# - # Deployment validation # - ############################# - job_module_deploy_validation: - runs-on: ubuntu-20.04 - name: 'Deploying' - if: | - !cancelled() && - (fromJson(needs.job_initialize_pipeline.outputs.workflowInput)).deploymentValidation == 'true' && - needs.job_module_static_validation.result != 'failure' + ############################## + # Call reusable workflow # + ############################## + call-workflow-passing-data: + name: 'Module' needs: - job_initialize_pipeline - - job_module_static_validation - strategy: - fail-fast: false - matrix: - moduleTestFilePaths: ${{ fromJson(needs.job_initialize_pipeline.outputs.moduleTestFilePaths) }} - steps: - - name: 'Checkout' - uses: actions/checkout@v3 - with: - fetch-depth: 0 - - name: Set environment variables - uses: ./.github/actions/templates/setEnvironmentVariables - with: - variablesPath: ${{ env.variablesPath }} - - name: 'Using test file [${{ matrix.moduleTestFilePaths }}]' - uses: ./.github/actions/templates/validateModuleDeployment - with: - templateFilePath: '${{ env.modulePath }}/${{ matrix.moduleTestFilePaths }}' - location: '${{ env.location }}' - subscriptionId: '${{ secrets.ARM_SUBSCRIPTION_ID }}' - managementGroupId: '${{ secrets.ARM_MGMTGROUP_ID }}' - removeDeployment: '${{ (fromJson(needs.job_initialize_pipeline.outputs.workflowInput)).removeDeployment }}' - - ################## - # Publishing # - ################## - job_publish_module: - name: 'Publishing' - if: github.ref == 'refs/heads/main' || github.ref == 'refs/heads/master' || github.event.inputs.prerelease == 'true' - runs-on: ubuntu-20.04 - needs: - - job_module_deploy_validation - steps: - - name: 'Checkout' - uses: actions/checkout@v3 - with: - fetch-depth: 0 - - name: Set environment variables - uses: ./.github/actions/templates/setEnvironmentVariables - with: - variablesPath: ${{ env.variablesPath }} - - name: 'Publishing' - uses: ./.github/actions/templates/publishModule - with: - templateFilePath: '${{ env.modulePath }}/deploy.bicep' - templateSpecsRGName: '${{ env.templateSpecsRGName }}' - templateSpecsRGLocation: '${{ env.templateSpecsRGLocation }}' - templateSpecsDescription: '${{ env.templateSpecsDescription }}' - templateSpecsDoPublish: '${{ env.templateSpecsDoPublish }}' - bicepRegistryName: '${{ env.bicepRegistryName }}' - bicepRegistryRGName: '${{ env.bicepRegistryRGName }}' - bicepRegistryRgLocation: '${{ env.bicepRegistryRgLocation }}' - bicepRegistryDoPublish: '${{ env.bicepRegistryDoPublish }}' - publishLatest: '${{ env.publishLatest }}' + uses: ./.github/workflows/template.module.yml + with: + workflowInput: '${{ needs.job_initialize_pipeline.outputs.workflowInput }}' + moduleTestFilePaths: '${{ needs.job_initialize_pipeline.outputs.moduleTestFilePaths }}' + modulePath: '${{ needs.job_initialize_pipeline.outputs.modulePath}}' + secrets: inherit diff --git a/.github/workflows/ms.network.natgateways.yml b/.github/workflows/ms.network.natgateways.yml index 440db032e6..874badddfe 100644 --- a/.github/workflows/ms.network.natgateways.yml +++ b/.github/workflows/ms.network.natgateways.yml @@ -1,4 +1,4 @@ -name: 'Network: NatGateways' +name: 'Network - NatGateways' on: workflow_dispatch: @@ -28,6 +28,7 @@ on: - main paths: - '.github/actions/templates/**' + - '.github/workflows/template.module.yml' - '.github/workflows/ms.network.natgateways.yml' - 'modules/Microsoft.Network/natGateways/**' - 'utilities/pipelines/**' @@ -35,14 +36,8 @@ on: - '!*/**/readme.md' env: - variablesPath: 'settings.yml' modulePath: 'modules/Microsoft.Network/natGateways' workflowPath: '.github/workflows/ms.network.natgateways.yml' - AZURE_CREDENTIALS: ${{ secrets.AZURE_CREDENTIALS }} - ARM_SUBSCRIPTION_ID: '${{ secrets.ARM_SUBSCRIPTION_ID }}' - ARM_MGMTGROUP_ID: '${{ secrets.ARM_MGMTGROUP_ID }}' - ARM_TENANT_ID: '${{ secrets.ARM_TENANT_ID }}' - TOKEN_NAMEPREFIX: '${{ secrets.TOKEN_NAMEPREFIX }}' concurrency: group: ${{ github.workflow }} @@ -72,94 +67,19 @@ jobs: outputs: workflowInput: ${{ steps.get-workflow-param.outputs.workflowInput }} moduleTestFilePaths: ${{ steps.get-module-test-file-paths.outputs.moduleTestFilePaths }} + modulePath: '${{ env.modulePath }}' - ######################### - # Static validation # - ######################### - job_module_static_validation: - runs-on: ubuntu-20.04 - name: 'Static validation' - if: (fromJson(needs.job_initialize_pipeline.outputs.workflowInput)).staticValidation == 'true' - needs: - - job_initialize_pipeline - steps: - - name: 'Checkout' - uses: actions/checkout@v3 - with: - fetch-depth: 0 - - name: Set environment variables - uses: ./.github/actions/templates/setEnvironmentVariables - with: - variablesPath: ${{ env.variablesPath }} - - name: 'Run tests' - uses: ./.github/actions/templates/validateModulePester - with: - modulePath: '${{ env.modulePath }}' - moduleTestFilePath: '${{ env.moduleTestFilePath }}' - ############################# - # Deployment validation # - ############################# - job_module_deploy_validation: - runs-on: ubuntu-20.04 - name: 'Deploying' - if: | - !cancelled() && - (fromJson(needs.job_initialize_pipeline.outputs.workflowInput)).deploymentValidation == 'true' && - needs.job_module_static_validation.result != 'failure' + ############################## + # Call reusable workflow # + ############################## + call-workflow-passing-data: + name: 'Module' needs: - job_initialize_pipeline - - job_module_static_validation - strategy: - fail-fast: false - matrix: - moduleTestFilePaths: ${{ fromJson(needs.job_initialize_pipeline.outputs.moduleTestFilePaths) }} - steps: - - name: 'Checkout' - uses: actions/checkout@v3 - with: - fetch-depth: 0 - - name: Set environment variables - uses: ./.github/actions/templates/setEnvironmentVariables - with: - variablesPath: ${{ env.variablesPath }} - - name: 'Using test file [${{ matrix.moduleTestFilePaths }}]' - uses: ./.github/actions/templates/validateModuleDeployment - with: - templateFilePath: '${{ env.modulePath }}/${{ matrix.moduleTestFilePaths }}' - location: '${{ env.location }}' - subscriptionId: '${{ secrets.ARM_SUBSCRIPTION_ID }}' - managementGroupId: '${{ secrets.ARM_MGMTGROUP_ID }}' - removeDeployment: '${{ (fromJson(needs.job_initialize_pipeline.outputs.workflowInput)).removeDeployment }}' - - ################## - # Publishing # - ################## - job_publish_module: - name: 'Publishing' - if: github.ref == 'refs/heads/main' || github.ref == 'refs/heads/master' || github.event.inputs.prerelease == 'true' - runs-on: ubuntu-20.04 - needs: - - job_module_deploy_validation - steps: - - name: 'Checkout' - uses: actions/checkout@v3 - with: - fetch-depth: 0 - - name: Set environment variables - uses: ./.github/actions/templates/setEnvironmentVariables - with: - variablesPath: ${{ env.variablesPath }} - - name: 'Publishing' - uses: ./.github/actions/templates/publishModule - with: - templateFilePath: '${{ env.modulePath }}/deploy.bicep' - templateSpecsRGName: '${{ env.templateSpecsRGName }}' - templateSpecsRGLocation: '${{ env.templateSpecsRGLocation }}' - templateSpecsDescription: '${{ env.templateSpecsDescription }}' - templateSpecsDoPublish: '${{ env.templateSpecsDoPublish }}' - bicepRegistryName: '${{ env.bicepRegistryName }}' - bicepRegistryRGName: '${{ env.bicepRegistryRGName }}' - bicepRegistryRgLocation: '${{ env.bicepRegistryRgLocation }}' - bicepRegistryDoPublish: '${{ env.bicepRegistryDoPublish }}' - publishLatest: '${{ env.publishLatest }}' + uses: ./.github/workflows/template.module.yml + with: + workflowInput: '${{ needs.job_initialize_pipeline.outputs.workflowInput }}' + moduleTestFilePaths: '${{ needs.job_initialize_pipeline.outputs.moduleTestFilePaths }}' + modulePath: '${{ needs.job_initialize_pipeline.outputs.modulePath}}' + secrets: inherit diff --git a/.github/workflows/ms.network.networkinterfaces.yml b/.github/workflows/ms.network.networkinterfaces.yml index 8db68cdf99..a643be72f4 100644 --- a/.github/workflows/ms.network.networkinterfaces.yml +++ b/.github/workflows/ms.network.networkinterfaces.yml @@ -1,4 +1,4 @@ -name: 'Network: NetworkInterfaces' +name: 'Network - NetworkInterfaces' on: workflow_dispatch: @@ -28,6 +28,7 @@ on: - main paths: - '.github/actions/templates/**' + - '.github/workflows/template.module.yml' - '.github/workflows/ms.network.networkinterfaces.yml' - 'modules/Microsoft.Network/networkInterfaces/**' - 'utilities/pipelines/**' @@ -35,14 +36,8 @@ on: - '!*/**/readme.md' env: - variablesPath: 'settings.yml' modulePath: 'modules/Microsoft.Network/networkInterfaces' workflowPath: '.github/workflows/ms.network.networkinterfaces.yml' - AZURE_CREDENTIALS: ${{ secrets.AZURE_CREDENTIALS }} - ARM_SUBSCRIPTION_ID: '${{ secrets.ARM_SUBSCRIPTION_ID }}' - ARM_MGMTGROUP_ID: '${{ secrets.ARM_MGMTGROUP_ID }}' - ARM_TENANT_ID: '${{ secrets.ARM_TENANT_ID }}' - TOKEN_NAMEPREFIX: '${{ secrets.TOKEN_NAMEPREFIX }}' concurrency: group: ${{ github.workflow }} @@ -72,94 +67,19 @@ jobs: outputs: workflowInput: ${{ steps.get-workflow-param.outputs.workflowInput }} moduleTestFilePaths: ${{ steps.get-module-test-file-paths.outputs.moduleTestFilePaths }} + modulePath: '${{ env.modulePath }}' - ######################### - # Static validation # - ######################### - job_module_static_validation: - runs-on: ubuntu-20.04 - name: 'Static validation' - if: (fromJson(needs.job_initialize_pipeline.outputs.workflowInput)).staticValidation == 'true' - needs: - - job_initialize_pipeline - steps: - - name: 'Checkout' - uses: actions/checkout@v3 - with: - fetch-depth: 0 - - name: Set environment variables - uses: ./.github/actions/templates/setEnvironmentVariables - with: - variablesPath: ${{ env.variablesPath }} - - name: 'Run tests' - uses: ./.github/actions/templates/validateModulePester - with: - modulePath: '${{ env.modulePath }}' - moduleTestFilePath: '${{ env.moduleTestFilePath }}' - ############################# - # Deployment validation # - ############################# - job_module_deploy_validation: - runs-on: ubuntu-20.04 - name: 'Deploying' - if: | - !cancelled() && - (fromJson(needs.job_initialize_pipeline.outputs.workflowInput)).deploymentValidation == 'true' && - needs.job_module_static_validation.result != 'failure' + ############################## + # Call reusable workflow # + ############################## + call-workflow-passing-data: + name: 'Module' needs: - job_initialize_pipeline - - job_module_static_validation - strategy: - fail-fast: false - matrix: - moduleTestFilePaths: ${{ fromJson(needs.job_initialize_pipeline.outputs.moduleTestFilePaths) }} - steps: - - name: 'Checkout' - uses: actions/checkout@v3 - with: - fetch-depth: 0 - - name: Set environment variables - uses: ./.github/actions/templates/setEnvironmentVariables - with: - variablesPath: ${{ env.variablesPath }} - - name: 'Using test file [${{ matrix.moduleTestFilePaths }}]' - uses: ./.github/actions/templates/validateModuleDeployment - with: - templateFilePath: '${{ env.modulePath }}/${{ matrix.moduleTestFilePaths }}' - location: '${{ env.location }}' - subscriptionId: '${{ secrets.ARM_SUBSCRIPTION_ID }}' - managementGroupId: '${{ secrets.ARM_MGMTGROUP_ID }}' - removeDeployment: '${{ (fromJson(needs.job_initialize_pipeline.outputs.workflowInput)).removeDeployment }}' - - ################## - # Publishing # - ################## - job_publish_module: - name: 'Publishing' - if: github.ref == 'refs/heads/main' || github.ref == 'refs/heads/master' || github.event.inputs.prerelease == 'true' - runs-on: ubuntu-20.04 - needs: - - job_module_deploy_validation - steps: - - name: 'Checkout' - uses: actions/checkout@v3 - with: - fetch-depth: 0 - - name: Set environment variables - uses: ./.github/actions/templates/setEnvironmentVariables - with: - variablesPath: ${{ env.variablesPath }} - - name: 'Publishing' - uses: ./.github/actions/templates/publishModule - with: - templateFilePath: '${{ env.modulePath }}/deploy.bicep' - templateSpecsRGName: '${{ env.templateSpecsRGName }}' - templateSpecsRGLocation: '${{ env.templateSpecsRGLocation }}' - templateSpecsDescription: '${{ env.templateSpecsDescription }}' - templateSpecsDoPublish: '${{ env.templateSpecsDoPublish }}' - bicepRegistryName: '${{ env.bicepRegistryName }}' - bicepRegistryRGName: '${{ env.bicepRegistryRGName }}' - bicepRegistryRgLocation: '${{ env.bicepRegistryRgLocation }}' - bicepRegistryDoPublish: '${{ env.bicepRegistryDoPublish }}' - publishLatest: '${{ env.publishLatest }}' + uses: ./.github/workflows/template.module.yml + with: + workflowInput: '${{ needs.job_initialize_pipeline.outputs.workflowInput }}' + moduleTestFilePaths: '${{ needs.job_initialize_pipeline.outputs.moduleTestFilePaths }}' + modulePath: '${{ needs.job_initialize_pipeline.outputs.modulePath}}' + secrets: inherit diff --git a/.github/workflows/ms.network.networkmanagers.yml b/.github/workflows/ms.network.networkmanagers.yml index ee8207cf96..81dd815491 100644 --- a/.github/workflows/ms.network.networkmanagers.yml +++ b/.github/workflows/ms.network.networkmanagers.yml @@ -1,4 +1,4 @@ -name: 'Network: Network Managers' +name: 'Network - Network Managers' on: workflow_dispatch: @@ -28,6 +28,7 @@ on: - main paths: - '.github/actions/templates/**' + - '.github/workflows/template.module.yml' - '.github/workflows/ms.network.networkmanagers.yml' - 'modules/Microsoft.Network/networkManagers/**' - 'utilities/pipelines/**' @@ -35,14 +36,8 @@ on: - '!*/**/readme.md' env: - variablesPath: 'settings.yml' modulePath: 'modules/Microsoft.Network/networkManagers' workflowPath: '.github/workflows/ms.network.networkmanagers.yml' - AZURE_CREDENTIALS: ${{ secrets.AZURE_CREDENTIALS }} - ARM_SUBSCRIPTION_ID: '${{ secrets.ARM_SUBSCRIPTION_ID }}' - ARM_MGMTGROUP_ID: '${{ secrets.ARM_MGMTGROUP_ID }}' - ARM_TENANT_ID: '${{ secrets.ARM_TENANT_ID }}' - TOKEN_NAMEPREFIX: '${{ secrets.TOKEN_NAMEPREFIX }}' concurrency: group: ${{ github.workflow }} @@ -72,94 +67,19 @@ jobs: outputs: workflowInput: ${{ steps.get-workflow-param.outputs.workflowInput }} moduleTestFilePaths: ${{ steps.get-module-test-file-paths.outputs.moduleTestFilePaths }} + modulePath: '${{ env.modulePath }}' - ######################### - # Static validation # - ######################### - job_module_static_validation: - runs-on: ubuntu-20.04 - name: 'Static validation' - if: (fromJson(needs.job_initialize_pipeline.outputs.workflowInput)).staticValidation == 'true' - needs: - - job_initialize_pipeline - steps: - - name: 'Checkout' - uses: actions/checkout@v3 - with: - fetch-depth: 0 - - name: Set environment variables - uses: ./.github/actions/templates/setEnvironmentVariables - with: - variablesPath: ${{ env.variablesPath }} - - name: 'Run tests' - uses: ./.github/actions/templates/validateModulePester - with: - modulePath: '${{ env.modulePath }}' - moduleTestFilePath: '${{ env.moduleTestFilePath }}' - ############################# - # Deployment validation # - ############################# - job_module_deploy_validation: - runs-on: ubuntu-20.04 - name: 'Deploying' - if: | - !cancelled() && - (fromJson(needs.job_initialize_pipeline.outputs.workflowInput)).deploymentValidation == 'true' && - needs.job_module_static_validation.result != 'failure' + ############################## + # Call reusable workflow # + ############################## + call-workflow-passing-data: + name: 'Module' needs: - job_initialize_pipeline - - job_module_static_validation - strategy: - fail-fast: false - matrix: - moduleTestFilePaths: ${{ fromJson(needs.job_initialize_pipeline.outputs.moduleTestFilePaths) }} - steps: - - name: 'Checkout' - uses: actions/checkout@v3 - with: - fetch-depth: 0 - - name: Set environment variables - uses: ./.github/actions/templates/setEnvironmentVariables - with: - variablesPath: ${{ env.variablesPath }} - - name: 'Using test file [${{ matrix.moduleTestFilePaths }}]' - uses: ./.github/actions/templates/validateModuleDeployment - with: - templateFilePath: '${{ env.modulePath }}/${{ matrix.moduleTestFilePaths }}' - location: '${{ env.location }}' - subscriptionId: '${{ secrets.ARM_SUBSCRIPTION_ID }}' - managementGroupId: '${{ secrets.ARM_MGMTGROUP_ID }}' - removeDeployment: '${{ (fromJson(needs.job_initialize_pipeline.outputs.workflowInput)).removeDeployment }}' - - ################## - # Publishing # - ################## - job_publish_module: - name: 'Publishing' - if: github.ref == 'refs/heads/main' || github.ref == 'refs/heads/master' || github.event.inputs.prerelease == 'true' - runs-on: ubuntu-20.04 - needs: - - job_module_deploy_validation - steps: - - name: 'Checkout' - uses: actions/checkout@v3 - with: - fetch-depth: 0 - - name: Set environment variables - uses: ./.github/actions/templates/setEnvironmentVariables - with: - variablesPath: ${{ env.variablesPath }} - - name: 'Publishing' - uses: ./.github/actions/templates/publishModule - with: - templateFilePath: '${{ env.modulePath }}/deploy.bicep' - templateSpecsRGName: '${{ env.templateSpecsRGName }}' - templateSpecsRGLocation: '${{ env.templateSpecsRGLocation }}' - templateSpecsDescription: '${{ env.templateSpecsDescription }}' - templateSpecsDoPublish: '${{ env.templateSpecsDoPublish }}' - bicepRegistryName: '${{ env.bicepRegistryName }}' - bicepRegistryRGName: '${{ env.bicepRegistryRGName }}' - bicepRegistryRgLocation: '${{ env.bicepRegistryRgLocation }}' - bicepRegistryDoPublish: '${{ env.bicepRegistryDoPublish }}' - publishLatest: '${{ env.publishLatest }}' + uses: ./.github/workflows/template.module.yml + with: + workflowInput: '${{ needs.job_initialize_pipeline.outputs.workflowInput }}' + moduleTestFilePaths: '${{ needs.job_initialize_pipeline.outputs.moduleTestFilePaths }}' + modulePath: '${{ needs.job_initialize_pipeline.outputs.modulePath}}' + secrets: inherit diff --git a/.github/workflows/ms.network.networksecuritygroups.yml b/.github/workflows/ms.network.networksecuritygroups.yml index 16b5a04382..baaa4c7ce5 100644 --- a/.github/workflows/ms.network.networksecuritygroups.yml +++ b/.github/workflows/ms.network.networksecuritygroups.yml @@ -1,4 +1,4 @@ -name: 'Network: NetworkSecurityGroups' +name: 'Network - NetworkSecurityGroups' on: workflow_dispatch: @@ -28,6 +28,7 @@ on: - main paths: - '.github/actions/templates/**' + - '.github/workflows/template.module.yml' - '.github/workflows/ms.network.networksecuritygroups.yml' - 'modules/Microsoft.Network/networkSecurityGroups/**' - 'utilities/pipelines/**' @@ -35,14 +36,8 @@ on: - '!*/**/readme.md' env: - variablesPath: 'settings.yml' modulePath: 'modules/Microsoft.Network/networkSecurityGroups' workflowPath: '.github/workflows/ms.network.networksecuritygroups.yml' - AZURE_CREDENTIALS: ${{ secrets.AZURE_CREDENTIALS }} - ARM_SUBSCRIPTION_ID: '${{ secrets.ARM_SUBSCRIPTION_ID }}' - ARM_MGMTGROUP_ID: '${{ secrets.ARM_MGMTGROUP_ID }}' - ARM_TENANT_ID: '${{ secrets.ARM_TENANT_ID }}' - TOKEN_NAMEPREFIX: '${{ secrets.TOKEN_NAMEPREFIX }}' concurrency: group: ${{ github.workflow }} @@ -72,94 +67,19 @@ jobs: outputs: workflowInput: ${{ steps.get-workflow-param.outputs.workflowInput }} moduleTestFilePaths: ${{ steps.get-module-test-file-paths.outputs.moduleTestFilePaths }} + modulePath: '${{ env.modulePath }}' - ######################### - # Static validation # - ######################### - job_module_static_validation: - runs-on: ubuntu-20.04 - name: 'Static validation' - if: (fromJson(needs.job_initialize_pipeline.outputs.workflowInput)).staticValidation == 'true' - needs: - - job_initialize_pipeline - steps: - - name: 'Checkout' - uses: actions/checkout@v3 - with: - fetch-depth: 0 - - name: Set environment variables - uses: ./.github/actions/templates/setEnvironmentVariables - with: - variablesPath: ${{ env.variablesPath }} - - name: 'Run tests' - uses: ./.github/actions/templates/validateModulePester - with: - modulePath: '${{ env.modulePath }}' - moduleTestFilePath: '${{ env.moduleTestFilePath }}' - ############################# - # Deployment validation # - ############################# - job_module_deploy_validation: - runs-on: ubuntu-20.04 - name: 'Deploying' - if: | - !cancelled() && - (fromJson(needs.job_initialize_pipeline.outputs.workflowInput)).deploymentValidation == 'true' && - needs.job_module_static_validation.result != 'failure' + ############################## + # Call reusable workflow # + ############################## + call-workflow-passing-data: + name: 'Module' needs: - job_initialize_pipeline - - job_module_static_validation - strategy: - fail-fast: false - matrix: - moduleTestFilePaths: ${{ fromJson(needs.job_initialize_pipeline.outputs.moduleTestFilePaths) }} - steps: - - name: 'Checkout' - uses: actions/checkout@v3 - with: - fetch-depth: 0 - - name: Set environment variables - uses: ./.github/actions/templates/setEnvironmentVariables - with: - variablesPath: ${{ env.variablesPath }} - - name: 'Using test file [${{ matrix.moduleTestFilePaths }}]' - uses: ./.github/actions/templates/validateModuleDeployment - with: - templateFilePath: '${{ env.modulePath }}/${{ matrix.moduleTestFilePaths }}' - location: '${{ env.location }}' - subscriptionId: '${{ secrets.ARM_SUBSCRIPTION_ID }}' - managementGroupId: '${{ secrets.ARM_MGMTGROUP_ID }}' - removeDeployment: '${{ (fromJson(needs.job_initialize_pipeline.outputs.workflowInput)).removeDeployment }}' - - ################## - # Publishing # - ################## - job_publish_module: - name: 'Publishing' - if: github.ref == 'refs/heads/main' || github.ref == 'refs/heads/master' || github.event.inputs.prerelease == 'true' - runs-on: ubuntu-20.04 - needs: - - job_module_deploy_validation - steps: - - name: 'Checkout' - uses: actions/checkout@v3 - with: - fetch-depth: 0 - - name: Set environment variables - uses: ./.github/actions/templates/setEnvironmentVariables - with: - variablesPath: ${{ env.variablesPath }} - - name: 'Publishing' - uses: ./.github/actions/templates/publishModule - with: - templateFilePath: '${{ env.modulePath }}/deploy.bicep' - templateSpecsRGName: '${{ env.templateSpecsRGName }}' - templateSpecsRGLocation: '${{ env.templateSpecsRGLocation }}' - templateSpecsDescription: '${{ env.templateSpecsDescription }}' - templateSpecsDoPublish: '${{ env.templateSpecsDoPublish }}' - bicepRegistryName: '${{ env.bicepRegistryName }}' - bicepRegistryRGName: '${{ env.bicepRegistryRGName }}' - bicepRegistryRgLocation: '${{ env.bicepRegistryRgLocation }}' - bicepRegistryDoPublish: '${{ env.bicepRegistryDoPublish }}' - publishLatest: '${{ env.publishLatest }}' + uses: ./.github/workflows/template.module.yml + with: + workflowInput: '${{ needs.job_initialize_pipeline.outputs.workflowInput }}' + moduleTestFilePaths: '${{ needs.job_initialize_pipeline.outputs.moduleTestFilePaths }}' + modulePath: '${{ needs.job_initialize_pipeline.outputs.modulePath}}' + secrets: inherit diff --git a/.github/workflows/ms.network.networkwatchers.yml b/.github/workflows/ms.network.networkwatchers.yml index c28786b631..56de8611c8 100644 --- a/.github/workflows/ms.network.networkwatchers.yml +++ b/.github/workflows/ms.network.networkwatchers.yml @@ -1,4 +1,4 @@ -name: 'Network: NetworkWatchers' +name: 'Network - NetworkWatchers' on: workflow_dispatch: @@ -28,6 +28,7 @@ on: - main paths: - '.github/actions/templates/**' + - '.github/workflows/template.module.yml' - '.github/workflows/ms.network.networkwatchers.yml' - 'modules/Microsoft.Network/networkWatchers/**' - 'utilities/pipelines/**' @@ -35,14 +36,8 @@ on: - '!*/**/readme.md' env: - variablesPath: 'settings.yml' modulePath: 'modules/Microsoft.Network/networkWatchers' workflowPath: '.github/workflows/ms.network.networkwatchers.yml' - AZURE_CREDENTIALS: ${{ secrets.AZURE_CREDENTIALS }} - ARM_SUBSCRIPTION_ID: '${{ secrets.ARM_SUBSCRIPTION_ID }}' - ARM_MGMTGROUP_ID: '${{ secrets.ARM_MGMTGROUP_ID }}' - ARM_TENANT_ID: '${{ secrets.ARM_TENANT_ID }}' - TOKEN_NAMEPREFIX: '${{ secrets.TOKEN_NAMEPREFIX }}' concurrency: group: ${{ github.workflow }} @@ -72,94 +67,19 @@ jobs: outputs: workflowInput: ${{ steps.get-workflow-param.outputs.workflowInput }} moduleTestFilePaths: ${{ steps.get-module-test-file-paths.outputs.moduleTestFilePaths }} + modulePath: '${{ env.modulePath }}' - ######################### - # Static validation # - ######################### - job_module_static_validation: - runs-on: ubuntu-20.04 - name: 'Static validation' - if: (fromJson(needs.job_initialize_pipeline.outputs.workflowInput)).staticValidation == 'true' - needs: - - job_initialize_pipeline - steps: - - name: 'Checkout' - uses: actions/checkout@v3 - with: - fetch-depth: 0 - - name: Set environment variables - uses: ./.github/actions/templates/setEnvironmentVariables - with: - variablesPath: ${{ env.variablesPath }} - - name: 'Run tests' - uses: ./.github/actions/templates/validateModulePester - with: - modulePath: '${{ env.modulePath }}' - moduleTestFilePath: '${{ env.moduleTestFilePath }}' - ############################# - # Deployment validation # - ############################# - job_module_deploy_validation: - runs-on: ubuntu-20.04 - name: 'Deploying' - if: | - !cancelled() && - (fromJson(needs.job_initialize_pipeline.outputs.workflowInput)).deploymentValidation == 'true' && - needs.job_module_static_validation.result != 'failure' + ############################## + # Call reusable workflow # + ############################## + call-workflow-passing-data: + name: 'Module' needs: - job_initialize_pipeline - - job_module_static_validation - strategy: - fail-fast: false - matrix: - moduleTestFilePaths: ${{ fromJson(needs.job_initialize_pipeline.outputs.moduleTestFilePaths) }} - steps: - - name: 'Checkout' - uses: actions/checkout@v3 - with: - fetch-depth: 0 - - name: Set environment variables - uses: ./.github/actions/templates/setEnvironmentVariables - with: - variablesPath: ${{ env.variablesPath }} - - name: 'Using test file [${{ matrix.moduleTestFilePaths }}]' - uses: ./.github/actions/templates/validateModuleDeployment - with: - templateFilePath: '${{ env.modulePath }}/${{ matrix.moduleTestFilePaths }}' - location: '${{ env.location }}' - subscriptionId: '${{ secrets.ARM_SUBSCRIPTION_ID }}' - managementGroupId: '${{ secrets.ARM_MGMTGROUP_ID }}' - removeDeployment: '${{ (fromJson(needs.job_initialize_pipeline.outputs.workflowInput)).removeDeployment }}' - - ################## - # Publishing # - ################## - job_publish_module: - name: 'Publishing' - if: github.ref == 'refs/heads/main' || github.ref == 'refs/heads/master' || github.event.inputs.prerelease == 'true' - runs-on: ubuntu-20.04 - needs: - - job_module_deploy_validation - steps: - - name: 'Checkout' - uses: actions/checkout@v3 - with: - fetch-depth: 0 - - name: Set environment variables - uses: ./.github/actions/templates/setEnvironmentVariables - with: - variablesPath: ${{ env.variablesPath }} - - name: 'Publishing' - uses: ./.github/actions/templates/publishModule - with: - templateFilePath: '${{ env.modulePath }}/deploy.bicep' - templateSpecsRGName: '${{ env.templateSpecsRGName }}' - templateSpecsRGLocation: '${{ env.templateSpecsRGLocation }}' - templateSpecsDescription: '${{ env.templateSpecsDescription }}' - templateSpecsDoPublish: '${{ env.templateSpecsDoPublish }}' - bicepRegistryName: '${{ env.bicepRegistryName }}' - bicepRegistryRGName: '${{ env.bicepRegistryRGName }}' - bicepRegistryRgLocation: '${{ env.bicepRegistryRgLocation }}' - bicepRegistryDoPublish: '${{ env.bicepRegistryDoPublish }}' - publishLatest: '${{ env.publishLatest }}' + uses: ./.github/workflows/template.module.yml + with: + workflowInput: '${{ needs.job_initialize_pipeline.outputs.workflowInput }}' + moduleTestFilePaths: '${{ needs.job_initialize_pipeline.outputs.moduleTestFilePaths }}' + modulePath: '${{ needs.job_initialize_pipeline.outputs.modulePath}}' + secrets: inherit diff --git a/.github/workflows/ms.network.privatednszones.yml b/.github/workflows/ms.network.privatednszones.yml index a910f40019..9cacac7a81 100644 --- a/.github/workflows/ms.network.privatednszones.yml +++ b/.github/workflows/ms.network.privatednszones.yml @@ -1,4 +1,4 @@ -name: 'Network: PrivateDnsZones' +name: 'Network - PrivateDnsZones' on: workflow_dispatch: @@ -28,6 +28,7 @@ on: - main paths: - '.github/actions/templates/**' + - '.github/workflows/template.module.yml' - '.github/workflows/ms.network.privatednszones.yml' - 'modules/Microsoft.Network/privateDnsZones/**' - 'utilities/pipelines/**' @@ -35,14 +36,8 @@ on: - '!*/**/readme.md' env: - variablesPath: 'settings.yml' modulePath: 'modules/Microsoft.Network/privateDnsZones' workflowPath: '.github/workflows/ms.network.privatednszones.yml' - AZURE_CREDENTIALS: ${{ secrets.AZURE_CREDENTIALS }} - ARM_SUBSCRIPTION_ID: '${{ secrets.ARM_SUBSCRIPTION_ID }}' - ARM_MGMTGROUP_ID: '${{ secrets.ARM_MGMTGROUP_ID }}' - ARM_TENANT_ID: '${{ secrets.ARM_TENANT_ID }}' - TOKEN_NAMEPREFIX: '${{ secrets.TOKEN_NAMEPREFIX }}' concurrency: group: ${{ github.workflow }} @@ -72,94 +67,19 @@ jobs: outputs: workflowInput: ${{ steps.get-workflow-param.outputs.workflowInput }} moduleTestFilePaths: ${{ steps.get-module-test-file-paths.outputs.moduleTestFilePaths }} + modulePath: '${{ env.modulePath }}' - ######################### - # Static validation # - ######################### - job_module_static_validation: - runs-on: ubuntu-20.04 - name: 'Static validation' - if: (fromJson(needs.job_initialize_pipeline.outputs.workflowInput)).staticValidation == 'true' - needs: - - job_initialize_pipeline - steps: - - name: 'Checkout' - uses: actions/checkout@v3 - with: - fetch-depth: 0 - - name: Set environment variables - uses: ./.github/actions/templates/setEnvironmentVariables - with: - variablesPath: ${{ env.variablesPath }} - - name: 'Run tests' - uses: ./.github/actions/templates/validateModulePester - with: - modulePath: '${{ env.modulePath }}' - moduleTestFilePath: '${{ env.moduleTestFilePath }}' - ############################# - # Deployment validation # - ############################# - job_module_deploy_validation: - runs-on: ubuntu-20.04 - name: 'Deploying' - if: | - !cancelled() && - (fromJson(needs.job_initialize_pipeline.outputs.workflowInput)).deploymentValidation == 'true' && - needs.job_module_static_validation.result != 'failure' + ############################## + # Call reusable workflow # + ############################## + call-workflow-passing-data: + name: 'Module' needs: - job_initialize_pipeline - - job_module_static_validation - strategy: - fail-fast: false - matrix: - moduleTestFilePaths: ${{ fromJson(needs.job_initialize_pipeline.outputs.moduleTestFilePaths) }} - steps: - - name: 'Checkout' - uses: actions/checkout@v3 - with: - fetch-depth: 0 - - name: Set environment variables - uses: ./.github/actions/templates/setEnvironmentVariables - with: - variablesPath: ${{ env.variablesPath }} - - name: 'Using test file [${{ matrix.moduleTestFilePaths }}]' - uses: ./.github/actions/templates/validateModuleDeployment - with: - templateFilePath: '${{ env.modulePath }}/${{ matrix.moduleTestFilePaths }}' - location: '${{ env.location }}' - subscriptionId: '${{ secrets.ARM_SUBSCRIPTION_ID }}' - managementGroupId: '${{ secrets.ARM_MGMTGROUP_ID }}' - removeDeployment: '${{ (fromJson(needs.job_initialize_pipeline.outputs.workflowInput)).removeDeployment }}' - - ################## - # Publishing # - ################## - job_publish_module: - name: 'Publishing' - if: github.ref == 'refs/heads/main' || github.ref == 'refs/heads/master' || github.event.inputs.prerelease == 'true' - runs-on: ubuntu-20.04 - needs: - - job_module_deploy_validation - steps: - - name: 'Checkout' - uses: actions/checkout@v3 - with: - fetch-depth: 0 - - name: Set environment variables - uses: ./.github/actions/templates/setEnvironmentVariables - with: - variablesPath: ${{ env.variablesPath }} - - name: 'Publishing' - uses: ./.github/actions/templates/publishModule - with: - templateFilePath: '${{ env.modulePath }}/deploy.bicep' - templateSpecsRGName: '${{ env.templateSpecsRGName }}' - templateSpecsRGLocation: '${{ env.templateSpecsRGLocation }}' - templateSpecsDescription: '${{ env.templateSpecsDescription }}' - templateSpecsDoPublish: '${{ env.templateSpecsDoPublish }}' - bicepRegistryName: '${{ env.bicepRegistryName }}' - bicepRegistryRGName: '${{ env.bicepRegistryRGName }}' - bicepRegistryRgLocation: '${{ env.bicepRegistryRgLocation }}' - bicepRegistryDoPublish: '${{ env.bicepRegistryDoPublish }}' - publishLatest: '${{ env.publishLatest }}' + uses: ./.github/workflows/template.module.yml + with: + workflowInput: '${{ needs.job_initialize_pipeline.outputs.workflowInput }}' + moduleTestFilePaths: '${{ needs.job_initialize_pipeline.outputs.moduleTestFilePaths }}' + modulePath: '${{ needs.job_initialize_pipeline.outputs.modulePath}}' + secrets: inherit diff --git a/.github/workflows/ms.network.privateendpoints.yml b/.github/workflows/ms.network.privateendpoints.yml index e2d577b34c..d293fc8e89 100644 --- a/.github/workflows/ms.network.privateendpoints.yml +++ b/.github/workflows/ms.network.privateendpoints.yml @@ -1,4 +1,4 @@ -name: 'Network: PrivateEndpoints' +name: 'Network - PrivateEndpoints' on: workflow_dispatch: @@ -28,6 +28,7 @@ on: - main paths: - '.github/actions/templates/**' + - '.github/workflows/template.module.yml' - '.github/workflows/ms.network.privateendpoints.yml' - 'modules/Microsoft.Network/privateEndpoints/**' - 'utilities/pipelines/**' @@ -35,14 +36,8 @@ on: - '!*/**/readme.md' env: - variablesPath: 'settings.yml' modulePath: 'modules/Microsoft.Network/privateEndpoints' workflowPath: '.github/workflows/ms.network.privateendpoints.yml' - AZURE_CREDENTIALS: ${{ secrets.AZURE_CREDENTIALS }} - ARM_SUBSCRIPTION_ID: '${{ secrets.ARM_SUBSCRIPTION_ID }}' - ARM_MGMTGROUP_ID: '${{ secrets.ARM_MGMTGROUP_ID }}' - ARM_TENANT_ID: '${{ secrets.ARM_TENANT_ID }}' - TOKEN_NAMEPREFIX: '${{ secrets.TOKEN_NAMEPREFIX }}' concurrency: group: ${{ github.workflow }} @@ -72,94 +67,19 @@ jobs: outputs: workflowInput: ${{ steps.get-workflow-param.outputs.workflowInput }} moduleTestFilePaths: ${{ steps.get-module-test-file-paths.outputs.moduleTestFilePaths }} + modulePath: '${{ env.modulePath }}' - ######################### - # Static validation # - ######################### - job_module_static_validation: - runs-on: ubuntu-20.04 - name: 'Static validation' - if: (fromJson(needs.job_initialize_pipeline.outputs.workflowInput)).staticValidation == 'true' - needs: - - job_initialize_pipeline - steps: - - name: 'Checkout' - uses: actions/checkout@v3 - with: - fetch-depth: 0 - - name: Set environment variables - uses: ./.github/actions/templates/setEnvironmentVariables - with: - variablesPath: ${{ env.variablesPath }} - - name: 'Run tests' - uses: ./.github/actions/templates/validateModulePester - with: - modulePath: '${{ env.modulePath }}' - moduleTestFilePath: '${{ env.moduleTestFilePath }}' - ############################# - # Deployment validation # - ############################# - job_module_deploy_validation: - runs-on: ubuntu-20.04 - name: 'Deploying' - if: | - !cancelled() && - (fromJson(needs.job_initialize_pipeline.outputs.workflowInput)).deploymentValidation == 'true' && - needs.job_module_static_validation.result != 'failure' + ############################## + # Call reusable workflow # + ############################## + call-workflow-passing-data: + name: 'Module' needs: - job_initialize_pipeline - - job_module_static_validation - strategy: - fail-fast: false - matrix: - moduleTestFilePaths: ${{ fromJson(needs.job_initialize_pipeline.outputs.moduleTestFilePaths) }} - steps: - - name: 'Checkout' - uses: actions/checkout@v3 - with: - fetch-depth: 0 - - name: Set environment variables - uses: ./.github/actions/templates/setEnvironmentVariables - with: - variablesPath: ${{ env.variablesPath }} - - name: 'Using test file [${{ matrix.moduleTestFilePaths }}]' - uses: ./.github/actions/templates/validateModuleDeployment - with: - templateFilePath: '${{ env.modulePath }}/${{ matrix.moduleTestFilePaths }}' - location: '${{ env.location }}' - subscriptionId: '${{ secrets.ARM_SUBSCRIPTION_ID }}' - managementGroupId: '${{ secrets.ARM_MGMTGROUP_ID }}' - removeDeployment: '${{ (fromJson(needs.job_initialize_pipeline.outputs.workflowInput)).removeDeployment }}' - - ################## - # Publishing # - ################## - job_publish_module: - name: 'Publishing' - if: github.ref == 'refs/heads/main' || github.ref == 'refs/heads/master' || github.event.inputs.prerelease == 'true' - runs-on: ubuntu-20.04 - needs: - - job_module_deploy_validation - steps: - - name: 'Checkout' - uses: actions/checkout@v3 - with: - fetch-depth: 0 - - name: Set environment variables - uses: ./.github/actions/templates/setEnvironmentVariables - with: - variablesPath: ${{ env.variablesPath }} - - name: 'Publishing' - uses: ./.github/actions/templates/publishModule - with: - templateFilePath: '${{ env.modulePath }}/deploy.bicep' - templateSpecsRGName: '${{ env.templateSpecsRGName }}' - templateSpecsRGLocation: '${{ env.templateSpecsRGLocation }}' - templateSpecsDescription: '${{ env.templateSpecsDescription }}' - templateSpecsDoPublish: '${{ env.templateSpecsDoPublish }}' - bicepRegistryName: '${{ env.bicepRegistryName }}' - bicepRegistryRGName: '${{ env.bicepRegistryRGName }}' - bicepRegistryRgLocation: '${{ env.bicepRegistryRgLocation }}' - bicepRegistryDoPublish: '${{ env.bicepRegistryDoPublish }}' - publishLatest: '${{ env.publishLatest }}' + uses: ./.github/workflows/template.module.yml + with: + workflowInput: '${{ needs.job_initialize_pipeline.outputs.workflowInput }}' + moduleTestFilePaths: '${{ needs.job_initialize_pipeline.outputs.moduleTestFilePaths }}' + modulePath: '${{ needs.job_initialize_pipeline.outputs.modulePath}}' + secrets: inherit diff --git a/.github/workflows/ms.network.privatelinkservices.yml b/.github/workflows/ms.network.privatelinkservices.yml index 5aed2eb527..d1c384652e 100644 --- a/.github/workflows/ms.network.privatelinkservices.yml +++ b/.github/workflows/ms.network.privatelinkservices.yml @@ -1,4 +1,4 @@ -name: 'Network: PrivateLinkServices' +name: 'Network - PrivateLinkServices' on: workflow_dispatch: @@ -28,6 +28,7 @@ on: - main paths: - '.github/actions/templates/**' + - '.github/workflows/template.module.yml' - '.github/workflows/ms.network.privatelinkservices.yml' - 'modules/Microsoft.Network/privateLinkServices/**' - 'utilities/pipelines/**' @@ -35,14 +36,8 @@ on: - '!*/**/readme.md' env: - variablesPath: 'settings.yml' modulePath: 'modules/Microsoft.Network/privateLinkServices' workflowPath: '.github/workflows/ms.network.privatelinkservices.yml' - AZURE_CREDENTIALS: ${{ secrets.AZURE_CREDENTIALS }} - ARM_SUBSCRIPTION_ID: '${{ secrets.ARM_SUBSCRIPTION_ID }}' - ARM_MGMTGROUP_ID: '${{ secrets.ARM_MGMTGROUP_ID }}' - ARM_TENANT_ID: '${{ secrets.ARM_TENANT_ID }}' - TOKEN_NAMEPREFIX: '${{ secrets.TOKEN_NAMEPREFIX }}' concurrency: group: ${{ github.workflow }} @@ -72,94 +67,19 @@ jobs: outputs: workflowInput: ${{ steps.get-workflow-param.outputs.workflowInput }} moduleTestFilePaths: ${{ steps.get-module-test-file-paths.outputs.moduleTestFilePaths }} + modulePath: '${{ env.modulePath }}' - ######################### - # Static validation # - ######################### - job_module_static_validation: - runs-on: ubuntu-20.04 - name: 'Static validation' - if: (fromJson(needs.job_initialize_pipeline.outputs.workflowInput)).staticValidation == 'true' - needs: - - job_initialize_pipeline - steps: - - name: 'Checkout' - uses: actions/checkout@v3 - with: - fetch-depth: 0 - - name: Set environment variables - uses: ./.github/actions/templates/setEnvironmentVariables - with: - variablesPath: ${{ env.variablesPath }} - - name: 'Run tests' - uses: ./.github/actions/templates/validateModulePester - with: - modulePath: '${{ env.modulePath }}' - moduleTestFilePath: '${{ env.moduleTestFilePath }}' - ############################# - # Deployment validation # - ############################# - job_module_deploy_validation: - runs-on: ubuntu-20.04 - name: 'Deploying' - if: | - !cancelled() && - (fromJson(needs.job_initialize_pipeline.outputs.workflowInput)).deploymentValidation == 'true' && - needs.job_module_static_validation.result != 'failure' + ############################## + # Call reusable workflow # + ############################## + call-workflow-passing-data: + name: 'Module' needs: - job_initialize_pipeline - - job_module_static_validation - strategy: - fail-fast: false - matrix: - moduleTestFilePaths: ${{ fromJson(needs.job_initialize_pipeline.outputs.moduleTestFilePaths) }} - steps: - - name: 'Checkout' - uses: actions/checkout@v3 - with: - fetch-depth: 0 - - name: Set environment variables - uses: ./.github/actions/templates/setEnvironmentVariables - with: - variablesPath: ${{ env.variablesPath }} - - name: 'Using parameter file [${{ matrix.moduleTestFilePaths }}]' - uses: ./.github/actions/templates/validateModuleDeployment - with: - templateFilePath: '${{ env.modulePath }}/${{ matrix.moduleTestFilePaths }}' - location: '${{ env.location }}' - subscriptionId: '${{ secrets.ARM_SUBSCRIPTION_ID }}' - managementGroupId: '${{ secrets.ARM_MGMTGROUP_ID }}' - removeDeployment: '${{ (fromJson(needs.job_initialize_pipeline.outputs.workflowInput)).removeDeployment }}' - - ################## - # Publishing # - ################## - job_publish_module: - name: 'Publishing' - if: github.ref == 'refs/heads/main' || github.ref == 'refs/heads/master' || github.event.inputs.prerelease == 'true' - runs-on: ubuntu-20.04 - needs: - - job_module_deploy_validation - steps: - - name: 'Checkout' - uses: actions/checkout@v3 - with: - fetch-depth: 0 - - name: Set environment variables - uses: ./.github/actions/templates/setEnvironmentVariables - with: - variablesPath: ${{ env.variablesPath }} - - name: 'Publishing' - uses: ./.github/actions/templates/publishModule - with: - templateFilePath: '${{ env.modulePath }}/deploy.bicep' - templateSpecsRGName: '${{ env.templateSpecsRGName }}' - templateSpecsRGLocation: '${{ env.templateSpecsRGLocation }}' - templateSpecsDescription: '${{ env.templateSpecsDescription }}' - templateSpecsDoPublish: '${{ env.templateSpecsDoPublish }}' - bicepRegistryName: '${{ env.bicepRegistryName }}' - bicepRegistryRGName: '${{ env.bicepRegistryRGName }}' - bicepRegistryRgLocation: '${{ env.bicepRegistryRgLocation }}' - bicepRegistryDoPublish: '${{ env.bicepRegistryDoPublish }}' - publishLatest: '${{ env.publishLatest }}' + uses: ./.github/workflows/template.module.yml + with: + workflowInput: '${{ needs.job_initialize_pipeline.outputs.workflowInput }}' + moduleTestFilePaths: '${{ needs.job_initialize_pipeline.outputs.moduleTestFilePaths }}' + modulePath: '${{ needs.job_initialize_pipeline.outputs.modulePath}}' + secrets: inherit diff --git a/.github/workflows/ms.network.publicipaddresses.yml b/.github/workflows/ms.network.publicipaddresses.yml index 064ca6175c..8a57a89963 100644 --- a/.github/workflows/ms.network.publicipaddresses.yml +++ b/.github/workflows/ms.network.publicipaddresses.yml @@ -1,4 +1,4 @@ -name: 'Network: PublicIpAddresses' +name: 'Network - PublicIpAddresses' on: workflow_dispatch: @@ -28,6 +28,7 @@ on: - main paths: - '.github/actions/templates/**' + - '.github/workflows/template.module.yml' - '.github/workflows/ms.network.publicipaddresses.yml' - 'modules/Microsoft.Network/publicIPAddresses/**' - 'utilities/pipelines/**' @@ -35,14 +36,8 @@ on: - '!*/**/readme.md' env: - variablesPath: 'settings.yml' modulePath: 'modules/Microsoft.Network/publicIPAddresses' workflowPath: '.github/workflows/ms.network.publicipaddresses.yml' - AZURE_CREDENTIALS: ${{ secrets.AZURE_CREDENTIALS }} - ARM_SUBSCRIPTION_ID: '${{ secrets.ARM_SUBSCRIPTION_ID }}' - ARM_MGMTGROUP_ID: '${{ secrets.ARM_MGMTGROUP_ID }}' - ARM_TENANT_ID: '${{ secrets.ARM_TENANT_ID }}' - TOKEN_NAMEPREFIX: '${{ secrets.TOKEN_NAMEPREFIX }}' concurrency: group: ${{ github.workflow }} @@ -72,94 +67,19 @@ jobs: outputs: workflowInput: ${{ steps.get-workflow-param.outputs.workflowInput }} moduleTestFilePaths: ${{ steps.get-module-test-file-paths.outputs.moduleTestFilePaths }} + modulePath: '${{ env.modulePath }}' - ######################### - # Static validation # - ######################### - job_module_static_validation: - runs-on: ubuntu-20.04 - name: 'Static validation' - if: (fromJson(needs.job_initialize_pipeline.outputs.workflowInput)).staticValidation == 'true' - needs: - - job_initialize_pipeline - steps: - - name: 'Checkout' - uses: actions/checkout@v3 - with: - fetch-depth: 0 - - name: Set environment variables - uses: ./.github/actions/templates/setEnvironmentVariables - with: - variablesPath: ${{ env.variablesPath }} - - name: 'Run tests' - uses: ./.github/actions/templates/validateModulePester - with: - modulePath: '${{ env.modulePath }}' - moduleTestFilePath: '${{ env.moduleTestFilePath }}' - ############################# - # Deployment validation # - ############################# - job_module_deploy_validation: - runs-on: ubuntu-20.04 - name: 'Deploying' - if: | - !cancelled() && - (fromJson(needs.job_initialize_pipeline.outputs.workflowInput)).deploymentValidation == 'true' && - needs.job_module_static_validation.result != 'failure' + ############################## + # Call reusable workflow # + ############################## + call-workflow-passing-data: + name: 'Module' needs: - job_initialize_pipeline - - job_module_static_validation - strategy: - fail-fast: false - matrix: - moduleTestFilePaths: ${{ fromJson(needs.job_initialize_pipeline.outputs.moduleTestFilePaths) }} - steps: - - name: 'Checkout' - uses: actions/checkout@v3 - with: - fetch-depth: 0 - - name: Set environment variables - uses: ./.github/actions/templates/setEnvironmentVariables - with: - variablesPath: ${{ env.variablesPath }} - - name: 'Using test file [${{ matrix.moduleTestFilePaths }}]' - uses: ./.github/actions/templates/validateModuleDeployment - with: - templateFilePath: '${{ env.modulePath }}/${{ matrix.moduleTestFilePaths }}' - location: '${{ env.location }}' - subscriptionId: '${{ secrets.ARM_SUBSCRIPTION_ID }}' - managementGroupId: '${{ secrets.ARM_MGMTGROUP_ID }}' - removeDeployment: '${{ (fromJson(needs.job_initialize_pipeline.outputs.workflowInput)).removeDeployment }}' - - ################## - # Publishing # - ################## - job_publish_module: - name: 'Publishing' - if: github.ref == 'refs/heads/main' || github.ref == 'refs/heads/master' || github.event.inputs.prerelease == 'true' - runs-on: ubuntu-20.04 - needs: - - job_module_deploy_validation - steps: - - name: 'Checkout' - uses: actions/checkout@v3 - with: - fetch-depth: 0 - - name: Set environment variables - uses: ./.github/actions/templates/setEnvironmentVariables - with: - variablesPath: ${{ env.variablesPath }} - - name: 'Publishing' - uses: ./.github/actions/templates/publishModule - with: - templateFilePath: '${{ env.modulePath }}/deploy.bicep' - templateSpecsRGName: '${{ env.templateSpecsRGName }}' - templateSpecsRGLocation: '${{ env.templateSpecsRGLocation }}' - templateSpecsDescription: '${{ env.templateSpecsDescription }}' - templateSpecsDoPublish: '${{ env.templateSpecsDoPublish }}' - bicepRegistryName: '${{ env.bicepRegistryName }}' - bicepRegistryRGName: '${{ env.bicepRegistryRGName }}' - bicepRegistryRgLocation: '${{ env.bicepRegistryRgLocation }}' - bicepRegistryDoPublish: '${{ env.bicepRegistryDoPublish }}' - publishLatest: '${{ env.publishLatest }}' + uses: ./.github/workflows/template.module.yml + with: + workflowInput: '${{ needs.job_initialize_pipeline.outputs.workflowInput }}' + moduleTestFilePaths: '${{ needs.job_initialize_pipeline.outputs.moduleTestFilePaths }}' + modulePath: '${{ needs.job_initialize_pipeline.outputs.modulePath}}' + secrets: inherit diff --git a/.github/workflows/ms.network.publicipprefixes.yml b/.github/workflows/ms.network.publicipprefixes.yml index 3e048fd4e9..95884b3d56 100644 --- a/.github/workflows/ms.network.publicipprefixes.yml +++ b/.github/workflows/ms.network.publicipprefixes.yml @@ -1,4 +1,4 @@ -name: 'Network: PublicIpPrefixes' +name: 'Network - PublicIpPrefixes' on: workflow_dispatch: @@ -28,6 +28,7 @@ on: - main paths: - '.github/actions/templates/**' + - '.github/workflows/template.module.yml' - '.github/workflows/ms.network.publicipprefixes.yml' - 'modules/Microsoft.Network/publicIPPrefixes/**' - 'utilities/pipelines/**' @@ -35,14 +36,8 @@ on: - '!*/**/readme.md' env: - variablesPath: 'settings.yml' modulePath: 'modules/Microsoft.Network/publicIPPrefixes' workflowPath: '.github/workflows/ms.network.publicipprefixes.yml' - AZURE_CREDENTIALS: ${{ secrets.AZURE_CREDENTIALS }} - ARM_SUBSCRIPTION_ID: '${{ secrets.ARM_SUBSCRIPTION_ID }}' - ARM_MGMTGROUP_ID: '${{ secrets.ARM_MGMTGROUP_ID }}' - ARM_TENANT_ID: '${{ secrets.ARM_TENANT_ID }}' - TOKEN_NAMEPREFIX: '${{ secrets.TOKEN_NAMEPREFIX }}' concurrency: group: ${{ github.workflow }} @@ -72,94 +67,19 @@ jobs: outputs: workflowInput: ${{ steps.get-workflow-param.outputs.workflowInput }} moduleTestFilePaths: ${{ steps.get-module-test-file-paths.outputs.moduleTestFilePaths }} + modulePath: '${{ env.modulePath }}' - ######################### - # Static validation # - ######################### - job_module_static_validation: - runs-on: ubuntu-20.04 - name: 'Static validation' - if: (fromJson(needs.job_initialize_pipeline.outputs.workflowInput)).staticValidation == 'true' - needs: - - job_initialize_pipeline - steps: - - name: 'Checkout' - uses: actions/checkout@v3 - with: - fetch-depth: 0 - - name: Set environment variables - uses: ./.github/actions/templates/setEnvironmentVariables - with: - variablesPath: ${{ env.variablesPath }} - - name: 'Run tests' - uses: ./.github/actions/templates/validateModulePester - with: - modulePath: '${{ env.modulePath }}' - moduleTestFilePath: '${{ env.moduleTestFilePath }}' - ############################# - # Deployment validation # - ############################# - job_module_deploy_validation: - runs-on: ubuntu-20.04 - name: 'Deploying' - if: | - !cancelled() && - (fromJson(needs.job_initialize_pipeline.outputs.workflowInput)).deploymentValidation == 'true' && - needs.job_module_static_validation.result != 'failure' + ############################## + # Call reusable workflow # + ############################## + call-workflow-passing-data: + name: 'Module' needs: - job_initialize_pipeline - - job_module_static_validation - strategy: - fail-fast: false - matrix: - moduleTestFilePaths: ${{ fromJson(needs.job_initialize_pipeline.outputs.moduleTestFilePaths) }} - steps: - - name: 'Checkout' - uses: actions/checkout@v3 - with: - fetch-depth: 0 - - name: Set environment variables - uses: ./.github/actions/templates/setEnvironmentVariables - with: - variablesPath: ${{ env.variablesPath }} - - name: 'Using test file [${{ matrix.moduleTestFilePaths }}]' - uses: ./.github/actions/templates/validateModuleDeployment - with: - templateFilePath: '${{ env.modulePath }}/${{ matrix.moduleTestFilePaths }}' - location: '${{ env.location }}' - subscriptionId: '${{ secrets.ARM_SUBSCRIPTION_ID }}' - managementGroupId: '${{ secrets.ARM_MGMTGROUP_ID }}' - removeDeployment: '${{ (fromJson(needs.job_initialize_pipeline.outputs.workflowInput)).removeDeployment }}' - - ################## - # Publishing # - ################## - job_publish_module: - name: 'Publishing' - if: github.ref == 'refs/heads/main' || github.ref == 'refs/heads/master' || github.event.inputs.prerelease == 'true' - runs-on: ubuntu-20.04 - needs: - - job_module_deploy_validation - steps: - - name: 'Checkout' - uses: actions/checkout@v3 - with: - fetch-depth: 0 - - name: Set environment variables - uses: ./.github/actions/templates/setEnvironmentVariables - with: - variablesPath: ${{ env.variablesPath }} - - name: 'Publishing' - uses: ./.github/actions/templates/publishModule - with: - templateFilePath: '${{ env.modulePath }}/deploy.bicep' - templateSpecsRGName: '${{ env.templateSpecsRGName }}' - templateSpecsRGLocation: '${{ env.templateSpecsRGLocation }}' - templateSpecsDescription: '${{ env.templateSpecsDescription }}' - templateSpecsDoPublish: '${{ env.templateSpecsDoPublish }}' - bicepRegistryName: '${{ env.bicepRegistryName }}' - bicepRegistryRGName: '${{ env.bicepRegistryRGName }}' - bicepRegistryRgLocation: '${{ env.bicepRegistryRgLocation }}' - bicepRegistryDoPublish: '${{ env.bicepRegistryDoPublish }}' - publishLatest: '${{ env.publishLatest }}' + uses: ./.github/workflows/template.module.yml + with: + workflowInput: '${{ needs.job_initialize_pipeline.outputs.workflowInput }}' + moduleTestFilePaths: '${{ needs.job_initialize_pipeline.outputs.moduleTestFilePaths }}' + modulePath: '${{ needs.job_initialize_pipeline.outputs.modulePath}}' + secrets: inherit diff --git a/.github/workflows/ms.network.routetables.yml b/.github/workflows/ms.network.routetables.yml index 6d3d42f00e..15323aabf0 100644 --- a/.github/workflows/ms.network.routetables.yml +++ b/.github/workflows/ms.network.routetables.yml @@ -1,4 +1,4 @@ -name: 'Network: RouteTables' +name: 'Network - RouteTables' on: workflow_dispatch: @@ -28,6 +28,7 @@ on: - main paths: - '.github/actions/templates/**' + - '.github/workflows/template.module.yml' - '.github/workflows/ms.network.routetables.yml' - 'modules/Microsoft.Network/routeTables/**' - 'utilities/pipelines/**' @@ -35,14 +36,8 @@ on: - '!*/**/readme.md' env: - variablesPath: 'settings.yml' modulePath: 'modules/Microsoft.Network/routeTables' workflowPath: '.github/workflows/ms.network.routetables.yml' - AZURE_CREDENTIALS: ${{ secrets.AZURE_CREDENTIALS }} - ARM_SUBSCRIPTION_ID: '${{ secrets.ARM_SUBSCRIPTION_ID }}' - ARM_MGMTGROUP_ID: '${{ secrets.ARM_MGMTGROUP_ID }}' - ARM_TENANT_ID: '${{ secrets.ARM_TENANT_ID }}' - TOKEN_NAMEPREFIX: '${{ secrets.TOKEN_NAMEPREFIX }}' concurrency: group: ${{ github.workflow }} @@ -72,94 +67,19 @@ jobs: outputs: workflowInput: ${{ steps.get-workflow-param.outputs.workflowInput }} moduleTestFilePaths: ${{ steps.get-module-test-file-paths.outputs.moduleTestFilePaths }} + modulePath: '${{ env.modulePath }}' - ######################### - # Static validation # - ######################### - job_module_static_validation: - runs-on: ubuntu-20.04 - name: 'Static validation' - if: (fromJson(needs.job_initialize_pipeline.outputs.workflowInput)).staticValidation == 'true' - needs: - - job_initialize_pipeline - steps: - - name: 'Checkout' - uses: actions/checkout@v3 - with: - fetch-depth: 0 - - name: Set environment variables - uses: ./.github/actions/templates/setEnvironmentVariables - with: - variablesPath: ${{ env.variablesPath }} - - name: 'Run tests' - uses: ./.github/actions/templates/validateModulePester - with: - modulePath: '${{ env.modulePath }}' - moduleTestFilePath: '${{ env.moduleTestFilePath }}' - ############################# - # Deployment validation # - ############################# - job_module_deploy_validation: - runs-on: ubuntu-20.04 - name: 'Deploying' - if: | - !cancelled() && - (fromJson(needs.job_initialize_pipeline.outputs.workflowInput)).deploymentValidation == 'true' && - needs.job_module_static_validation.result != 'failure' + ############################## + # Call reusable workflow # + ############################## + call-workflow-passing-data: + name: 'Module' needs: - job_initialize_pipeline - - job_module_static_validation - strategy: - fail-fast: false - matrix: - moduleTestFilePaths: ${{ fromJson(needs.job_initialize_pipeline.outputs.moduleTestFilePaths) }} - steps: - - name: 'Checkout' - uses: actions/checkout@v3 - with: - fetch-depth: 0 - - name: Set environment variables - uses: ./.github/actions/templates/setEnvironmentVariables - with: - variablesPath: ${{ env.variablesPath }} - - name: 'Using test file [${{ matrix.moduleTestFilePaths }}]' - uses: ./.github/actions/templates/validateModuleDeployment - with: - templateFilePath: '${{ env.modulePath }}/${{ matrix.moduleTestFilePaths }}' - location: '${{ env.location }}' - subscriptionId: '${{ secrets.ARM_SUBSCRIPTION_ID }}' - managementGroupId: '${{ secrets.ARM_MGMTGROUP_ID }}' - removeDeployment: '${{ (fromJson(needs.job_initialize_pipeline.outputs.workflowInput)).removeDeployment }}' - - ################## - # Publishing # - ################## - job_publish_module: - name: 'Publishing' - if: github.ref == 'refs/heads/main' || github.ref == 'refs/heads/master' || github.event.inputs.prerelease == 'true' - runs-on: ubuntu-20.04 - needs: - - job_module_deploy_validation - steps: - - name: 'Checkout' - uses: actions/checkout@v3 - with: - fetch-depth: 0 - - name: Set environment variables - uses: ./.github/actions/templates/setEnvironmentVariables - with: - variablesPath: ${{ env.variablesPath }} - - name: 'Publishing' - uses: ./.github/actions/templates/publishModule - with: - templateFilePath: '${{ env.modulePath }}/deploy.bicep' - templateSpecsRGName: '${{ env.templateSpecsRGName }}' - templateSpecsRGLocation: '${{ env.templateSpecsRGLocation }}' - templateSpecsDescription: '${{ env.templateSpecsDescription }}' - templateSpecsDoPublish: '${{ env.templateSpecsDoPublish }}' - bicepRegistryName: '${{ env.bicepRegistryName }}' - bicepRegistryRGName: '${{ env.bicepRegistryRGName }}' - bicepRegistryRgLocation: '${{ env.bicepRegistryRgLocation }}' - bicepRegistryDoPublish: '${{ env.bicepRegistryDoPublish }}' - publishLatest: '${{ env.publishLatest }}' + uses: ./.github/workflows/template.module.yml + with: + workflowInput: '${{ needs.job_initialize_pipeline.outputs.workflowInput }}' + moduleTestFilePaths: '${{ needs.job_initialize_pipeline.outputs.moduleTestFilePaths }}' + modulePath: '${{ needs.job_initialize_pipeline.outputs.modulePath}}' + secrets: inherit diff --git a/.github/workflows/ms.network.trafficmanagerprofiles.yml b/.github/workflows/ms.network.trafficmanagerprofiles.yml index 3282deb15b..d72c17aefa 100644 --- a/.github/workflows/ms.network.trafficmanagerprofiles.yml +++ b/.github/workflows/ms.network.trafficmanagerprofiles.yml @@ -1,4 +1,4 @@ -name: 'Network: TrafficManagerProfiles' +name: 'Network - TrafficManagerProfiles' on: workflow_dispatch: @@ -28,6 +28,7 @@ on: - main paths: - '.github/actions/templates/**' + - '.github/workflows/template.module.yml' - '.github/workflows/ms.network.trafficmanagerprofiles.yml' - 'modules/Microsoft.Network/trafficmanagerprofiles/**' - 'utilities/pipelines/**' @@ -35,14 +36,8 @@ on: - '!*/**/readme.md' env: - variablesPath: 'settings.yml' modulePath: 'modules/Microsoft.Network/trafficmanagerprofiles' workflowPath: '.github/workflows/ms.network.trafficmanagerprofiles.yml' - AZURE_CREDENTIALS: ${{ secrets.AZURE_CREDENTIALS }} - ARM_SUBSCRIPTION_ID: '${{ secrets.ARM_SUBSCRIPTION_ID }}' - ARM_MGMTGROUP_ID: '${{ secrets.ARM_MGMTGROUP_ID }}' - ARM_TENANT_ID: '${{ secrets.ARM_TENANT_ID }}' - TOKEN_NAMEPREFIX: '${{ secrets.TOKEN_NAMEPREFIX }}' concurrency: group: ${{ github.workflow }} @@ -72,94 +67,19 @@ jobs: outputs: workflowInput: ${{ steps.get-workflow-param.outputs.workflowInput }} moduleTestFilePaths: ${{ steps.get-module-test-file-paths.outputs.moduleTestFilePaths }} + modulePath: '${{ env.modulePath }}' - ######################### - # Static validation # - ######################### - job_module_static_validation: - runs-on: ubuntu-20.04 - name: 'Static validation' - if: (fromJson(needs.job_initialize_pipeline.outputs.workflowInput)).staticValidation == 'true' - needs: - - job_initialize_pipeline - steps: - - name: 'Checkout' - uses: actions/checkout@v3 - with: - fetch-depth: 0 - - name: Set environment variables - uses: ./.github/actions/templates/setEnvironmentVariables - with: - variablesPath: ${{ env.variablesPath }} - - name: 'Run tests' - uses: ./.github/actions/templates/validateModulePester - with: - modulePath: '${{ env.modulePath }}' - moduleTestFilePath: '${{ env.moduleTestFilePath }}' - ############################# - # Deployment validation # - ############################# - job_module_deploy_validation: - runs-on: ubuntu-20.04 - name: 'Deploying' - if: | - !cancelled() && - (fromJson(needs.job_initialize_pipeline.outputs.workflowInput)).deploymentValidation == 'true' && - needs.job_module_static_validation.result != 'failure' + ############################## + # Call reusable workflow # + ############################## + call-workflow-passing-data: + name: 'Module' needs: - job_initialize_pipeline - - job_module_static_validation - strategy: - fail-fast: false - matrix: - moduleTestFilePaths: ${{ fromJson(needs.job_initialize_pipeline.outputs.moduleTestFilePaths) }} - steps: - - name: 'Checkout' - uses: actions/checkout@v3 - with: - fetch-depth: 0 - - name: Set environment variables - uses: ./.github/actions/templates/setEnvironmentVariables - with: - variablesPath: ${{ env.variablesPath }} - - name: 'Using test file [${{ matrix.moduleTestFilePaths }}]' - uses: ./.github/actions/templates/validateModuleDeployment - with: - templateFilePath: '${{ env.modulePath }}/${{ matrix.moduleTestFilePaths }}' - location: '${{ env.location }}' - subscriptionId: '${{ secrets.ARM_SUBSCRIPTION_ID }}' - managementGroupId: '${{ secrets.ARM_MGMTGROUP_ID }}' - removeDeployment: '${{ (fromJson(needs.job_initialize_pipeline.outputs.workflowInput)).removeDeployment }}' - - ################## - # Publishing # - ################## - job_publish_module: - name: 'Publishing' - if: github.ref == 'refs/heads/main' || github.ref == 'refs/heads/master' || github.event.inputs.prerelease == 'true' - runs-on: ubuntu-20.04 - needs: - - job_module_deploy_validation - steps: - - name: 'Checkout' - uses: actions/checkout@v3 - with: - fetch-depth: 0 - - name: Set environment variables - uses: ./.github/actions/templates/setEnvironmentVariables - with: - variablesPath: ${{ env.variablesPath }} - - name: 'Publishing' - uses: ./.github/actions/templates/publishModule - with: - templateFilePath: '${{ env.modulePath }}/deploy.bicep' - templateSpecsRGName: '${{ env.templateSpecsRGName }}' - templateSpecsRGLocation: '${{ env.templateSpecsRGLocation }}' - templateSpecsDescription: '${{ env.templateSpecsDescription }}' - templateSpecsDoPublish: '${{ env.templateSpecsDoPublish }}' - bicepRegistryName: '${{ env.bicepRegistryName }}' - bicepRegistryRGName: '${{ env.bicepRegistryRGName }}' - bicepRegistryRgLocation: '${{ env.bicepRegistryRgLocation }}' - bicepRegistryDoPublish: '${{ env.bicepRegistryDoPublish }}' - publishLatest: '${{ env.publishLatest }}' + uses: ./.github/workflows/template.module.yml + with: + workflowInput: '${{ needs.job_initialize_pipeline.outputs.workflowInput }}' + moduleTestFilePaths: '${{ needs.job_initialize_pipeline.outputs.moduleTestFilePaths }}' + modulePath: '${{ needs.job_initialize_pipeline.outputs.modulePath}}' + secrets: inherit diff --git a/.github/workflows/ms.network.virtualhubs.yml b/.github/workflows/ms.network.virtualhubs.yml index f4a4e11118..0ea973b080 100644 --- a/.github/workflows/ms.network.virtualhubs.yml +++ b/.github/workflows/ms.network.virtualhubs.yml @@ -1,4 +1,4 @@ -name: 'Network: VirtualHubs' +name: 'Network - VirtualHubs' on: workflow_dispatch: @@ -28,6 +28,7 @@ on: - main paths: - '.github/actions/templates/**' + - '.github/workflows/template.module.yml' - '.github/workflows/ms.network.virtualhubs.yml' - 'modules/Microsoft.Network/virtualHubs/**' - 'utilities/pipelines/**' @@ -35,14 +36,8 @@ on: - '!*/**/readme.md' env: - variablesPath: 'settings.yml' modulePath: 'modules/Microsoft.Network/virtualHubs' workflowPath: '.github/workflows/ms.network.virtualhubs.yml' - AZURE_CREDENTIALS: ${{ secrets.AZURE_CREDENTIALS }} - ARM_SUBSCRIPTION_ID: '${{ secrets.ARM_SUBSCRIPTION_ID }}' - ARM_MGMTGROUP_ID: '${{ secrets.ARM_MGMTGROUP_ID }}' - ARM_TENANT_ID: '${{ secrets.ARM_TENANT_ID }}' - TOKEN_NAMEPREFIX: '${{ secrets.TOKEN_NAMEPREFIX }}' concurrency: group: ${{ github.workflow }} @@ -72,94 +67,19 @@ jobs: outputs: workflowInput: ${{ steps.get-workflow-param.outputs.workflowInput }} moduleTestFilePaths: ${{ steps.get-module-test-file-paths.outputs.moduleTestFilePaths }} + modulePath: '${{ env.modulePath }}' - ######################### - # Static validation # - ######################### - job_module_static_validation: - runs-on: ubuntu-20.04 - name: 'Static validation' - if: (fromJson(needs.job_initialize_pipeline.outputs.workflowInput)).staticValidation == 'true' - needs: - - job_initialize_pipeline - steps: - - name: 'Checkout' - uses: actions/checkout@v3 - with: - fetch-depth: 0 - - name: Set environment variables - uses: ./.github/actions/templates/setEnvironmentVariables - with: - variablesPath: ${{ env.variablesPath }} - - name: 'Run tests' - uses: ./.github/actions/templates/validateModulePester - with: - modulePath: '${{ env.modulePath }}' - moduleTestFilePath: '${{ env.moduleTestFilePath }}' - ############################# - # Deployment validation # - ############################# - job_module_deploy_validation: - runs-on: ubuntu-20.04 - name: 'Deploying' - if: | - !cancelled() && - (fromJson(needs.job_initialize_pipeline.outputs.workflowInput)).deploymentValidation == 'true' && - needs.job_module_static_validation.result != 'failure' + ############################## + # Call reusable workflow # + ############################## + call-workflow-passing-data: + name: 'Module' needs: - job_initialize_pipeline - - job_module_static_validation - strategy: - fail-fast: false - matrix: - moduleTestFilePaths: ${{ fromJson(needs.job_initialize_pipeline.outputs.moduleTestFilePaths) }} - steps: - - name: 'Checkout' - uses: actions/checkout@v3 - with: - fetch-depth: 0 - - name: Set environment variables - uses: ./.github/actions/templates/setEnvironmentVariables - with: - variablesPath: ${{ env.variablesPath }} - - name: 'Using test file [${{ matrix.moduleTestFilePaths }}]' - uses: ./.github/actions/templates/validateModuleDeployment - with: - templateFilePath: '${{ env.modulePath }}/${{ matrix.moduleTestFilePaths }}' - location: '${{ env.location }}' - subscriptionId: '${{ secrets.ARM_SUBSCRIPTION_ID }}' - managementGroupId: '${{ secrets.ARM_MGMTGROUP_ID }}' - removeDeployment: '${{ (fromJson(needs.job_initialize_pipeline.outputs.workflowInput)).removeDeployment }}' - - ################## - # Publishing # - ################## - job_publish_module: - name: 'Publishing' - if: github.ref == 'refs/heads/main' || github.ref == 'refs/heads/master' || github.event.inputs.prerelease == 'true' - runs-on: ubuntu-20.04 - needs: - - job_module_deploy_validation - steps: - - name: 'Checkout' - uses: actions/checkout@v3 - with: - fetch-depth: 0 - - name: Set environment variables - uses: ./.github/actions/templates/setEnvironmentVariables - with: - variablesPath: ${{ env.variablesPath }} - - name: 'Publishing' - uses: ./.github/actions/templates/publishModule - with: - templateFilePath: '${{ env.modulePath }}/deploy.bicep' - templateSpecsRGName: '${{ env.templateSpecsRGName }}' - templateSpecsRGLocation: '${{ env.templateSpecsRGLocation }}' - templateSpecsDescription: '${{ env.templateSpecsDescription }}' - templateSpecsDoPublish: '${{ env.templateSpecsDoPublish }}' - bicepRegistryName: '${{ env.bicepRegistryName }}' - bicepRegistryRGName: '${{ env.bicepRegistryRGName }}' - bicepRegistryRgLocation: '${{ env.bicepRegistryRgLocation }}' - bicepRegistryDoPublish: '${{ env.bicepRegistryDoPublish }}' - publishLatest: '${{ env.publishLatest }}' + uses: ./.github/workflows/template.module.yml + with: + workflowInput: '${{ needs.job_initialize_pipeline.outputs.workflowInput }}' + moduleTestFilePaths: '${{ needs.job_initialize_pipeline.outputs.moduleTestFilePaths }}' + modulePath: '${{ needs.job_initialize_pipeline.outputs.modulePath}}' + secrets: inherit diff --git a/.github/workflows/ms.network.virtualnetworkgateways.yml b/.github/workflows/ms.network.virtualnetworkgateways.yml index 0646d78efb..5d423f8f80 100644 --- a/.github/workflows/ms.network.virtualnetworkgateways.yml +++ b/.github/workflows/ms.network.virtualnetworkgateways.yml @@ -1,4 +1,4 @@ -name: 'Network: VirtualNetworkGateways' +name: 'Network - VirtualNetworkGateways' on: workflow_dispatch: @@ -28,6 +28,7 @@ on: - main paths: - '.github/actions/templates/**' + - '.github/workflows/template.module.yml' - '.github/workflows/ms.network.virtualnetworkgateways.yml' - 'modules/Microsoft.Network/virtualNetworkGateways/**' - 'utilities/pipelines/**' @@ -35,14 +36,8 @@ on: - '!*/**/readme.md' env: - variablesPath: 'settings.yml' modulePath: 'modules/Microsoft.Network/virtualNetworkGateways' workflowPath: '.github/workflows/ms.network.virtualnetworkgateways.yml' - AZURE_CREDENTIALS: ${{ secrets.AZURE_CREDENTIALS }} - ARM_SUBSCRIPTION_ID: '${{ secrets.ARM_SUBSCRIPTION_ID }}' - ARM_MGMTGROUP_ID: '${{ secrets.ARM_MGMTGROUP_ID }}' - ARM_TENANT_ID: '${{ secrets.ARM_TENANT_ID }}' - TOKEN_NAMEPREFIX: '${{ secrets.TOKEN_NAMEPREFIX }}' concurrency: group: ${{ github.workflow }} @@ -72,94 +67,19 @@ jobs: outputs: workflowInput: ${{ steps.get-workflow-param.outputs.workflowInput }} moduleTestFilePaths: ${{ steps.get-module-test-file-paths.outputs.moduleTestFilePaths }} + modulePath: '${{ env.modulePath }}' - ######################### - # Static validation # - ######################### - job_module_static_validation: - runs-on: ubuntu-20.04 - name: 'Static validation' - if: (fromJson(needs.job_initialize_pipeline.outputs.workflowInput)).staticValidation == 'true' - needs: - - job_initialize_pipeline - steps: - - name: 'Checkout' - uses: actions/checkout@v3 - with: - fetch-depth: 0 - - name: Set environment variables - uses: ./.github/actions/templates/setEnvironmentVariables - with: - variablesPath: ${{ env.variablesPath }} - - name: 'Run tests' - uses: ./.github/actions/templates/validateModulePester - with: - modulePath: '${{ env.modulePath }}' - moduleTestFilePath: '${{ env.moduleTestFilePath }}' - ############################# - # Deployment validation # - ############################# - job_module_deploy_validation: - runs-on: ubuntu-20.04 - name: 'Deploying' - if: | - !cancelled() && - (fromJson(needs.job_initialize_pipeline.outputs.workflowInput)).deploymentValidation == 'true' && - needs.job_module_static_validation.result != 'failure' + ############################## + # Call reusable workflow # + ############################## + call-workflow-passing-data: + name: 'Module' needs: - job_initialize_pipeline - - job_module_static_validation - strategy: - fail-fast: false - matrix: - moduleTestFilePaths: ${{ fromJson(needs.job_initialize_pipeline.outputs.moduleTestFilePaths) }} - steps: - - name: 'Checkout' - uses: actions/checkout@v3 - with: - fetch-depth: 0 - - name: Set environment variables - uses: ./.github/actions/templates/setEnvironmentVariables - with: - variablesPath: ${{ env.variablesPath }} - - name: 'Using test file [${{ matrix.moduleTestFilePaths }}]' - uses: ./.github/actions/templates/validateModuleDeployment - with: - templateFilePath: '${{ env.modulePath }}/${{ matrix.moduleTestFilePaths }}' - location: '${{ env.location }}' - subscriptionId: '${{ secrets.ARM_SUBSCRIPTION_ID }}' - managementGroupId: '${{ secrets.ARM_MGMTGROUP_ID }}' - removeDeployment: '${{ (fromJson(needs.job_initialize_pipeline.outputs.workflowInput)).removeDeployment }}' - - ################## - # Publishing # - ################## - job_publish_module: - name: 'Publishing' - if: github.ref == 'refs/heads/main' || github.ref == 'refs/heads/master' || github.event.inputs.prerelease == 'true' - runs-on: ubuntu-20.04 - needs: - - job_module_deploy_validation - steps: - - name: 'Checkout' - uses: actions/checkout@v3 - with: - fetch-depth: 0 - - name: Set environment variables - uses: ./.github/actions/templates/setEnvironmentVariables - with: - variablesPath: ${{ env.variablesPath }} - - name: 'Publishing' - uses: ./.github/actions/templates/publishModule - with: - templateFilePath: '${{ env.modulePath }}/deploy.bicep' - templateSpecsRGName: '${{ env.templateSpecsRGName }}' - templateSpecsRGLocation: '${{ env.templateSpecsRGLocation }}' - templateSpecsDescription: '${{ env.templateSpecsDescription }}' - templateSpecsDoPublish: '${{ env.templateSpecsDoPublish }}' - bicepRegistryName: '${{ env.bicepRegistryName }}' - bicepRegistryRGName: '${{ env.bicepRegistryRGName }}' - bicepRegistryRgLocation: '${{ env.bicepRegistryRgLocation }}' - bicepRegistryDoPublish: '${{ env.bicepRegistryDoPublish }}' - publishLatest: '${{ env.publishLatest }}' + uses: ./.github/workflows/template.module.yml + with: + workflowInput: '${{ needs.job_initialize_pipeline.outputs.workflowInput }}' + moduleTestFilePaths: '${{ needs.job_initialize_pipeline.outputs.moduleTestFilePaths }}' + modulePath: '${{ needs.job_initialize_pipeline.outputs.modulePath}}' + secrets: inherit diff --git a/.github/workflows/ms.network.virtualnetworks.yml b/.github/workflows/ms.network.virtualnetworks.yml index 88151c30f8..36701407d7 100644 --- a/.github/workflows/ms.network.virtualnetworks.yml +++ b/.github/workflows/ms.network.virtualnetworks.yml @@ -1,4 +1,4 @@ -name: 'Network: VirtualNetworks' +name: 'Network - VirtualNetworks' on: workflow_dispatch: @@ -28,6 +28,8 @@ on: - main paths: - '.github/actions/templates/**' + - '.github/workflows/template.module.yml' + - '.github/workflows/template.module.yml' - '.github/workflows/ms.network.virtualnetworks.yml' - 'modules/Microsoft.Network/virtualNetworks/**' - 'utilities/pipelines/**' @@ -35,14 +37,8 @@ on: - '!*/**/readme.md' env: - variablesPath: 'settings.yml' modulePath: 'modules/Microsoft.Network/virtualNetworks' workflowPath: '.github/workflows/ms.network.virtualnetworks.yml' - AZURE_CREDENTIALS: ${{ secrets.AZURE_CREDENTIALS }} - ARM_SUBSCRIPTION_ID: '${{ secrets.ARM_SUBSCRIPTION_ID }}' - ARM_MGMTGROUP_ID: '${{ secrets.ARM_MGMTGROUP_ID }}' - ARM_TENANT_ID: '${{ secrets.ARM_TENANT_ID }}' - TOKEN_NAMEPREFIX: '${{ secrets.TOKEN_NAMEPREFIX }}' concurrency: group: ${{ github.workflow }} @@ -72,94 +68,19 @@ jobs: outputs: workflowInput: ${{ steps.get-workflow-param.outputs.workflowInput }} moduleTestFilePaths: ${{ steps.get-module-test-file-paths.outputs.moduleTestFilePaths }} + modulePath: '${{ env.modulePath }}' - ######################### - # Static validation # - ######################### - job_module_static_validation: - runs-on: ubuntu-20.04 - name: 'Static validation' - if: (fromJson(needs.job_initialize_pipeline.outputs.workflowInput)).staticValidation == 'true' - needs: - - job_initialize_pipeline - steps: - - name: 'Checkout' - uses: actions/checkout@v3 - with: - fetch-depth: 0 - - name: Set environment variables - uses: ./.github/actions/templates/setEnvironmentVariables - with: - variablesPath: ${{ env.variablesPath }} - - name: 'Run tests' - uses: ./.github/actions/templates/validateModulePester - with: - modulePath: '${{ env.modulePath }}' - moduleTestFilePath: '${{ env.moduleTestFilePath }}' - ############################# - # Deployment validation # - ############################# - job_module_deploy_validation: - runs-on: ubuntu-20.04 - name: 'Deploying' - if: | - !cancelled() && - (fromJson(needs.job_initialize_pipeline.outputs.workflowInput)).deploymentValidation == 'true' && - needs.job_module_static_validation.result != 'failure' + ############################## + # Call reusable workflow # + ############################## + call-workflow-passing-data: + name: 'Module' needs: - job_initialize_pipeline - - job_module_static_validation - strategy: - fail-fast: false - matrix: - moduleTestFilePaths: ${{ fromJson(needs.job_initialize_pipeline.outputs.moduleTestFilePaths) }} - steps: - - name: 'Checkout' - uses: actions/checkout@v3 - with: - fetch-depth: 0 - - name: Set environment variables - uses: ./.github/actions/templates/setEnvironmentVariables - with: - variablesPath: ${{ env.variablesPath }} - - name: 'Using test file [${{ matrix.moduleTestFilePaths }}]' - uses: ./.github/actions/templates/validateModuleDeployment - with: - templateFilePath: '${{ env.modulePath }}/${{ matrix.moduleTestFilePaths }}' - location: '${{ env.location }}' - subscriptionId: '${{ secrets.ARM_SUBSCRIPTION_ID }}' - managementGroupId: '${{ secrets.ARM_MGMTGROUP_ID }}' - removeDeployment: '${{ (fromJson(needs.job_initialize_pipeline.outputs.workflowInput)).removeDeployment }}' - - ################## - # Publishing # - ################## - job_publish_module: - name: 'Publishing' - if: github.ref == 'refs/heads/main' || github.ref == 'refs/heads/master' || github.event.inputs.prerelease == 'true' - runs-on: ubuntu-20.04 - needs: - - job_module_deploy_validation - steps: - - name: 'Checkout' - uses: actions/checkout@v3 - with: - fetch-depth: 0 - - name: Set environment variables - uses: ./.github/actions/templates/setEnvironmentVariables - with: - variablesPath: ${{ env.variablesPath }} - - name: 'Publishing' - uses: ./.github/actions/templates/publishModule - with: - templateFilePath: '${{ env.modulePath }}/deploy.bicep' - templateSpecsRGName: '${{ env.templateSpecsRGName }}' - templateSpecsRGLocation: '${{ env.templateSpecsRGLocation }}' - templateSpecsDescription: '${{ env.templateSpecsDescription }}' - templateSpecsDoPublish: '${{ env.templateSpecsDoPublish }}' - bicepRegistryName: '${{ env.bicepRegistryName }}' - bicepRegistryRGName: '${{ env.bicepRegistryRGName }}' - bicepRegistryRgLocation: '${{ env.bicepRegistryRgLocation }}' - bicepRegistryDoPublish: '${{ env.bicepRegistryDoPublish }}' - publishLatest: '${{ env.publishLatest }}' + uses: ./.github/workflows/template.module.yml + with: + workflowInput: '${{ needs.job_initialize_pipeline.outputs.workflowInput }}' + moduleTestFilePaths: '${{ needs.job_initialize_pipeline.outputs.moduleTestFilePaths }}' + modulePath: '${{ needs.job_initialize_pipeline.outputs.modulePath}}' + secrets: inherit diff --git a/.github/workflows/ms.network.virtualwans.yml b/.github/workflows/ms.network.virtualwans.yml index 178612f9fb..c28d9b2c7b 100644 --- a/.github/workflows/ms.network.virtualwans.yml +++ b/.github/workflows/ms.network.virtualwans.yml @@ -1,4 +1,4 @@ -name: 'Network: VirtualWans' +name: 'Network - VirtualWans' on: workflow_dispatch: @@ -28,6 +28,7 @@ on: - main paths: - '.github/actions/templates/**' + - '.github/workflows/template.module.yml' - '.github/workflows/ms.network.virtualwans.yml' - 'modules/Microsoft.Network/virtualWans/**' - 'utilities/pipelines/**' @@ -35,14 +36,8 @@ on: - '!*/**/readme.md' env: - variablesPath: 'settings.yml' modulePath: 'modules/Microsoft.Network/virtualWans' workflowPath: '.github/workflows/ms.network.virtualwans.yml' - AZURE_CREDENTIALS: ${{ secrets.AZURE_CREDENTIALS }} - ARM_SUBSCRIPTION_ID: '${{ secrets.ARM_SUBSCRIPTION_ID }}' - ARM_MGMTGROUP_ID: '${{ secrets.ARM_MGMTGROUP_ID }}' - ARM_TENANT_ID: '${{ secrets.ARM_TENANT_ID }}' - TOKEN_NAMEPREFIX: '${{ secrets.TOKEN_NAMEPREFIX }}' concurrency: group: ${{ github.workflow }} @@ -72,94 +67,19 @@ jobs: outputs: workflowInput: ${{ steps.get-workflow-param.outputs.workflowInput }} moduleTestFilePaths: ${{ steps.get-module-test-file-paths.outputs.moduleTestFilePaths }} + modulePath: '${{ env.modulePath }}' - ######################### - # Static validation # - ######################### - job_module_static_validation: - runs-on: ubuntu-20.04 - name: 'Static validation' - if: (fromJson(needs.job_initialize_pipeline.outputs.workflowInput)).staticValidation == 'true' - needs: - - job_initialize_pipeline - steps: - - name: 'Checkout' - uses: actions/checkout@v3 - with: - fetch-depth: 0 - - name: Set environment variables - uses: ./.github/actions/templates/setEnvironmentVariables - with: - variablesPath: ${{ env.variablesPath }} - - name: 'Run tests' - uses: ./.github/actions/templates/validateModulePester - with: - modulePath: '${{ env.modulePath }}' - moduleTestFilePath: '${{ env.moduleTestFilePath }}' - ############################# - # Deployment validation # - ############################# - job_module_deploy_validation: - runs-on: ubuntu-20.04 - name: 'Deploying' - if: | - !cancelled() && - (fromJson(needs.job_initialize_pipeline.outputs.workflowInput)).deploymentValidation == 'true' && - needs.job_module_static_validation.result != 'failure' + ############################## + # Call reusable workflow # + ############################## + call-workflow-passing-data: + name: 'Module' needs: - job_initialize_pipeline - - job_module_static_validation - strategy: - fail-fast: false - matrix: - moduleTestFilePaths: ${{ fromJson(needs.job_initialize_pipeline.outputs.moduleTestFilePaths) }} - steps: - - name: 'Checkout' - uses: actions/checkout@v3 - with: - fetch-depth: 0 - - name: Set environment variables - uses: ./.github/actions/templates/setEnvironmentVariables - with: - variablesPath: ${{ env.variablesPath }} - - name: 'Using test file [${{ matrix.moduleTestFilePaths }}]' - uses: ./.github/actions/templates/validateModuleDeployment - with: - templateFilePath: '${{ env.modulePath }}/${{ matrix.moduleTestFilePaths }}' - location: '${{ env.location }}' - subscriptionId: '${{ secrets.ARM_SUBSCRIPTION_ID }}' - managementGroupId: '${{ secrets.ARM_MGMTGROUP_ID }}' - removeDeployment: '${{ (fromJson(needs.job_initialize_pipeline.outputs.workflowInput)).removeDeployment }}' - - ################## - # Publishing # - ################## - job_publish_module: - name: 'Publishing' - if: github.ref == 'refs/heads/main' || github.ref == 'refs/heads/master' || github.event.inputs.prerelease == 'true' - runs-on: ubuntu-20.04 - needs: - - job_module_deploy_validation - steps: - - name: 'Checkout' - uses: actions/checkout@v3 - with: - fetch-depth: 0 - - name: Set environment variables - uses: ./.github/actions/templates/setEnvironmentVariables - with: - variablesPath: ${{ env.variablesPath }} - - name: 'Publishing' - uses: ./.github/actions/templates/publishModule - with: - templateFilePath: '${{ env.modulePath }}/deploy.bicep' - templateSpecsRGName: '${{ env.templateSpecsRGName }}' - templateSpecsRGLocation: '${{ env.templateSpecsRGLocation }}' - templateSpecsDescription: '${{ env.templateSpecsDescription }}' - templateSpecsDoPublish: '${{ env.templateSpecsDoPublish }}' - bicepRegistryName: '${{ env.bicepRegistryName }}' - bicepRegistryRGName: '${{ env.bicepRegistryRGName }}' - bicepRegistryRgLocation: '${{ env.bicepRegistryRgLocation }}' - bicepRegistryDoPublish: '${{ env.bicepRegistryDoPublish }}' - publishLatest: '${{ env.publishLatest }}' + uses: ./.github/workflows/template.module.yml + with: + workflowInput: '${{ needs.job_initialize_pipeline.outputs.workflowInput }}' + moduleTestFilePaths: '${{ needs.job_initialize_pipeline.outputs.moduleTestFilePaths }}' + modulePath: '${{ needs.job_initialize_pipeline.outputs.modulePath}}' + secrets: inherit diff --git a/.github/workflows/ms.network.vpngateways.yml b/.github/workflows/ms.network.vpngateways.yml index 6421a6fbc8..c0f692f9e2 100644 --- a/.github/workflows/ms.network.vpngateways.yml +++ b/.github/workflows/ms.network.vpngateways.yml @@ -1,4 +1,4 @@ -name: 'Network: VPNGateways' +name: 'Network - VPNGateways' on: workflow_dispatch: @@ -28,6 +28,7 @@ on: - main paths: - '.github/actions/templates/**' + - '.github/workflows/template.module.yml' - '.github/workflows/ms.network.vpngateways.yml' - 'modules/Microsoft.Network/vpnGateways/**' - 'utilities/pipelines/**' @@ -35,14 +36,8 @@ on: - '!*/**/readme.md' env: - variablesPath: 'settings.yml' modulePath: 'modules/Microsoft.Network/vpnGateways' workflowPath: '.github/workflows/ms.network.vpngateways.yml' - AZURE_CREDENTIALS: ${{ secrets.AZURE_CREDENTIALS }} - ARM_SUBSCRIPTION_ID: '${{ secrets.ARM_SUBSCRIPTION_ID }}' - ARM_MGMTGROUP_ID: '${{ secrets.ARM_MGMTGROUP_ID }}' - ARM_TENANT_ID: '${{ secrets.ARM_TENANT_ID }}' - TOKEN_NAMEPREFIX: '${{ secrets.TOKEN_NAMEPREFIX }}' concurrency: group: ${{ github.workflow }} @@ -72,94 +67,19 @@ jobs: outputs: workflowInput: ${{ steps.get-workflow-param.outputs.workflowInput }} moduleTestFilePaths: ${{ steps.get-module-test-file-paths.outputs.moduleTestFilePaths }} + modulePath: '${{ env.modulePath }}' - ######################### - # Static validation # - ######################### - job_module_static_validation: - runs-on: ubuntu-20.04 - name: 'Static validation' - if: (fromJson(needs.job_initialize_pipeline.outputs.workflowInput)).staticValidation == 'true' - needs: - - job_initialize_pipeline - steps: - - name: 'Checkout' - uses: actions/checkout@v3 - with: - fetch-depth: 0 - - name: Set environment variables - uses: ./.github/actions/templates/setEnvironmentVariables - with: - variablesPath: ${{ env.variablesPath }} - - name: 'Run tests' - uses: ./.github/actions/templates/validateModulePester - with: - modulePath: '${{ env.modulePath }}' - moduleTestFilePath: '${{ env.moduleTestFilePath }}' - ############################# - # Deployment validation # - ############################# - job_module_deploy_validation: - runs-on: ubuntu-20.04 - name: 'Deploying' - if: | - !cancelled() && - (fromJson(needs.job_initialize_pipeline.outputs.workflowInput)).deploymentValidation == 'true' && - needs.job_module_static_validation.result != 'failure' + ############################## + # Call reusable workflow # + ############################## + call-workflow-passing-data: + name: 'Module' needs: - job_initialize_pipeline - - job_module_static_validation - strategy: - fail-fast: false - matrix: - moduleTestFilePaths: ${{ fromJson(needs.job_initialize_pipeline.outputs.moduleTestFilePaths) }} - steps: - - name: 'Checkout' - uses: actions/checkout@v3 - with: - fetch-depth: 0 - - name: Set environment variables - uses: ./.github/actions/templates/setEnvironmentVariables - with: - variablesPath: ${{ env.variablesPath }} - - name: 'Using test file [${{ matrix.moduleTestFilePaths }}]' - uses: ./.github/actions/templates/validateModuleDeployment - with: - templateFilePath: '${{ env.modulePath }}/${{ matrix.moduleTestFilePaths }}' - location: '${{ env.location }}' - subscriptionId: '${{ secrets.ARM_SUBSCRIPTION_ID }}' - managementGroupId: '${{ secrets.ARM_MGMTGROUP_ID }}' - removeDeployment: '${{ (fromJson(needs.job_initialize_pipeline.outputs.workflowInput)).removeDeployment }}' - - ################## - # Publishing # - ################## - job_publish_module: - name: 'Publishing' - if: github.ref == 'refs/heads/main' || github.ref == 'refs/heads/master' || github.event.inputs.prerelease == 'true' - runs-on: ubuntu-20.04 - needs: - - job_module_deploy_validation - steps: - - name: 'Checkout' - uses: actions/checkout@v3 - with: - fetch-depth: 0 - - name: Set environment variables - uses: ./.github/actions/templates/setEnvironmentVariables - with: - variablesPath: ${{ env.variablesPath }} - - name: 'Publishing' - uses: ./.github/actions/templates/publishModule - with: - templateFilePath: '${{ env.modulePath }}/deploy.bicep' - templateSpecsRGName: '${{ env.templateSpecsRGName }}' - templateSpecsRGLocation: '${{ env.templateSpecsRGLocation }}' - templateSpecsDescription: '${{ env.templateSpecsDescription }}' - templateSpecsDoPublish: '${{ env.templateSpecsDoPublish }}' - bicepRegistryName: '${{ env.bicepRegistryName }}' - bicepRegistryRGName: '${{ env.bicepRegistryRGName }}' - bicepRegistryRgLocation: '${{ env.bicepRegistryRgLocation }}' - bicepRegistryDoPublish: '${{ env.bicepRegistryDoPublish }}' - publishLatest: '${{ env.publishLatest }}' + uses: ./.github/workflows/template.module.yml + with: + workflowInput: '${{ needs.job_initialize_pipeline.outputs.workflowInput }}' + moduleTestFilePaths: '${{ needs.job_initialize_pipeline.outputs.moduleTestFilePaths }}' + modulePath: '${{ needs.job_initialize_pipeline.outputs.modulePath}}' + secrets: inherit diff --git a/.github/workflows/ms.network.vpnsites.yml b/.github/workflows/ms.network.vpnsites.yml index fc0ecd21e2..a18ae96417 100644 --- a/.github/workflows/ms.network.vpnsites.yml +++ b/.github/workflows/ms.network.vpnsites.yml @@ -1,4 +1,4 @@ -name: 'Network: VPN Sites' +name: 'Network - VPN Sites' on: workflow_dispatch: @@ -28,6 +28,7 @@ on: - main paths: - '.github/actions/templates/**' + - '.github/workflows/template.module.yml' - '.github/workflows/ms.network.vpnsites.yml' - 'modules/Microsoft.Network/vpnSites/**' - 'utilities/pipelines/**' @@ -35,14 +36,8 @@ on: - '!*/**/readme.md' env: - variablesPath: 'settings.yml' modulePath: 'modules/Microsoft.Network/vpnSites' workflowPath: '.github/workflows/ms.network.vpnsites.yml' - AZURE_CREDENTIALS: ${{ secrets.AZURE_CREDENTIALS }} - ARM_SUBSCRIPTION_ID: '${{ secrets.ARM_SUBSCRIPTION_ID }}' - ARM_MGMTGROUP_ID: '${{ secrets.ARM_MGMTGROUP_ID }}' - ARM_TENANT_ID: '${{ secrets.ARM_TENANT_ID }}' - TOKEN_NAMEPREFIX: '${{ secrets.TOKEN_NAMEPREFIX }}' concurrency: group: ${{ github.workflow }} @@ -72,94 +67,19 @@ jobs: outputs: workflowInput: ${{ steps.get-workflow-param.outputs.workflowInput }} moduleTestFilePaths: ${{ steps.get-module-test-file-paths.outputs.moduleTestFilePaths }} + modulePath: '${{ env.modulePath }}' - ######################### - # Static validation # - ######################### - job_module_static_validation: - runs-on: ubuntu-20.04 - name: 'Static validation' - if: (fromJson(needs.job_initialize_pipeline.outputs.workflowInput)).staticValidation == 'true' - needs: - - job_initialize_pipeline - steps: - - name: 'Checkout' - uses: actions/checkout@v3 - with: - fetch-depth: 0 - - name: Set environment variables - uses: ./.github/actions/templates/setEnvironmentVariables - with: - variablesPath: ${{ env.variablesPath }} - - name: 'Run tests' - uses: ./.github/actions/templates/validateModulePester - with: - modulePath: '${{ env.modulePath }}' - moduleTestFilePath: '${{ env.moduleTestFilePath }}' - ############################# - # Deployment validation # - ############################# - job_module_deploy_validation: - runs-on: ubuntu-20.04 - name: 'Deploying' - if: | - !cancelled() && - (fromJson(needs.job_initialize_pipeline.outputs.workflowInput)).deploymentValidation == 'true' && - needs.job_module_static_validation.result != 'failure' + ############################## + # Call reusable workflow # + ############################## + call-workflow-passing-data: + name: 'Module' needs: - job_initialize_pipeline - - job_module_static_validation - strategy: - fail-fast: false - matrix: - moduleTestFilePaths: ${{ fromJson(needs.job_initialize_pipeline.outputs.moduleTestFilePaths) }} - steps: - - name: 'Checkout' - uses: actions/checkout@v3 - with: - fetch-depth: 0 - - name: Set environment variables - uses: ./.github/actions/templates/setEnvironmentVariables - with: - variablesPath: ${{ env.variablesPath }} - - name: 'Using test file [${{ matrix.moduleTestFilePaths }}]' - uses: ./.github/actions/templates/validateModuleDeployment - with: - templateFilePath: '${{ env.modulePath }}/${{ matrix.moduleTestFilePaths }}' - location: '${{ env.location }}' - subscriptionId: '${{ secrets.ARM_SUBSCRIPTION_ID }}' - managementGroupId: '${{ secrets.ARM_MGMTGROUP_ID }}' - removeDeployment: '${{ (fromJson(needs.job_initialize_pipeline.outputs.workflowInput)).removeDeployment }}' - - ################## - # Publishing # - ################## - job_publish_module: - name: 'Publishing' - if: github.ref == 'refs/heads/main' || github.ref == 'refs/heads/master' || github.event.inputs.prerelease == 'true' - runs-on: ubuntu-20.04 - needs: - - job_module_deploy_validation - steps: - - name: 'Checkout' - uses: actions/checkout@v3 - with: - fetch-depth: 0 - - name: Set environment variables - uses: ./.github/actions/templates/setEnvironmentVariables - with: - variablesPath: ${{ env.variablesPath }} - - name: 'Publishing' - uses: ./.github/actions/templates/publishModule - with: - templateFilePath: '${{ env.modulePath }}/deploy.bicep' - templateSpecsRGName: '${{ env.templateSpecsRGName }}' - templateSpecsRGLocation: '${{ env.templateSpecsRGLocation }}' - templateSpecsDescription: '${{ env.templateSpecsDescription }}' - templateSpecsDoPublish: '${{ env.templateSpecsDoPublish }}' - bicepRegistryName: '${{ env.bicepRegistryName }}' - bicepRegistryRGName: '${{ env.bicepRegistryRGName }}' - bicepRegistryRgLocation: '${{ env.bicepRegistryRgLocation }}' - bicepRegistryDoPublish: '${{ env.bicepRegistryDoPublish }}' - publishLatest: '${{ env.publishLatest }}' + uses: ./.github/workflows/template.module.yml + with: + workflowInput: '${{ needs.job_initialize_pipeline.outputs.workflowInput }}' + moduleTestFilePaths: '${{ needs.job_initialize_pipeline.outputs.moduleTestFilePaths }}' + modulePath: '${{ needs.job_initialize_pipeline.outputs.modulePath}}' + secrets: inherit diff --git a/.github/workflows/ms.operationalinsights.workspaces.yml b/.github/workflows/ms.operationalinsights.workspaces.yml index 01aa2d2a50..86f17a2385 100644 --- a/.github/workflows/ms.operationalinsights.workspaces.yml +++ b/.github/workflows/ms.operationalinsights.workspaces.yml @@ -1,4 +1,4 @@ -name: 'OperationalInsights: Workspaces' +name: 'OperationalInsights - Workspaces' on: workflow_dispatch: @@ -28,6 +28,7 @@ on: - main paths: - '.github/actions/templates/**' + - '.github/workflows/template.module.yml' - '.github/workflows/ms.operationalinsights.workspaces.yml' - 'modules/Microsoft.OperationalInsights/workspaces/**' - 'utilities/pipelines/**' @@ -35,14 +36,8 @@ on: - '!*/**/readme.md' env: - variablesPath: 'settings.yml' modulePath: 'modules/Microsoft.OperationalInsights/workspaces' workflowPath: '.github/workflows/ms.operationalinsights.workspaces.yml' - AZURE_CREDENTIALS: ${{ secrets.AZURE_CREDENTIALS }} - ARM_SUBSCRIPTION_ID: '${{ secrets.ARM_SUBSCRIPTION_ID }}' - ARM_MGMTGROUP_ID: '${{ secrets.ARM_MGMTGROUP_ID }}' - ARM_TENANT_ID: '${{ secrets.ARM_TENANT_ID }}' - TOKEN_NAMEPREFIX: '${{ secrets.TOKEN_NAMEPREFIX }}' concurrency: group: ${{ github.workflow }} @@ -72,94 +67,19 @@ jobs: outputs: workflowInput: ${{ steps.get-workflow-param.outputs.workflowInput }} moduleTestFilePaths: ${{ steps.get-module-test-file-paths.outputs.moduleTestFilePaths }} + modulePath: '${{ env.modulePath }}' - ######################### - # Static validation # - ######################### - job_module_static_validation: - runs-on: ubuntu-20.04 - name: 'Static validation' - if: (fromJson(needs.job_initialize_pipeline.outputs.workflowInput)).staticValidation == 'true' - needs: - - job_initialize_pipeline - steps: - - name: 'Checkout' - uses: actions/checkout@v3 - with: - fetch-depth: 0 - - name: Set environment variables - uses: ./.github/actions/templates/setEnvironmentVariables - with: - variablesPath: ${{ env.variablesPath }} - - name: 'Run tests' - uses: ./.github/actions/templates/validateModulePester - with: - modulePath: '${{ env.modulePath }}' - moduleTestFilePath: '${{ env.moduleTestFilePath }}' - ############################# - # Deployment validation # - ############################# - job_module_deploy_validation: - runs-on: ubuntu-20.04 - name: 'Deploying' - if: | - !cancelled() && - (fromJson(needs.job_initialize_pipeline.outputs.workflowInput)).deploymentValidation == 'true' && - needs.job_module_static_validation.result != 'failure' + ############################## + # Call reusable workflow # + ############################## + call-workflow-passing-data: + name: 'Module' needs: - job_initialize_pipeline - - job_module_static_validation - strategy: - fail-fast: false - matrix: - moduleTestFilePaths: ${{ fromJson(needs.job_initialize_pipeline.outputs.moduleTestFilePaths) }} - steps: - - name: 'Checkout' - uses: actions/checkout@v3 - with: - fetch-depth: 0 - - name: Set environment variables - uses: ./.github/actions/templates/setEnvironmentVariables - with: - variablesPath: ${{ env.variablesPath }} - - name: 'Using test file [${{ matrix.moduleTestFilePaths }}]' - uses: ./.github/actions/templates/validateModuleDeployment - with: - templateFilePath: '${{ env.modulePath }}/${{ matrix.moduleTestFilePaths }}' - location: '${{ env.location }}' - subscriptionId: '${{ secrets.ARM_SUBSCRIPTION_ID }}' - managementGroupId: '${{ secrets.ARM_MGMTGROUP_ID }}' - removeDeployment: '${{ (fromJson(needs.job_initialize_pipeline.outputs.workflowInput)).removeDeployment }}' - - ################## - # Publishing # - ################## - job_publish_module: - name: 'Publishing' - if: github.ref == 'refs/heads/main' || github.ref == 'refs/heads/master' || github.event.inputs.prerelease == 'true' - runs-on: ubuntu-20.04 - needs: - - job_module_deploy_validation - steps: - - name: 'Checkout' - uses: actions/checkout@v3 - with: - fetch-depth: 0 - - name: Set environment variables - uses: ./.github/actions/templates/setEnvironmentVariables - with: - variablesPath: ${{ env.variablesPath }} - - name: 'Publishing' - uses: ./.github/actions/templates/publishModule - with: - templateFilePath: '${{ env.modulePath }}/deploy.bicep' - templateSpecsRGName: '${{ env.templateSpecsRGName }}' - templateSpecsRGLocation: '${{ env.templateSpecsRGLocation }}' - templateSpecsDescription: '${{ env.templateSpecsDescription }}' - templateSpecsDoPublish: '${{ env.templateSpecsDoPublish }}' - bicepRegistryName: '${{ env.bicepRegistryName }}' - bicepRegistryRGName: '${{ env.bicepRegistryRGName }}' - bicepRegistryRgLocation: '${{ env.bicepRegistryRgLocation }}' - bicepRegistryDoPublish: '${{ env.bicepRegistryDoPublish }}' - publishLatest: '${{ env.publishLatest }}' + uses: ./.github/workflows/template.module.yml + with: + workflowInput: '${{ needs.job_initialize_pipeline.outputs.workflowInput }}' + moduleTestFilePaths: '${{ needs.job_initialize_pipeline.outputs.moduleTestFilePaths }}' + modulePath: '${{ needs.job_initialize_pipeline.outputs.modulePath}}' + secrets: inherit diff --git a/.github/workflows/ms.operationsmanagement.solutions.yml b/.github/workflows/ms.operationsmanagement.solutions.yml index af57204492..70ec2beb5f 100644 --- a/.github/workflows/ms.operationsmanagement.solutions.yml +++ b/.github/workflows/ms.operationsmanagement.solutions.yml @@ -1,4 +1,4 @@ -name: 'OperationsManagement: Solutions' +name: 'OperationsManagement - Solutions' on: workflow_dispatch: @@ -28,6 +28,7 @@ on: - main paths: - '.github/actions/templates/**' + - '.github/workflows/template.module.yml' - '.github/workflows/ms.operationsmanagement.solutions.yml' - 'modules/Microsoft.OperationsManagement/solutions/**' - 'utilities/pipelines/**' @@ -35,14 +36,8 @@ on: - '!*/**/readme.md' env: - variablesPath: 'settings.yml' modulePath: 'modules/Microsoft.OperationsManagement/solutions' workflowPath: '.github/workflows/ms.operationsmanagement.solutions.yml' - AZURE_CREDENTIALS: ${{ secrets.AZURE_CREDENTIALS }} - ARM_SUBSCRIPTION_ID: '${{ secrets.ARM_SUBSCRIPTION_ID }}' - ARM_MGMTGROUP_ID: '${{ secrets.ARM_MGMTGROUP_ID }}' - ARM_TENANT_ID: '${{ secrets.ARM_TENANT_ID }}' - TOKEN_NAMEPREFIX: '${{ secrets.TOKEN_NAMEPREFIX }}' concurrency: group: ${{ github.workflow }} @@ -72,94 +67,19 @@ jobs: outputs: workflowInput: ${{ steps.get-workflow-param.outputs.workflowInput }} moduleTestFilePaths: ${{ steps.get-module-test-file-paths.outputs.moduleTestFilePaths }} + modulePath: '${{ env.modulePath }}' - ######################### - # Static validation # - ######################### - job_module_static_validation: - runs-on: ubuntu-20.04 - name: 'Static validation' - if: (fromJson(needs.job_initialize_pipeline.outputs.workflowInput)).staticValidation == 'true' - needs: - - job_initialize_pipeline - steps: - - name: 'Checkout' - uses: actions/checkout@v3 - with: - fetch-depth: 0 - - name: Set environment variables - uses: ./.github/actions/templates/setEnvironmentVariables - with: - variablesPath: ${{ env.variablesPath }} - - name: 'Run tests' - uses: ./.github/actions/templates/validateModulePester - with: - modulePath: '${{ env.modulePath }}' - moduleTestFilePath: '${{ env.moduleTestFilePath }}' - ############################# - # Deployment validation # - ############################# - job_module_deploy_validation: - runs-on: ubuntu-20.04 - name: 'Deploying' - if: | - !cancelled() && - (fromJson(needs.job_initialize_pipeline.outputs.workflowInput)).deploymentValidation == 'true' && - needs.job_module_static_validation.result != 'failure' + ############################## + # Call reusable workflow # + ############################## + call-workflow-passing-data: + name: 'Module' needs: - job_initialize_pipeline - - job_module_static_validation - strategy: - fail-fast: false - matrix: - moduleTestFilePaths: ${{ fromJson(needs.job_initialize_pipeline.outputs.moduleTestFilePaths) }} - steps: - - name: 'Checkout' - uses: actions/checkout@v3 - with: - fetch-depth: 0 - - name: Set environment variables - uses: ./.github/actions/templates/setEnvironmentVariables - with: - variablesPath: ${{ env.variablesPath }} - - name: 'Using test file [${{ matrix.moduleTestFilePaths }}]' - uses: ./.github/actions/templates/validateModuleDeployment - with: - templateFilePath: '${{ env.modulePath }}/${{ matrix.moduleTestFilePaths }}' - location: '${{ env.location }}' - subscriptionId: '${{ secrets.ARM_SUBSCRIPTION_ID }}' - managementGroupId: '${{ secrets.ARM_MGMTGROUP_ID }}' - removeDeployment: '${{ (fromJson(needs.job_initialize_pipeline.outputs.workflowInput)).removeDeployment }}' - - ################## - # Publishing # - ################## - job_publish_module: - name: 'Publishing' - if: github.ref == 'refs/heads/main' || github.ref == 'refs/heads/master' || github.event.inputs.prerelease == 'true' - runs-on: ubuntu-20.04 - needs: - - job_module_deploy_validation - steps: - - name: 'Checkout' - uses: actions/checkout@v3 - with: - fetch-depth: 0 - - name: Set environment variables - uses: ./.github/actions/templates/setEnvironmentVariables - with: - variablesPath: ${{ env.variablesPath }} - - name: 'Publishing' - uses: ./.github/actions/templates/publishModule - with: - templateFilePath: '${{ env.modulePath }}/deploy.bicep' - templateSpecsRGName: '${{ env.templateSpecsRGName }}' - templateSpecsRGLocation: '${{ env.templateSpecsRGLocation }}' - templateSpecsDescription: '${{ env.templateSpecsDescription }}' - templateSpecsDoPublish: '${{ env.templateSpecsDoPublish }}' - bicepRegistryName: '${{ env.bicepRegistryName }}' - bicepRegistryRGName: '${{ env.bicepRegistryRGName }}' - bicepRegistryRgLocation: '${{ env.bicepRegistryRgLocation }}' - bicepRegistryDoPublish: '${{ env.bicepRegistryDoPublish }}' - publishLatest: '${{ env.publishLatest }}' + uses: ./.github/workflows/template.module.yml + with: + workflowInput: '${{ needs.job_initialize_pipeline.outputs.workflowInput }}' + moduleTestFilePaths: '${{ needs.job_initialize_pipeline.outputs.moduleTestFilePaths }}' + modulePath: '${{ needs.job_initialize_pipeline.outputs.modulePath}}' + secrets: inherit diff --git a/.github/workflows/ms.policyinsights.remediations.yml b/.github/workflows/ms.policyinsights.remediations.yml index 8109daa483..e6a87486b2 100644 --- a/.github/workflows/ms.policyinsights.remediations.yml +++ b/.github/workflows/ms.policyinsights.remediations.yml @@ -1,4 +1,4 @@ -name: 'Policy Insights: Remediations' +name: 'PolicyInsights - Remediations' on: workflow_dispatch: @@ -28,6 +28,7 @@ on: - main paths: - '.github/actions/templates/**' + - '.github/workflows/template.module.yml' - '.github/workflows/ms.policyinsights.remediations.yml' - 'modules/Microsoft.PolicyInsights/remediations/**' - 'utilities/pipelines/**' @@ -35,14 +36,8 @@ on: - '!*/**/readme.md' env: - variablesPath: 'settings.yml' modulePath: 'modules/Microsoft.PolicyInsights/remediations' workflowPath: '.github/workflows/ms.policyinsights.remediations.yml' - AZURE_CREDENTIALS: ${{ secrets.AZURE_CREDENTIALS }} - ARM_SUBSCRIPTION_ID: '${{ secrets.ARM_SUBSCRIPTION_ID }}' - ARM_MGMTGROUP_ID: '${{ secrets.ARM_MGMTGROUP_ID }}' - ARM_TENANT_ID: '${{ secrets.ARM_TENANT_ID }}' - TOKEN_NAMEPREFIX: '${{ secrets.TOKEN_NAMEPREFIX }}' concurrency: group: ${{ github.workflow }} @@ -72,97 +67,19 @@ jobs: outputs: workflowInput: ${{ steps.get-workflow-param.outputs.workflowInput }} moduleTestFilePaths: ${{ steps.get-module-test-file-paths.outputs.moduleTestFilePaths }} + modulePath: '${{ env.modulePath }}' - ######################### - # Static validation # - ######################### - job_module_static_validation: - runs-on: ubuntu-20.04 - name: 'Static validation' - if: (fromJson(needs.job_initialize_pipeline.outputs.workflowInput)).staticValidation == 'true' - needs: - - job_initialize_pipeline - steps: - - name: 'Checkout' - uses: actions/checkout@v3 - with: - fetch-depth: 0 - - name: Set environment variables - uses: ./.github/actions/templates/setEnvironmentVariables - with: - variablesPath: ${{ env.variablesPath }} - - name: 'Run tests' - uses: ./.github/actions/templates/validateModulePester - with: - modulePath: '${{ env.modulePath }}' - moduleTestFilePath: '${{ env.moduleTestFilePath }}' - ############################# - # Deployment validation # - ############################# - job_module_deploy_validation: - runs-on: ubuntu-20.04 - name: 'Deploying' - if: | - !cancelled() && - (fromJson(needs.job_initialize_pipeline.outputs.workflowInput)).deploymentValidation == 'true' && - needs.job_module_static_validation.result != 'failure' + ############################## + # Call reusable workflow # + ############################## + call-workflow-passing-data: + name: 'Module' needs: - job_initialize_pipeline - - job_module_static_validation - strategy: - fail-fast: false - matrix: - moduleTestFilePaths: ${{ fromJson(needs.job_initialize_pipeline.outputs.moduleTestFilePaths) }} - steps: - - name: 'Checkout' - uses: actions/checkout@v3 - with: - fetch-depth: 0 - - name: Set environment variables - uses: ./.github/actions/templates/setEnvironmentVariables - with: - variablesPath: ${{ env.variablesPath }} - # ------------------- # - ## Deploy & Remove ## - # ------------------- # - - name: 'Using test file [${{ matrix.moduleTestFilePaths }}]' - uses: ./.github/actions/templates/validateModuleDeployment - with: - templateFilePath: '${{ env.modulePath }}/${{ matrix.moduleTestFilePaths }}' - location: '${{ env.location }}' - subscriptionId: '${{ secrets.ARM_SUBSCRIPTION_ID }}' - managementGroupId: '${{ secrets.ARM_MGMTGROUP_ID }}' - removeDeployment: '${{ (fromJson(needs.job_initialize_pipeline.outputs.workflowInput)).removeDeployment }}' - - ################## - # Publishing # - ################## - job_publish_module: - name: 'Publishing' - if: github.ref == 'refs/heads/main' || github.ref == 'refs/heads/master' || github.event.inputs.prerelease == 'true' - runs-on: ubuntu-20.04 - needs: - - job_module_deploy_validation - steps: - - name: 'Checkout' - uses: actions/checkout@v3 - with: - fetch-depth: 0 - - name: Set environment variables - uses: ./.github/actions/templates/setEnvironmentVariables - with: - variablesPath: ${{ env.variablesPath }} - - name: 'Publishing' - uses: ./.github/actions/templates/publishModule - with: - templateFilePath: '${{ env.modulePath }}/deploy.bicep' - templateSpecsRGName: '${{ env.templateSpecsRGName }}' - templateSpecsRGLocation: '${{ env.templateSpecsRGLocation }}' - templateSpecsDescription: '${{ env.templateSpecsDescription }}' - templateSpecsDoPublish: '${{ env.templateSpecsDoPublish }}' - bicepRegistryName: '${{ env.bicepRegistryName }}' - bicepRegistryRGName: '${{ env.bicepRegistryRGName }}' - bicepRegistryRgLocation: '${{ env.bicepRegistryRgLocation }}' - bicepRegistryDoPublish: '${{ env.bicepRegistryDoPublish }}' - publishLatest: '${{ env.publishLatest }}' + uses: ./.github/workflows/template.module.yml + with: + workflowInput: '${{ needs.job_initialize_pipeline.outputs.workflowInput }}' + moduleTestFilePaths: '${{ needs.job_initialize_pipeline.outputs.moduleTestFilePaths }}' + modulePath: '${{ needs.job_initialize_pipeline.outputs.modulePath}}' + secrets: inherit diff --git a/.github/workflows/ms.powerbidedicated.capacities.yml b/.github/workflows/ms.powerbidedicated.capacities.yml index c1ad451dd7..2cbdbec23f 100644 --- a/.github/workflows/ms.powerbidedicated.capacities.yml +++ b/.github/workflows/ms.powerbidedicated.capacities.yml @@ -1,4 +1,4 @@ -name: 'PowerBiDedicated: Capacities' +name: 'PowerBiDedicated - Capacities' on: workflow_dispatch: @@ -28,6 +28,7 @@ on: - main paths: - '.github/actions/templates/**' + - '.github/workflows/template.module.yml' - '.github/workflows/ms.powerbidedicated.capacities.yml' - 'modules/Microsoft.PowerBIDedicated/capacities/**' - 'utilities/pipelines/**' @@ -35,14 +36,8 @@ on: - '!*/**/readme.md' env: - variablesPath: 'settings.yml' modulePath: 'modules/Microsoft.PowerBIDedicated/capacities' workflowPath: '.github/workflows/ms.powerbidedicated.capacities.yml' - AZURE_CREDENTIALS: ${{ secrets.AZURE_CREDENTIALS }} - ARM_SUBSCRIPTION_ID: '${{ secrets.ARM_SUBSCRIPTION_ID }}' - ARM_MGMTGROUP_ID: '${{ secrets.ARM_MGMTGROUP_ID }}' - ARM_TENANT_ID: '${{ secrets.ARM_TENANT_ID }}' - TOKEN_NAMEPREFIX: '${{ secrets.TOKEN_NAMEPREFIX }}' concurrency: group: ${{ github.workflow }} @@ -72,94 +67,19 @@ jobs: outputs: workflowInput: ${{ steps.get-workflow-param.outputs.workflowInput }} moduleTestFilePaths: ${{ steps.get-module-test-file-paths.outputs.moduleTestFilePaths }} + modulePath: '${{ env.modulePath }}' - ######################### - # Static validation # - ######################### - job_module_static_validation: - runs-on: ubuntu-20.04 - name: 'Static validation' - if: (fromJson(needs.job_initialize_pipeline.outputs.workflowInput)).staticValidation == 'true' - needs: - - job_initialize_pipeline - steps: - - name: 'Checkout' - uses: actions/checkout@v3 - with: - fetch-depth: 0 - - name: Set environment variables - uses: ./.github/actions/templates/setEnvironmentVariables - with: - variablesPath: ${{ env.variablesPath }} - - name: 'Run tests' - uses: ./.github/actions/templates/validateModulePester - with: - modulePath: '${{ env.modulePath }}' - moduleTestFilePath: '${{ env.moduleTestFilePath }}' - ############################# - # Deployment validation # - ############################# - job_module_deploy_validation: - runs-on: ubuntu-20.04 - name: 'Deploying' - if: | - !cancelled() && - (fromJson(needs.job_initialize_pipeline.outputs.workflowInput)).deploymentValidation == 'true' && - needs.job_module_static_validation.result != 'failure' + ############################## + # Call reusable workflow # + ############################## + call-workflow-passing-data: + name: 'Module' needs: - job_initialize_pipeline - - job_module_static_validation - strategy: - fail-fast: false - matrix: - moduleTestFilePaths: ${{ fromJson(needs.job_initialize_pipeline.outputs.moduleTestFilePaths) }} - steps: - - name: 'Checkout' - uses: actions/checkout@v3 - with: - fetch-depth: 0 - - name: Set environment variables - uses: ./.github/actions/templates/setEnvironmentVariables - with: - variablesPath: ${{ env.variablesPath }} - - name: 'Using test file [${{ matrix.moduleTestFilePaths }}]' - uses: ./.github/actions/templates/validateModuleDeployment - with: - templateFilePath: '${{ env.modulePath }}/${{ matrix.moduleTestFilePaths }}' - location: '${{ env.location }}' - subscriptionId: '${{ secrets.ARM_SUBSCRIPTION_ID }}' - managementGroupId: '${{ secrets.ARM_MGMTGROUP_ID }}' - removeDeployment: '${{ (fromJson(needs.job_initialize_pipeline.outputs.workflowInput)).removeDeployment }}' - - ################## - # Publishing # - ################## - job_publish_module: - name: 'Publishing' - if: github.ref == 'refs/heads/main' || github.ref == 'refs/heads/master' || github.event.inputs.prerelease == 'true' - runs-on: ubuntu-20.04 - needs: - - job_module_deploy_validation - steps: - - name: 'Checkout' - uses: actions/checkout@v3 - with: - fetch-depth: 0 - - name: Set environment variables - uses: ./.github/actions/templates/setEnvironmentVariables - with: - variablesPath: ${{ env.variablesPath }} - - name: 'Publishing' - uses: ./.github/actions/templates/publishModule - with: - templateFilePath: '${{ env.modulePath }}/deploy.bicep' - templateSpecsRGName: '${{ env.templateSpecsRGName }}' - templateSpecsRGLocation: '${{ env.templateSpecsRGLocation }}' - templateSpecsDescription: '${{ env.templateSpecsDescription }}' - templateSpecsDoPublish: '${{ env.templateSpecsDoPublish }}' - bicepRegistryName: '${{ env.bicepRegistryName }}' - bicepRegistryRGName: '${{ env.bicepRegistryRGName }}' - bicepRegistryRgLocation: '${{ env.bicepRegistryRgLocation }}' - bicepRegistryDoPublish: '${{ env.bicepRegistryDoPublish }}' - publishLatest: '${{ env.publishLatest }}' + uses: ./.github/workflows/template.module.yml + with: + workflowInput: '${{ needs.job_initialize_pipeline.outputs.workflowInput }}' + moduleTestFilePaths: '${{ needs.job_initialize_pipeline.outputs.moduleTestFilePaths }}' + modulePath: '${{ needs.job_initialize_pipeline.outputs.modulePath}}' + secrets: inherit diff --git a/.github/workflows/ms.purview.accounts.yml b/.github/workflows/ms.purview.accounts.yml index 5adf1336c0..bd6c32df1a 100644 --- a/.github/workflows/ms.purview.accounts.yml +++ b/.github/workflows/ms.purview.accounts.yml @@ -1,4 +1,4 @@ -name: 'Purview: Accounts' +name: 'Purview - Accounts' on: workflow_dispatch: @@ -28,6 +28,7 @@ on: - main paths: - '.github/actions/templates/**' + - '.github/workflows/template.module.yml' - '.github/workflows/ms.purview.accounts.yml' - 'modules/Microsoft.Purview/accounts/**' - 'utilities/pipelines/**' @@ -35,14 +36,8 @@ on: - '!*/**/readme.md' env: - variablesPath: 'settings.yml' modulePath: 'modules/Microsoft.Purview/accounts' workflowPath: '.github/workflows/ms.purview.accounts.yml' - AZURE_CREDENTIALS: ${{ secrets.AZURE_CREDENTIALS }} - ARM_SUBSCRIPTION_ID: '${{ secrets.ARM_SUBSCRIPTION_ID }}' - ARM_MGMTGROUP_ID: '${{ secrets.ARM_MGMTGROUP_ID }}' - ARM_TENANT_ID: '${{ secrets.ARM_TENANT_ID }}' - TOKEN_NAMEPREFIX: '${{ secrets.TOKEN_NAMEPREFIX }}' concurrency: group: ${{ github.workflow }} @@ -72,97 +67,19 @@ jobs: outputs: workflowInput: ${{ steps.get-workflow-param.outputs.workflowInput }} moduleTestFilePaths: ${{ steps.get-module-test-file-paths.outputs.moduleTestFilePaths }} + modulePath: '${{ env.modulePath }}' - ######################### - # Static validation # - ######################### - job_module_static_validation: - runs-on: ubuntu-20.04 - name: 'Static validation' - if: (fromJson(needs.job_initialize_pipeline.outputs.workflowInput)).staticValidation == 'true' - needs: - - job_initialize_pipeline - steps: - - name: 'Checkout' - uses: actions/checkout@v3 - with: - fetch-depth: 0 - - name: Set environment variables - uses: ./.github/actions/templates/setEnvironmentVariables - with: - variablesPath: ${{ env.variablesPath }} - - name: 'Run tests' - uses: ./.github/actions/templates/validateModulePester - with: - modulePath: '${{ env.modulePath }}' - moduleTestFilePath: '${{ env.moduleTestFilePath }}' - ############################# - # Deployment validation # - ############################# - job_module_deploy_validation: - runs-on: ubuntu-20.04 - name: 'Deploying' - if: | - !cancelled() && - (fromJson(needs.job_initialize_pipeline.outputs.workflowInput)).deploymentValidation == 'true' && - needs.job_module_static_validation.result != 'failure' + ############################## + # Call reusable workflow # + ############################## + call-workflow-passing-data: + name: 'Module' needs: - job_initialize_pipeline - - job_module_static_validation - strategy: - fail-fast: false - matrix: - moduleTestFilePaths: ${{ fromJson(needs.job_initialize_pipeline.outputs.moduleTestFilePaths) }} - steps: - - name: 'Checkout' - uses: actions/checkout@v3 - with: - fetch-depth: 0 - - name: Set environment variables - uses: ./.github/actions/templates/setEnvironmentVariables - with: - variablesPath: ${{ env.variablesPath }} - # ------------------- # - ## Deploy & Remove ## - # ------------------- # - - name: 'Using test file [${{ matrix.moduleTestFilePaths }}]' - uses: ./.github/actions/templates/validateModuleDeployment - with: - templateFilePath: '${{ env.modulePath }}/${{ matrix.moduleTestFilePaths }}' - location: '${{ env.location }}' - subscriptionId: '${{ secrets.ARM_SUBSCRIPTION_ID }}' - managementGroupId: '${{ secrets.ARM_MGMTGROUP_ID }}' - removeDeployment: '${{ (fromJson(needs.job_initialize_pipeline.outputs.workflowInput)).removeDeployment }}' - - ################## - # Publishing # - ################## - job_publish_module: - name: 'Publishing' - if: github.ref == 'refs/heads/main' || github.ref == 'refs/heads/master' || github.event.inputs.prerelease == 'true' - runs-on: ubuntu-20.04 - needs: - - job_module_deploy_validation - steps: - - name: 'Checkout' - uses: actions/checkout@v3 - with: - fetch-depth: 0 - - name: Set environment variables - uses: ./.github/actions/templates/setEnvironmentVariables - with: - variablesPath: ${{ env.variablesPath }} - - name: 'Publishing' - uses: ./.github/actions/templates/publishModule - with: - templateFilePath: '${{ env.modulePath }}/deploy.bicep' - templateSpecsRGName: '${{ env.templateSpecsRGName }}' - templateSpecsRGLocation: '${{ env.templateSpecsRGLocation }}' - templateSpecsDescription: '${{ env.templateSpecsDescription }}' - templateSpecsDoPublish: '${{ env.templateSpecsDoPublish }}' - bicepRegistryName: '${{ env.bicepRegistryName }}' - bicepRegistryRGName: '${{ env.bicepRegistryRGName }}' - bicepRegistryRgLocation: '${{ env.bicepRegistryRgLocation }}' - bicepRegistryDoPublish: '${{ env.bicepRegistryDoPublish }}' - publishLatest: '${{ env.publishLatest }}' + uses: ./.github/workflows/template.module.yml + with: + workflowInput: '${{ needs.job_initialize_pipeline.outputs.workflowInput }}' + moduleTestFilePaths: '${{ needs.job_initialize_pipeline.outputs.moduleTestFilePaths }}' + modulePath: '${{ needs.job_initialize_pipeline.outputs.modulePath}}' + secrets: inherit diff --git a/.github/workflows/ms.recoveryservices.vaults.yml b/.github/workflows/ms.recoveryservices.vaults.yml index 72aa250ee9..81bf1d9b9e 100644 --- a/.github/workflows/ms.recoveryservices.vaults.yml +++ b/.github/workflows/ms.recoveryservices.vaults.yml @@ -1,4 +1,4 @@ -name: 'RecoveryServices: Vaults' +name: 'RecoveryServices - Vaults' on: workflow_dispatch: @@ -28,6 +28,7 @@ on: - main paths: - '.github/actions/templates/**' + - '.github/workflows/template.module.yml' - '.github/workflows/ms.recoveryservices.vaults.yml' - 'modules/Microsoft.RecoveryServices/vaults/**' - 'utilities/pipelines/**' @@ -35,14 +36,8 @@ on: - '!*/**/readme.md' env: - variablesPath: 'settings.yml' modulePath: 'modules/Microsoft.RecoveryServices/vaults' workflowPath: '.github/workflows/ms.recoveryservices.vaults.yml' - AZURE_CREDENTIALS: ${{ secrets.AZURE_CREDENTIALS }} - ARM_SUBSCRIPTION_ID: '${{ secrets.ARM_SUBSCRIPTION_ID }}' - ARM_MGMTGROUP_ID: '${{ secrets.ARM_MGMTGROUP_ID }}' - ARM_TENANT_ID: '${{ secrets.ARM_TENANT_ID }}' - TOKEN_NAMEPREFIX: '${{ secrets.TOKEN_NAMEPREFIX }}' concurrency: group: ${{ github.workflow }} @@ -72,94 +67,19 @@ jobs: outputs: workflowInput: ${{ steps.get-workflow-param.outputs.workflowInput }} moduleTestFilePaths: ${{ steps.get-module-test-file-paths.outputs.moduleTestFilePaths }} + modulePath: '${{ env.modulePath }}' - ######################### - # Static validation # - ######################### - job_module_static_validation: - runs-on: ubuntu-20.04 - name: 'Static validation' - if: (fromJson(needs.job_initialize_pipeline.outputs.workflowInput)).staticValidation == 'true' - needs: - - job_initialize_pipeline - steps: - - name: 'Checkout' - uses: actions/checkout@v3 - with: - fetch-depth: 0 - - name: Set environment variables - uses: ./.github/actions/templates/setEnvironmentVariables - with: - variablesPath: ${{ env.variablesPath }} - - name: 'Run tests' - uses: ./.github/actions/templates/validateModulePester - with: - modulePath: '${{ env.modulePath }}' - moduleTestFilePath: '${{ env.moduleTestFilePath }}' - ############################# - # Deployment validation # - ############################# - job_module_deploy_validation: - runs-on: ubuntu-20.04 - name: 'Deploying' - if: | - !cancelled() && - (fromJson(needs.job_initialize_pipeline.outputs.workflowInput)).deploymentValidation == 'true' && - needs.job_module_static_validation.result != 'failure' + ############################## + # Call reusable workflow # + ############################## + call-workflow-passing-data: + name: 'Module' needs: - job_initialize_pipeline - - job_module_static_validation - strategy: - fail-fast: false - matrix: - moduleTestFilePaths: ${{ fromJson(needs.job_initialize_pipeline.outputs.moduleTestFilePaths) }} - steps: - - name: 'Checkout' - uses: actions/checkout@v3 - with: - fetch-depth: 0 - - name: Set environment variables - uses: ./.github/actions/templates/setEnvironmentVariables - with: - variablesPath: ${{ env.variablesPath }} - - name: 'Using test file [${{ matrix.moduleTestFilePaths }}]' - uses: ./.github/actions/templates/validateModuleDeployment - with: - templateFilePath: '${{ env.modulePath }}/${{ matrix.moduleTestFilePaths }}' - location: '${{ env.location }}' - subscriptionId: '${{ secrets.ARM_SUBSCRIPTION_ID }}' - managementGroupId: '${{ secrets.ARM_MGMTGROUP_ID }}' - removeDeployment: '${{ (fromJson(needs.job_initialize_pipeline.outputs.workflowInput)).removeDeployment }}' - - ################## - # Publishing # - ################## - job_publish_module: - name: 'Publishing' - if: github.ref == 'refs/heads/main' || github.ref == 'refs/heads/master' || github.event.inputs.prerelease == 'true' - runs-on: ubuntu-20.04 - needs: - - job_module_deploy_validation - steps: - - name: 'Checkout' - uses: actions/checkout@v3 - with: - fetch-depth: 0 - - name: Set environment variables - uses: ./.github/actions/templates/setEnvironmentVariables - with: - variablesPath: ${{ env.variablesPath }} - - name: 'Publishing' - uses: ./.github/actions/templates/publishModule - with: - templateFilePath: '${{ env.modulePath }}/deploy.bicep' - templateSpecsRGName: '${{ env.templateSpecsRGName }}' - templateSpecsRGLocation: '${{ env.templateSpecsRGLocation }}' - templateSpecsDescription: '${{ env.templateSpecsDescription }}' - templateSpecsDoPublish: '${{ env.templateSpecsDoPublish }}' - bicepRegistryName: '${{ env.bicepRegistryName }}' - bicepRegistryRGName: '${{ env.bicepRegistryRGName }}' - bicepRegistryRgLocation: '${{ env.bicepRegistryRgLocation }}' - bicepRegistryDoPublish: '${{ env.bicepRegistryDoPublish }}' - publishLatest: '${{ env.publishLatest }}' + uses: ./.github/workflows/template.module.yml + with: + workflowInput: '${{ needs.job_initialize_pipeline.outputs.workflowInput }}' + moduleTestFilePaths: '${{ needs.job_initialize_pipeline.outputs.moduleTestFilePaths }}' + modulePath: '${{ needs.job_initialize_pipeline.outputs.modulePath}}' + secrets: inherit diff --git a/.github/workflows/ms.resources.deploymentscripts.yml b/.github/workflows/ms.resources.deploymentscripts.yml index 1dc1d42f14..75ff16ca1f 100644 --- a/.github/workflows/ms.resources.deploymentscripts.yml +++ b/.github/workflows/ms.resources.deploymentscripts.yml @@ -1,4 +1,4 @@ -name: 'Resources: DeploymentScripts' +name: 'Resources - DeploymentScripts' on: workflow_dispatch: @@ -28,6 +28,7 @@ on: - main paths: - '.github/actions/templates/**' + - '.github/workflows/template.module.yml' - '.github/workflows/ms.resources.deploymentscripts.yml' - 'modules/Microsoft.Resources/deploymentScripts/**' - 'utilities/pipelines/**' @@ -35,14 +36,8 @@ on: - '!*/**/readme.md' env: - variablesPath: 'settings.yml' modulePath: 'modules/Microsoft.Resources/deploymentScripts' workflowPath: '.github/workflows/ms.resources.deploymentscripts.yml' - AZURE_CREDENTIALS: ${{ secrets.AZURE_CREDENTIALS }} - ARM_SUBSCRIPTION_ID: '${{ secrets.ARM_SUBSCRIPTION_ID }}' - ARM_MGMTGROUP_ID: '${{ secrets.ARM_MGMTGROUP_ID }}' - ARM_TENANT_ID: '${{ secrets.ARM_TENANT_ID }}' - TOKEN_NAMEPREFIX: '${{ secrets.TOKEN_NAMEPREFIX }}' concurrency: group: ${{ github.workflow }} @@ -72,94 +67,19 @@ jobs: outputs: workflowInput: ${{ steps.get-workflow-param.outputs.workflowInput }} moduleTestFilePaths: ${{ steps.get-module-test-file-paths.outputs.moduleTestFilePaths }} + modulePath: '${{ env.modulePath }}' - ######################### - # Static validation # - ######################### - job_module_static_validation: - runs-on: ubuntu-20.04 - name: 'Static validation' - if: (fromJson(needs.job_initialize_pipeline.outputs.workflowInput)).staticValidation == 'true' - needs: - - job_initialize_pipeline - steps: - - name: 'Checkout' - uses: actions/checkout@v3 - with: - fetch-depth: 0 - - name: Set environment variables - uses: ./.github/actions/templates/setEnvironmentVariables - with: - variablesPath: ${{ env.variablesPath }} - - name: 'Run tests' - uses: ./.github/actions/templates/validateModulePester - with: - modulePath: '${{ env.modulePath }}' - moduleTestFilePath: '${{ env.moduleTestFilePath }}' - ############################# - # Deployment validation # - ############################# - job_module_deploy_validation: - runs-on: ubuntu-20.04 - name: 'Deploying' - if: | - !cancelled() && - (fromJson(needs.job_initialize_pipeline.outputs.workflowInput)).deploymentValidation == 'true' && - needs.job_module_static_validation.result != 'failure' + ############################## + # Call reusable workflow # + ############################## + call-workflow-passing-data: + name: 'Module' needs: - job_initialize_pipeline - - job_module_static_validation - strategy: - fail-fast: false - matrix: - moduleTestFilePaths: ${{ fromJson(needs.job_initialize_pipeline.outputs.moduleTestFilePaths) }} - steps: - - name: 'Checkout' - uses: actions/checkout@v3 - with: - fetch-depth: 0 - - name: Set environment variables - uses: ./.github/actions/templates/setEnvironmentVariables - with: - variablesPath: ${{ env.variablesPath }} - - name: 'Using test file [${{ matrix.moduleTestFilePaths }}]' - uses: ./.github/actions/templates/validateModuleDeployment - with: - templateFilePath: '${{ env.modulePath }}/${{ matrix.moduleTestFilePaths }}' - location: '${{ env.location }}' - subscriptionId: '${{ secrets.ARM_SUBSCRIPTION_ID }}' - managementGroupId: '${{ secrets.ARM_MGMTGROUP_ID }}' - removeDeployment: '${{ (fromJson(needs.job_initialize_pipeline.outputs.workflowInput)).removeDeployment }}' - - ################## - # Publishing # - ################## - job_publish_module: - name: 'Publishing' - if: github.ref == 'refs/heads/main' || github.ref == 'refs/heads/master' || github.event.inputs.prerelease == 'true' - runs-on: ubuntu-20.04 - needs: - - job_module_deploy_validation - steps: - - name: 'Checkout' - uses: actions/checkout@v3 - with: - fetch-depth: 0 - - name: Set environment variables - uses: ./.github/actions/templates/setEnvironmentVariables - with: - variablesPath: ${{ env.variablesPath }} - - name: 'Publishing' - uses: ./.github/actions/templates/publishModule - with: - templateFilePath: '${{ env.modulePath }}/deploy.bicep' - templateSpecsRGName: '${{ env.templateSpecsRGName }}' - templateSpecsRGLocation: '${{ env.templateSpecsRGLocation }}' - templateSpecsDescription: '${{ env.templateSpecsDescription }}' - templateSpecsDoPublish: '${{ env.templateSpecsDoPublish }}' - bicepRegistryName: '${{ env.bicepRegistryName }}' - bicepRegistryRGName: '${{ env.bicepRegistryRGName }}' - bicepRegistryRgLocation: '${{ env.bicepRegistryRgLocation }}' - bicepRegistryDoPublish: '${{ env.bicepRegistryDoPublish }}' - publishLatest: '${{ env.publishLatest }}' + uses: ./.github/workflows/template.module.yml + with: + workflowInput: '${{ needs.job_initialize_pipeline.outputs.workflowInput }}' + moduleTestFilePaths: '${{ needs.job_initialize_pipeline.outputs.moduleTestFilePaths }}' + modulePath: '${{ needs.job_initialize_pipeline.outputs.modulePath}}' + secrets: inherit diff --git a/.github/workflows/ms.resources.resourcegroups.yml b/.github/workflows/ms.resources.resourcegroups.yml index 58c3da3d0d..942c6369f5 100644 --- a/.github/workflows/ms.resources.resourcegroups.yml +++ b/.github/workflows/ms.resources.resourcegroups.yml @@ -1,4 +1,4 @@ -name: 'Resources: ResourceGroups' +name: 'Resources - ResourceGroups' on: workflow_dispatch: @@ -28,6 +28,7 @@ on: - main paths: - '.github/actions/templates/**' + - '.github/workflows/template.module.yml' - '.github/workflows/ms.resources.resourcegroups.yml' - 'modules/Microsoft.Resources/resourceGroups/**' - 'utilities/pipelines/**' @@ -35,14 +36,8 @@ on: - '!*/**/readme.md' env: - variablesPath: 'settings.yml' modulePath: 'modules/Microsoft.Resources/resourceGroups' workflowPath: '.github/workflows/ms.resources.resourcegroups.yml' - AZURE_CREDENTIALS: ${{ secrets.AZURE_CREDENTIALS }} - ARM_SUBSCRIPTION_ID: '${{ secrets.ARM_SUBSCRIPTION_ID }}' - ARM_MGMTGROUP_ID: '${{ secrets.ARM_MGMTGROUP_ID }}' - ARM_TENANT_ID: '${{ secrets.ARM_TENANT_ID }}' - TOKEN_NAMEPREFIX: '${{ secrets.TOKEN_NAMEPREFIX }}' concurrency: group: ${{ github.workflow }} @@ -72,94 +67,19 @@ jobs: outputs: workflowInput: ${{ steps.get-workflow-param.outputs.workflowInput }} moduleTestFilePaths: ${{ steps.get-module-test-file-paths.outputs.moduleTestFilePaths }} + modulePath: '${{ env.modulePath }}' - ######################### - # Static validation # - ######################### - job_module_static_validation: - runs-on: ubuntu-20.04 - name: 'Static validation' - if: (fromJson(needs.job_initialize_pipeline.outputs.workflowInput)).staticValidation == 'true' - needs: - - job_initialize_pipeline - steps: - - name: 'Checkout' - uses: actions/checkout@v3 - with: - fetch-depth: 0 - - name: Set environment variables - uses: ./.github/actions/templates/setEnvironmentVariables - with: - variablesPath: ${{ env.variablesPath }} - - name: 'Run tests' - uses: ./.github/actions/templates/validateModulePester - with: - modulePath: '${{ env.modulePath }}' - moduleTestFilePath: '${{ env.moduleTestFilePath }}' - ############################# - # Deployment validation # - ############################# - job_module_deploy_validation: - runs-on: ubuntu-20.04 - name: 'Deploying' - if: | - !cancelled() && - (fromJson(needs.job_initialize_pipeline.outputs.workflowInput)).deploymentValidation == 'true' && - needs.job_module_static_validation.result != 'failure' + ############################## + # Call reusable workflow # + ############################## + call-workflow-passing-data: + name: 'Module' needs: - job_initialize_pipeline - - job_module_static_validation - strategy: - fail-fast: false - matrix: - moduleTestFilePaths: ${{ fromJson(needs.job_initialize_pipeline.outputs.moduleTestFilePaths) }} - steps: - - name: 'Checkout' - uses: actions/checkout@v3 - with: - fetch-depth: 0 - - name: Set environment variables - uses: ./.github/actions/templates/setEnvironmentVariables - with: - variablesPath: ${{ env.variablesPath }} - - name: 'Using test file [${{ matrix.moduleTestFilePaths }}]' - uses: ./.github/actions/templates/validateModuleDeployment - with: - templateFilePath: '${{ env.modulePath }}/${{ matrix.moduleTestFilePaths }}' - location: '${{ env.location }}' - subscriptionId: '${{ secrets.ARM_SUBSCRIPTION_ID }}' - managementGroupId: '${{ secrets.ARM_MGMTGROUP_ID }}' - removeDeployment: '${{ (fromJson(needs.job_initialize_pipeline.outputs.workflowInput)).removeDeployment }}' - - ################## - # Publishing # - ################## - job_publish_module: - name: 'Publishing' - if: github.ref == 'refs/heads/main' || github.ref == 'refs/heads/master' || github.event.inputs.prerelease == 'true' - runs-on: ubuntu-20.04 - needs: - - job_module_deploy_validation - steps: - - name: 'Checkout' - uses: actions/checkout@v3 - with: - fetch-depth: 0 - - name: Set environment variables - uses: ./.github/actions/templates/setEnvironmentVariables - with: - variablesPath: ${{ env.variablesPath }} - - name: 'Publishing' - uses: ./.github/actions/templates/publishModule - with: - templateFilePath: '${{ env.modulePath }}/deploy.bicep' - templateSpecsRGName: '${{ env.templateSpecsRGName }}' - templateSpecsRGLocation: '${{ env.templateSpecsRGLocation }}' - templateSpecsDescription: '${{ env.templateSpecsDescription }}' - templateSpecsDoPublish: '${{ env.templateSpecsDoPublish }}' - bicepRegistryName: '${{ env.bicepRegistryName }}' - bicepRegistryRGName: '${{ env.bicepRegistryRGName }}' - bicepRegistryRgLocation: '${{ env.bicepRegistryRgLocation }}' - bicepRegistryDoPublish: '${{ env.bicepRegistryDoPublish }}' - publishLatest: '${{ env.publishLatest }}' + uses: ./.github/workflows/template.module.yml + with: + workflowInput: '${{ needs.job_initialize_pipeline.outputs.workflowInput }}' + moduleTestFilePaths: '${{ needs.job_initialize_pipeline.outputs.moduleTestFilePaths }}' + modulePath: '${{ needs.job_initialize_pipeline.outputs.modulePath}}' + secrets: inherit diff --git a/.github/workflows/ms.resources.tags.yml b/.github/workflows/ms.resources.tags.yml index 5c6a260dec..775f3ef8f3 100644 --- a/.github/workflows/ms.resources.tags.yml +++ b/.github/workflows/ms.resources.tags.yml @@ -1,4 +1,4 @@ -name: 'Resources: Tags' +name: 'Resources - Tags' on: workflow_dispatch: @@ -28,6 +28,7 @@ on: - main paths: - '.github/actions/templates/**' + - '.github/workflows/template.module.yml' - '.github/workflows/ms.resources.tags.yml' - 'modules/Microsoft.Resources/tags/**' - 'utilities/pipelines/**' @@ -35,14 +36,8 @@ on: - '!*/**/readme.md' env: - variablesPath: 'settings.yml' modulePath: 'modules/Microsoft.Resources/tags' workflowPath: '.github/workflows/ms.resources.tags.yml' - AZURE_CREDENTIALS: ${{ secrets.AZURE_CREDENTIALS }} - ARM_SUBSCRIPTION_ID: '${{ secrets.ARM_SUBSCRIPTION_ID }}' - ARM_MGMTGROUP_ID: '${{ secrets.ARM_MGMTGROUP_ID }}' - ARM_TENANT_ID: '${{ secrets.ARM_TENANT_ID }}' - TOKEN_NAMEPREFIX: '${{ secrets.TOKEN_NAMEPREFIX }}' concurrency: group: ${{ github.workflow }} @@ -72,94 +67,19 @@ jobs: outputs: workflowInput: ${{ steps.get-workflow-param.outputs.workflowInput }} moduleTestFilePaths: ${{ steps.get-module-test-file-paths.outputs.moduleTestFilePaths }} + modulePath: '${{ env.modulePath }}' - ######################### - # Static validation # - ######################### - job_module_static_validation: - runs-on: ubuntu-20.04 - name: 'Static validation' - if: (fromJson(needs.job_initialize_pipeline.outputs.workflowInput)).staticValidation == 'true' - needs: - - job_initialize_pipeline - steps: - - name: 'Checkout' - uses: actions/checkout@v3 - with: - fetch-depth: 0 - - name: Set environment variables - uses: ./.github/actions/templates/setEnvironmentVariables - with: - variablesPath: ${{ env.variablesPath }} - - name: 'Run tests' - uses: ./.github/actions/templates/validateModulePester - with: - modulePath: '${{ env.modulePath }}' - moduleTestFilePath: '${{ env.moduleTestFilePath }}' - ############################# - # Deployment validation # - ############################# - job_module_deploy_validation: - runs-on: ubuntu-20.04 - name: 'Deploying' - if: | - !cancelled() && - (fromJson(needs.job_initialize_pipeline.outputs.workflowInput)).deploymentValidation == 'true' && - needs.job_module_static_validation.result != 'failure' + ############################## + # Call reusable workflow # + ############################## + call-workflow-passing-data: + name: 'Module' needs: - job_initialize_pipeline - - job_module_static_validation - strategy: - fail-fast: false - matrix: - moduleTestFilePaths: ${{ fromJson(needs.job_initialize_pipeline.outputs.moduleTestFilePaths) }} - steps: - - name: 'Checkout' - uses: actions/checkout@v3 - with: - fetch-depth: 0 - - name: Set environment variables - uses: ./.github/actions/templates/setEnvironmentVariables - with: - variablesPath: ${{ env.variablesPath }} - - name: 'Using test file [${{ matrix.moduleTestFilePaths }}]' - uses: ./.github/actions/templates/validateModuleDeployment - with: - templateFilePath: '${{ env.modulePath }}/${{ matrix.moduleTestFilePaths }}' - location: '${{ env.location }}' - subscriptionId: '${{ secrets.ARM_SUBSCRIPTION_ID }}' - managementGroupId: '${{ secrets.ARM_MGMTGROUP_ID }}' - removeDeployment: '${{ (fromJson(needs.job_initialize_pipeline.outputs.workflowInput)).removeDeployment }}' - - ################## - # Publishing # - ################## - job_publish_module: - name: 'Publishing' - if: github.ref == 'refs/heads/main' || github.ref == 'refs/heads/master' || github.event.inputs.prerelease == 'true' - runs-on: ubuntu-20.04 - needs: - - job_module_deploy_validation - steps: - - name: 'Checkout' - uses: actions/checkout@v3 - with: - fetch-depth: 0 - - name: Set environment variables - uses: ./.github/actions/templates/setEnvironmentVariables - with: - variablesPath: ${{ env.variablesPath }} - - name: 'Publishing' - uses: ./.github/actions/templates/publishModule - with: - templateFilePath: '${{ env.modulePath }}/deploy.bicep' - templateSpecsRGName: '${{ env.templateSpecsRGName }}' - templateSpecsRGLocation: '${{ env.templateSpecsRGLocation }}' - templateSpecsDescription: '${{ env.templateSpecsDescription }}' - templateSpecsDoPublish: '${{ env.templateSpecsDoPublish }}' - bicepRegistryName: '${{ env.bicepRegistryName }}' - bicepRegistryRGName: '${{ env.bicepRegistryRGName }}' - bicepRegistryRgLocation: '${{ env.bicepRegistryRgLocation }}' - bicepRegistryDoPublish: '${{ env.bicepRegistryDoPublish }}' - publishLatest: '${{ env.publishLatest }}' + uses: ./.github/workflows/template.module.yml + with: + workflowInput: '${{ needs.job_initialize_pipeline.outputs.workflowInput }}' + moduleTestFilePaths: '${{ needs.job_initialize_pipeline.outputs.moduleTestFilePaths }}' + modulePath: '${{ needs.job_initialize_pipeline.outputs.modulePath}}' + secrets: inherit diff --git a/.github/workflows/ms.security.azuresecuritycenter.yml b/.github/workflows/ms.security.azuresecuritycenter.yml index a31d150435..350f7e190e 100644 --- a/.github/workflows/ms.security.azuresecuritycenter.yml +++ b/.github/workflows/ms.security.azuresecuritycenter.yml @@ -1,8 +1,18 @@ -name: 'Security: AzureSecurityCenter' +name: 'Security - AzureSecurityCenter' on: workflow_dispatch: inputs: + staticValidation: + type: boolean + description: 'Execute static validation' + required: false + default: true + deploymentValidation: + type: boolean + description: 'Execute deployment validation' + required: false + default: true removeDeployment: type: boolean description: 'Remove deployed module' @@ -18,6 +28,7 @@ on: - main paths: - '.github/actions/templates/**' + - '.github/workflows/template.module.yml' - '.github/workflows/ms.security.azuresecuritycenter.yml' - 'modules/Microsoft.Security/azureSecurityCenter/**' - 'utilities/pipelines/**' @@ -25,14 +36,8 @@ on: - '!*/**/readme.md' env: - variablesPath: 'settings.yml' modulePath: 'modules/Microsoft.Security/azureSecurityCenter' workflowPath: '.github/workflows/ms.security.azuresecuritycenter.yml' - AZURE_CREDENTIALS: ${{ secrets.AZURE_CREDENTIALS }} - ARM_SUBSCRIPTION_ID: '${{ secrets.ARM_SUBSCRIPTION_ID }}' - ARM_MGMTGROUP_ID: '${{ secrets.ARM_MGMTGROUP_ID }}' - ARM_TENANT_ID: '${{ secrets.ARM_TENANT_ID }}' - TOKEN_NAMEPREFIX: '${{ secrets.TOKEN_NAMEPREFIX }}' concurrency: group: ${{ github.workflow }} @@ -62,94 +67,19 @@ jobs: outputs: workflowInput: ${{ steps.get-workflow-param.outputs.workflowInput }} moduleTestFilePaths: ${{ steps.get-module-test-file-paths.outputs.moduleTestFilePaths }} + modulePath: '${{ env.modulePath }}' - ######################### - # Static validation # - ######################### - job_module_static_validation: - runs-on: ubuntu-20.04 - name: 'Static validation' - if: (fromJson(needs.job_initialize_pipeline.outputs.workflowInput)).staticValidation == 'true' - needs: - - job_initialize_pipeline - steps: - - name: 'Checkout' - uses: actions/checkout@v3 - with: - fetch-depth: 0 - - name: Set environment variables - uses: ./.github/actions/templates/setEnvironmentVariables - with: - variablesPath: ${{ env.variablesPath }} - - name: 'Run tests' - uses: ./.github/actions/templates/validateModulePester - with: - modulePath: '${{ env.modulePath }}' - moduleTestFilePath: '${{ env.moduleTestFilePath }}' - ############################# - # Deployment validation # - ############################# - job_module_deploy_validation: - runs-on: ubuntu-20.04 - name: 'Deploying' - if: | - !cancelled() && - (fromJson(needs.job_initialize_pipeline.outputs.workflowInput)).deploymentValidation == 'true' && - needs.job_module_static_validation.result != 'failure' + ############################## + # Call reusable workflow # + ############################## + call-workflow-passing-data: + name: 'Module' needs: - job_initialize_pipeline - - job_module_static_validation - strategy: - fail-fast: false - matrix: - moduleTestFilePaths: ${{ fromJson(needs.job_initialize_pipeline.outputs.moduleTestFilePaths) }} - steps: - - name: 'Checkout' - uses: actions/checkout@v3 - with: - fetch-depth: 0 - - name: Set environment variables - uses: ./.github/actions/templates/setEnvironmentVariables - with: - variablesPath: ${{ env.variablesPath }} - - name: 'Using test file [${{ matrix.moduleTestFilePaths }}]' - uses: ./.github/actions/templates/validateModuleDeployment - with: - templateFilePath: '${{ env.modulePath }}/${{ matrix.moduleTestFilePaths }}' - location: '${{ env.location }}' - subscriptionId: '${{ secrets.ARM_SUBSCRIPTION_ID }}' - managementGroupId: '${{ secrets.ARM_MGMTGROUP_ID }}' - removeDeployment: '${{ (fromJson(needs.job_initialize_pipeline.outputs.workflowInput)).removeDeployment }}' - - ################## - # Publishing # - ################## - job_publish_module: - name: 'Publishing' - if: github.ref == 'refs/heads/main' || github.ref == 'refs/heads/master' || github.event.inputs.prerelease == 'true' - runs-on: ubuntu-20.04 - needs: - - job_module_deploy_validation - steps: - - name: 'Checkout' - uses: actions/checkout@v3 - with: - fetch-depth: 0 - - name: Set environment variables - uses: ./.github/actions/templates/setEnvironmentVariables - with: - variablesPath: ${{ env.variablesPath }} - - name: 'Publishing' - uses: ./.github/actions/templates/publishModule - with: - templateFilePath: '${{ env.modulePath }}/deploy.bicep' - templateSpecsRGName: '${{ env.templateSpecsRGName }}' - templateSpecsRGLocation: '${{ env.templateSpecsRGLocation }}' - templateSpecsDescription: '${{ env.templateSpecsDescription }}' - templateSpecsDoPublish: '${{ env.templateSpecsDoPublish }}' - bicepRegistryName: '${{ env.bicepRegistryName }}' - bicepRegistryRGName: '${{ env.bicepRegistryRGName }}' - bicepRegistryRgLocation: '${{ env.bicepRegistryRgLocation }}' - bicepRegistryDoPublish: '${{ env.bicepRegistryDoPublish }}' - publishLatest: '${{ env.publishLatest }}' + uses: ./.github/workflows/template.module.yml + with: + workflowInput: '${{ needs.job_initialize_pipeline.outputs.workflowInput }}' + moduleTestFilePaths: '${{ needs.job_initialize_pipeline.outputs.moduleTestFilePaths }}' + modulePath: '${{ needs.job_initialize_pipeline.outputs.modulePath}}' + secrets: inherit diff --git a/.github/workflows/ms.servicebus.namespaces.yml b/.github/workflows/ms.servicebus.namespaces.yml index b66bb96987..6d63f8a7f9 100644 --- a/.github/workflows/ms.servicebus.namespaces.yml +++ b/.github/workflows/ms.servicebus.namespaces.yml @@ -1,4 +1,4 @@ -name: 'ServiceBus: Namespaces' +name: 'ServiceBus - Namespaces' on: workflow_dispatch: @@ -28,6 +28,7 @@ on: - main paths: - '.github/actions/templates/**' + - '.github/workflows/template.module.yml' - '.github/workflows/ms.servicebus.namespaces.yml' - 'modules/Microsoft.ServiceBus/namespaces/**' - 'utilities/pipelines/**' @@ -35,14 +36,8 @@ on: - '!*/**/readme.md' env: - variablesPath: 'settings.yml' modulePath: 'modules/Microsoft.ServiceBus/namespaces' workflowPath: '.github/workflows/ms.servicebus.namespaces.yml' - AZURE_CREDENTIALS: ${{ secrets.AZURE_CREDENTIALS }} - ARM_SUBSCRIPTION_ID: '${{ secrets.ARM_SUBSCRIPTION_ID }}' - ARM_MGMTGROUP_ID: '${{ secrets.ARM_MGMTGROUP_ID }}' - ARM_TENANT_ID: '${{ secrets.ARM_TENANT_ID }}' - TOKEN_NAMEPREFIX: '${{ secrets.TOKEN_NAMEPREFIX }}' concurrency: group: ${{ github.workflow }} @@ -72,94 +67,19 @@ jobs: outputs: workflowInput: ${{ steps.get-workflow-param.outputs.workflowInput }} moduleTestFilePaths: ${{ steps.get-module-test-file-paths.outputs.moduleTestFilePaths }} + modulePath: '${{ env.modulePath }}' - ######################### - # Static validation # - ######################### - job_module_static_validation: - runs-on: ubuntu-20.04 - name: 'Static validation' - if: (fromJson(needs.job_initialize_pipeline.outputs.workflowInput)).staticValidation == 'true' - needs: - - job_initialize_pipeline - steps: - - name: 'Checkout' - uses: actions/checkout@v3 - with: - fetch-depth: 0 - - name: Set environment variables - uses: ./.github/actions/templates/setEnvironmentVariables - with: - variablesPath: ${{ env.variablesPath }} - - name: 'Run tests' - uses: ./.github/actions/templates/validateModulePester - with: - modulePath: '${{ env.modulePath }}' - moduleTestFilePath: '${{ env.moduleTestFilePath }}' - ############################# - # Deployment validation # - ############################# - job_module_deploy_validation: - runs-on: ubuntu-20.04 - name: 'Deploying' - if: | - !cancelled() && - (fromJson(needs.job_initialize_pipeline.outputs.workflowInput)).deploymentValidation == 'true' && - needs.job_module_static_validation.result != 'failure' + ############################## + # Call reusable workflow # + ############################## + call-workflow-passing-data: + name: 'Module' needs: - job_initialize_pipeline - - job_module_static_validation - strategy: - fail-fast: false - matrix: - moduleTestFilePaths: ${{ fromJson(needs.job_initialize_pipeline.outputs.moduleTestFilePaths) }} - steps: - - name: 'Checkout' - uses: actions/checkout@v3 - with: - fetch-depth: 0 - - name: Set environment variables - uses: ./.github/actions/templates/setEnvironmentVariables - with: - variablesPath: ${{ env.variablesPath }} - - name: 'Using test file [${{ matrix.moduleTestFilePaths }}]' - uses: ./.github/actions/templates/validateModuleDeployment - with: - templateFilePath: '${{ env.modulePath }}/${{ matrix.moduleTestFilePaths }}' - location: '${{ env.location }}' - subscriptionId: '${{ secrets.ARM_SUBSCRIPTION_ID }}' - managementGroupId: '${{ secrets.ARM_MGMTGROUP_ID }}' - removeDeployment: '${{ (fromJson(needs.job_initialize_pipeline.outputs.workflowInput)).removeDeployment }}' - - ################## - # Publishing # - ################## - job_publish_module: - name: 'Publishing' - if: github.ref == 'refs/heads/main' || github.ref == 'refs/heads/master' || github.event.inputs.prerelease == 'true' - runs-on: ubuntu-20.04 - needs: - - job_module_deploy_validation - steps: - - name: 'Checkout' - uses: actions/checkout@v3 - with: - fetch-depth: 0 - - name: Set environment variables - uses: ./.github/actions/templates/setEnvironmentVariables - with: - variablesPath: ${{ env.variablesPath }} - - name: 'Publishing' - uses: ./.github/actions/templates/publishModule - with: - templateFilePath: '${{ env.modulePath }}/deploy.bicep' - templateSpecsRGName: '${{ env.templateSpecsRGName }}' - templateSpecsRGLocation: '${{ env.templateSpecsRGLocation }}' - templateSpecsDescription: '${{ env.templateSpecsDescription }}' - templateSpecsDoPublish: '${{ env.templateSpecsDoPublish }}' - bicepRegistryName: '${{ env.bicepRegistryName }}' - bicepRegistryRGName: '${{ env.bicepRegistryRGName }}' - bicepRegistryRgLocation: '${{ env.bicepRegistryRgLocation }}' - bicepRegistryDoPublish: '${{ env.bicepRegistryDoPublish }}' - publishLatest: '${{ env.publishLatest }}' + uses: ./.github/workflows/template.module.yml + with: + workflowInput: '${{ needs.job_initialize_pipeline.outputs.workflowInput }}' + moduleTestFilePaths: '${{ needs.job_initialize_pipeline.outputs.moduleTestFilePaths }}' + modulePath: '${{ needs.job_initialize_pipeline.outputs.modulePath}}' + secrets: inherit diff --git a/.github/workflows/ms.servicefabric.clusters.yml b/.github/workflows/ms.servicefabric.clusters.yml index 97e0da90a7..599fbab1bb 100644 --- a/.github/workflows/ms.servicefabric.clusters.yml +++ b/.github/workflows/ms.servicefabric.clusters.yml @@ -1,4 +1,4 @@ -name: 'Service Fabric: Clusters' +name: 'ServiceFabric - Clusters' on: workflow_dispatch: @@ -28,6 +28,7 @@ on: - main paths: - '.github/actions/templates/**' + - '.github/workflows/template.module.yml' - '.github/workflows/ms.servicefabric.clusters.yml' - 'modules/Microsoft.ServiceFabric/clusters/**' - 'utilities/pipelines/**' @@ -35,14 +36,8 @@ on: - '!*/**/readme.md' env: - variablesPath: 'settings.yml' modulePath: 'modules/Microsoft.ServiceFabric/clusters' workflowPath: '.github/workflows/ms.servicefabric.clusters.yml' - AZURE_CREDENTIALS: ${{ secrets.AZURE_CREDENTIALS }} - ARM_SUBSCRIPTION_ID: '${{ secrets.ARM_SUBSCRIPTION_ID }}' - ARM_MGMTGROUP_ID: '${{ secrets.ARM_MGMTGROUP_ID }}' - ARM_TENANT_ID: '${{ secrets.ARM_TENANT_ID }}' - TOKEN_NAMEPREFIX: '${{ secrets.TOKEN_NAMEPREFIX }}' concurrency: group: ${{ github.workflow }} @@ -72,94 +67,19 @@ jobs: outputs: workflowInput: ${{ steps.get-workflow-param.outputs.workflowInput }} moduleTestFilePaths: ${{ steps.get-module-test-file-paths.outputs.moduleTestFilePaths }} + modulePath: '${{ env.modulePath }}' - ######################### - # Static validation # - ######################### - job_module_static_validation: - runs-on: ubuntu-20.04 - name: 'Static validation' - if: (fromJson(needs.job_initialize_pipeline.outputs.workflowInput)).staticValidation == 'true' - needs: - - job_initialize_pipeline - steps: - - name: 'Checkout' - uses: actions/checkout@v3 - with: - fetch-depth: 0 - - name: Set environment variables - uses: ./.github/actions/templates/setEnvironmentVariables - with: - variablesPath: ${{ env.variablesPath }} - - name: 'Run tests' - uses: ./.github/actions/templates/validateModulePester - with: - modulePath: '${{ env.modulePath }}' - moduleTestFilePath: '${{ env.moduleTestFilePath }}' - ############################# - # Deployment validation # - ############################# - job_module_deploy_validation: - runs-on: ubuntu-20.04 - name: 'Deploying' - if: | - !cancelled() && - (fromJson(needs.job_initialize_pipeline.outputs.workflowInput)).deploymentValidation == 'true' && - needs.job_module_static_validation.result != 'failure' + ############################## + # Call reusable workflow # + ############################## + call-workflow-passing-data: + name: 'Module' needs: - job_initialize_pipeline - - job_module_static_validation - strategy: - fail-fast: false - matrix: - moduleTestFilePaths: ${{ fromJson(needs.job_initialize_pipeline.outputs.moduleTestFilePaths) }} - steps: - - name: 'Checkout' - uses: actions/checkout@v3 - with: - fetch-depth: 0 - - name: Set environment variables - uses: ./.github/actions/templates/setEnvironmentVariables - with: - variablesPath: ${{ env.variablesPath }} - - name: 'Using test file [${{ matrix.moduleTestFilePaths }}]' - uses: ./.github/actions/templates/validateModuleDeployment - with: - templateFilePath: '${{ env.modulePath }}/${{ matrix.moduleTestFilePaths }}' - location: '${{ env.location }}' - subscriptionId: '${{ secrets.ARM_SUBSCRIPTION_ID }}' - managementGroupId: '${{ secrets.ARM_MGMTGROUP_ID }}' - removeDeployment: '${{ (fromJson(needs.job_initialize_pipeline.outputs.workflowInput)).removeDeployment }}' - - ################## - # Publishing # - ################## - job_publish_module: - name: 'Publishing' - if: github.ref == 'refs/heads/main' || github.ref == 'refs/heads/master' || github.event.inputs.prerelease == 'true' - runs-on: ubuntu-20.04 - needs: - - job_module_deploy_validation - steps: - - name: 'Checkout' - uses: actions/checkout@v3 - with: - fetch-depth: 0 - - name: Set environment variables - uses: ./.github/actions/templates/setEnvironmentVariables - with: - variablesPath: ${{ env.variablesPath }} - - name: 'Publishing' - uses: ./.github/actions/templates/publishModule - with: - templateFilePath: '${{ env.modulePath }}/deploy.bicep' - templateSpecsRGName: '${{ env.templateSpecsRGName }}' - templateSpecsRGLocation: '${{ env.templateSpecsRGLocation }}' - templateSpecsDescription: '${{ env.templateSpecsDescription }}' - templateSpecsDoPublish: '${{ env.templateSpecsDoPublish }}' - bicepRegistryName: '${{ env.bicepRegistryName }}' - bicepRegistryRGName: '${{ env.bicepRegistryRGName }}' - bicepRegistryRgLocation: '${{ env.bicepRegistryRgLocation }}' - bicepRegistryDoPublish: '${{ env.bicepRegistryDoPublish }}' - publishLatest: '${{ env.publishLatest }}' + uses: ./.github/workflows/template.module.yml + with: + workflowInput: '${{ needs.job_initialize_pipeline.outputs.workflowInput }}' + moduleTestFilePaths: '${{ needs.job_initialize_pipeline.outputs.moduleTestFilePaths }}' + modulePath: '${{ needs.job_initialize_pipeline.outputs.modulePath}}' + secrets: inherit diff --git a/.github/workflows/ms.signalrservice.signalr.yml b/.github/workflows/ms.signalrservice.signalr.yml index 1fb08056dc..457fe3c88c 100644 --- a/.github/workflows/ms.signalrservice.signalr.yml +++ b/.github/workflows/ms.signalrservice.signalr.yml @@ -1,4 +1,4 @@ -name: 'SignalR Service: SignalR' +name: 'SignalRService - SignalR' on: workflow_dispatch: @@ -28,6 +28,7 @@ on: - main paths: - '.github/actions/templates/**' + - '.github/workflows/template.module.yml' - '.github/workflows/ms.signalrservice.signalr.yml' - 'modules/Microsoft.SignalRService/signalR/**' - 'utilities/pipelines/**' @@ -35,14 +36,8 @@ on: - '!*/**/readme.md' env: - variablesPath: 'settings.yml' modulePath: 'modules/Microsoft.SignalRService/signalR' workflowPath: '.github/workflows/ms.signalrservice.signalr.yml' - AZURE_CREDENTIALS: ${{ secrets.AZURE_CREDENTIALS }} - ARM_SUBSCRIPTION_ID: '${{ secrets.ARM_SUBSCRIPTION_ID }}' - ARM_MGMTGROUP_ID: '${{ secrets.ARM_MGMTGROUP_ID }}' - ARM_TENANT_ID: '${{ secrets.ARM_TENANT_ID }}' - TOKEN_NAMEPREFIX: '${{ secrets.TOKEN_NAMEPREFIX }}' concurrency: group: ${{ github.workflow }} @@ -72,94 +67,19 @@ jobs: outputs: workflowInput: ${{ steps.get-workflow-param.outputs.workflowInput }} moduleTestFilePaths: ${{ steps.get-module-test-file-paths.outputs.moduleTestFilePaths }} + modulePath: '${{ env.modulePath }}' - ######################### - # Static validation # - ######################### - job_module_static_validation: - runs-on: ubuntu-20.04 - name: 'Static validation' - if: (fromJson(needs.job_initialize_pipeline.outputs.workflowInput)).staticValidation == 'true' - needs: - - job_initialize_pipeline - steps: - - name: 'Checkout' - uses: actions/checkout@v3 - with: - fetch-depth: 0 - - name: Set environment variables - uses: ./.github/actions/templates/setEnvironmentVariables - with: - variablesPath: ${{ env.variablesPath }} - - name: 'Run tests' - uses: ./.github/actions/templates/validateModulePester - with: - modulePath: '${{ env.modulePath }}' - moduleTestFilePath: '${{ env.moduleTestFilePath }}' - ############################# - # Deployment validation # - ############################# - job_module_deploy_validation: - runs-on: ubuntu-20.04 - name: 'Deploying' - if: | - !cancelled() && - (fromJson(needs.job_initialize_pipeline.outputs.workflowInput)).deploymentValidation == 'true' && - needs.job_module_static_validation.result != 'failure' + ############################## + # Call reusable workflow # + ############################## + call-workflow-passing-data: + name: 'Module' needs: - job_initialize_pipeline - - job_module_static_validation - strategy: - fail-fast: false - matrix: - moduleTestFilePaths: ${{ fromJson(needs.job_initialize_pipeline.outputs.moduleTestFilePaths) }} - steps: - - name: 'Checkout' - uses: actions/checkout@v3 - with: - fetch-depth: 0 - - name: Set environment variables - uses: ./.github/actions/templates/setEnvironmentVariables - with: - variablesPath: ${{ env.variablesPath }} - - name: 'Using test file [${{ matrix.moduleTestFilePaths }}]' - uses: ./.github/actions/templates/validateModuleDeployment - with: - templateFilePath: '${{ env.modulePath }}/${{ matrix.moduleTestFilePaths }}' - location: '${{ env.location }}' - subscriptionId: '${{ secrets.ARM_SUBSCRIPTION_ID }}' - managementGroupId: '${{ secrets.ARM_MGMTGROUP_ID }}' - removeDeployment: '${{ (fromJson(needs.job_initialize_pipeline.outputs.workflowInput)).removeDeployment }}' - - ################## - # Publishing # - ################## - job_publish_module: - name: 'Publishing' - if: github.ref == 'refs/heads/main' || github.ref == 'refs/heads/master' || github.event.inputs.prerelease == 'true' - runs-on: ubuntu-20.04 - needs: - - job_module_deploy_validation - steps: - - name: 'Checkout' - uses: actions/checkout@v3 - with: - fetch-depth: 0 - - name: Set environment variables - uses: ./.github/actions/templates/setEnvironmentVariables - with: - variablesPath: ${{ env.variablesPath }} - - name: 'Publishing' - uses: ./.github/actions/templates/publishModule - with: - templateFilePath: '${{ env.modulePath }}/deploy.bicep' - templateSpecsRGName: '${{ env.templateSpecsRGName }}' - templateSpecsRGLocation: '${{ env.templateSpecsRGLocation }}' - templateSpecsDescription: '${{ env.templateSpecsDescription }}' - templateSpecsDoPublish: '${{ env.templateSpecsDoPublish }}' - bicepRegistryName: '${{ env.bicepRegistryName }}' - bicepRegistryRGName: '${{ env.bicepRegistryRGName }}' - bicepRegistryRgLocation: '${{ env.bicepRegistryRgLocation }}' - bicepRegistryDoPublish: '${{ env.bicepRegistryDoPublish }}' - publishLatest: '${{ env.publishLatest }}' + uses: ./.github/workflows/template.module.yml + with: + workflowInput: '${{ needs.job_initialize_pipeline.outputs.workflowInput }}' + moduleTestFilePaths: '${{ needs.job_initialize_pipeline.outputs.moduleTestFilePaths }}' + modulePath: '${{ needs.job_initialize_pipeline.outputs.modulePath}}' + secrets: inherit diff --git a/.github/workflows/ms.signalrservice.webpubsub.yml b/.github/workflows/ms.signalrservice.webpubsub.yml index a7a38a73dd..703eda1e6c 100644 --- a/.github/workflows/ms.signalrservice.webpubsub.yml +++ b/.github/workflows/ms.signalrservice.webpubsub.yml @@ -1,4 +1,4 @@ -name: 'SignalR Service: Web PubSub' +name: 'SignalRService - WebPubSub' on: workflow_dispatch: @@ -28,6 +28,7 @@ on: - main paths: - '.github/actions/templates/**' + - '.github/workflows/template.module.yml' - '.github/workflows/ms.signalrservice.webpubsub.yml' - 'modules/Microsoft.SignalRService/webPubSub/**' - 'utilities/pipelines/**' @@ -35,14 +36,8 @@ on: - '!*/**/readme.md' env: - variablesPath: 'settings.yml' modulePath: 'modules/Microsoft.SignalRService/webPubSub' workflowPath: '.github/workflows/ms.signalrservice.webpubsub.yml' - AZURE_CREDENTIALS: ${{ secrets.AZURE_CREDENTIALS }} - ARM_SUBSCRIPTION_ID: '${{ secrets.ARM_SUBSCRIPTION_ID }}' - ARM_MGMTGROUP_ID: '${{ secrets.ARM_MGMTGROUP_ID }}' - ARM_TENANT_ID: '${{ secrets.ARM_TENANT_ID }}' - TOKEN_NAMEPREFIX: '${{ secrets.TOKEN_NAMEPREFIX }}' concurrency: group: ${{ github.workflow }} @@ -72,94 +67,19 @@ jobs: outputs: workflowInput: ${{ steps.get-workflow-param.outputs.workflowInput }} moduleTestFilePaths: ${{ steps.get-module-test-file-paths.outputs.moduleTestFilePaths }} + modulePath: '${{ env.modulePath }}' - ######################### - # Static validation # - ######################### - job_module_static_validation: - runs-on: ubuntu-20.04 - name: 'Static validation' - if: (fromJson(needs.job_initialize_pipeline.outputs.workflowInput)).staticValidation == 'true' - needs: - - job_initialize_pipeline - steps: - - name: 'Checkout' - uses: actions/checkout@v3 - with: - fetch-depth: 0 - - name: Set environment variables - uses: ./.github/actions/templates/setEnvironmentVariables - with: - variablesPath: ${{ env.variablesPath }} - - name: 'Run tests' - uses: ./.github/actions/templates/validateModulePester - with: - modulePath: '${{ env.modulePath }}' - moduleTestFilePath: '${{ env.moduleTestFilePath }}' - ############################# - # Deployment validation # - ############################# - job_module_deploy_validation: - runs-on: ubuntu-20.04 - name: 'Deploying' - if: | - !cancelled() && - (fromJson(needs.job_initialize_pipeline.outputs.workflowInput)).deploymentValidation == 'true' && - needs.job_module_static_validation.result != 'failure' + ############################## + # Call reusable workflow # + ############################## + call-workflow-passing-data: + name: 'Module' needs: - job_initialize_pipeline - - job_module_static_validation - strategy: - fail-fast: false - matrix: - moduleTestFilePaths: ${{ fromJson(needs.job_initialize_pipeline.outputs.moduleTestFilePaths) }} - steps: - - name: 'Checkout' - uses: actions/checkout@v3 - with: - fetch-depth: 0 - - name: Set environment variables - uses: ./.github/actions/templates/setEnvironmentVariables - with: - variablesPath: ${{ env.variablesPath }} - - name: 'Using test file [${{ matrix.moduleTestFilePaths }}]' - uses: ./.github/actions/templates/validateModuleDeployment - with: - templateFilePath: '${{ env.modulePath }}/${{ matrix.moduleTestFilePaths }}' - location: '${{ env.location }}' - subscriptionId: '${{ secrets.ARM_SUBSCRIPTION_ID }}' - managementGroupId: '${{ secrets.ARM_MGMTGROUP_ID }}' - removeDeployment: '${{ (fromJson(needs.job_initialize_pipeline.outputs.workflowInput)).removeDeployment }}' - - ################## - # Publishing # - ################## - job_publish_module: - name: 'Publishing' - if: github.ref == 'refs/heads/main' || github.ref == 'refs/heads/master' || github.event.inputs.prerelease == 'true' - runs-on: ubuntu-20.04 - needs: - - job_module_deploy_validation - steps: - - name: 'Checkout' - uses: actions/checkout@v3 - with: - fetch-depth: 0 - - name: Set environment variables - uses: ./.github/actions/templates/setEnvironmentVariables - with: - variablesPath: ${{ env.variablesPath }} - - name: 'Publishing' - uses: ./.github/actions/templates/publishModule - with: - templateFilePath: '${{ env.modulePath }}/deploy.bicep' - templateSpecsRGName: '${{ env.templateSpecsRGName }}' - templateSpecsRGLocation: '${{ env.templateSpecsRGLocation }}' - templateSpecsDescription: '${{ env.templateSpecsDescription }}' - templateSpecsDoPublish: '${{ env.templateSpecsDoPublish }}' - bicepRegistryName: '${{ env.bicepRegistryName }}' - bicepRegistryRGName: '${{ env.bicepRegistryRGName }}' - bicepRegistryRgLocation: '${{ env.bicepRegistryRgLocation }}' - bicepRegistryDoPublish: '${{ env.bicepRegistryDoPublish }}' - publishLatest: '${{ env.publishLatest }}' + uses: ./.github/workflows/template.module.yml + with: + workflowInput: '${{ needs.job_initialize_pipeline.outputs.workflowInput }}' + moduleTestFilePaths: '${{ needs.job_initialize_pipeline.outputs.moduleTestFilePaths }}' + modulePath: '${{ needs.job_initialize_pipeline.outputs.modulePath}}' + secrets: inherit diff --git a/.github/workflows/ms.sql.managedinstances.yml b/.github/workflows/ms.sql.managedinstances.yml index 4cba242018..7d35dbf658 100644 --- a/.github/workflows/ms.sql.managedinstances.yml +++ b/.github/workflows/ms.sql.managedinstances.yml @@ -1,4 +1,4 @@ -name: 'Sql: ManagedInstances' +name: 'Sql - ManagedInstances' on: workflow_dispatch: @@ -28,6 +28,7 @@ on: - main paths: - '.github/actions/templates/**' + - '.github/workflows/template.module.yml' - '.github/workflows/ms.sql.managedinstances.yml' - 'modules/Microsoft.Sql/managedInstances/**' - 'utilities/pipelines/**' @@ -35,14 +36,8 @@ on: - '!*/**/readme.md' env: - variablesPath: 'settings.yml' modulePath: 'modules/Microsoft.Sql/managedInstances' workflowPath: '.github/workflows/ms.sql.managedinstances.yml' - AZURE_CREDENTIALS: ${{ secrets.AZURE_CREDENTIALS }} - ARM_SUBSCRIPTION_ID: '${{ secrets.ARM_SUBSCRIPTION_ID }}' - ARM_MGMTGROUP_ID: '${{ secrets.ARM_MGMTGROUP_ID }}' - ARM_TENANT_ID: '${{ secrets.ARM_TENANT_ID }}' - TOKEN_NAMEPREFIX: '${{ secrets.TOKEN_NAMEPREFIX }}' concurrency: group: ${{ github.workflow }} @@ -72,94 +67,19 @@ jobs: outputs: workflowInput: ${{ steps.get-workflow-param.outputs.workflowInput }} moduleTestFilePaths: ${{ steps.get-module-test-file-paths.outputs.moduleTestFilePaths }} + modulePath: '${{ env.modulePath }}' - ######################### - # Static validation # - ######################### - job_module_static_validation: - runs-on: ubuntu-20.04 - name: 'Static validation' - if: (fromJson(needs.job_initialize_pipeline.outputs.workflowInput)).staticValidation == 'true' - needs: - - job_initialize_pipeline - steps: - - name: 'Checkout' - uses: actions/checkout@v3 - with: - fetch-depth: 0 - - name: Set environment variables - uses: ./.github/actions/templates/setEnvironmentVariables - with: - variablesPath: ${{ env.variablesPath }} - - name: 'Run tests' - uses: ./.github/actions/templates/validateModulePester - with: - modulePath: '${{ env.modulePath }}' - moduleTestFilePath: '${{ env.moduleTestFilePath }}' - ############################# - # Deployment validation # - ############################# - job_module_deploy_validation: - runs-on: ubuntu-20.04 - name: 'Deploying' - if: | - !cancelled() && - (fromJson(needs.job_initialize_pipeline.outputs.workflowInput)).deploymentValidation == 'true' && - needs.job_module_static_validation.result != 'failure' + ############################## + # Call reusable workflow # + ############################## + call-workflow-passing-data: + name: 'Module' needs: - job_initialize_pipeline - - job_module_static_validation - strategy: - fail-fast: false - matrix: - moduleTestFilePaths: ${{ fromJson(needs.job_initialize_pipeline.outputs.moduleTestFilePaths) }} - steps: - - name: 'Checkout' - uses: actions/checkout@v3 - with: - fetch-depth: 0 - - name: Set environment variables - uses: ./.github/actions/templates/setEnvironmentVariables - with: - variablesPath: ${{ env.variablesPath }} - - name: 'Using test file [${{ matrix.moduleTestFilePaths }}]' - uses: ./.github/actions/templates/validateModuleDeployment - with: - templateFilePath: '${{ env.modulePath }}/${{ matrix.moduleTestFilePaths }}' - location: '${{ env.location }}' - subscriptionId: '${{ secrets.ARM_SUBSCRIPTION_ID }}' - managementGroupId: '${{ secrets.ARM_MGMTGROUP_ID }}' - removeDeployment: '${{ (fromJson(needs.job_initialize_pipeline.outputs.workflowInput)).removeDeployment }}' - - ################## - # Publishing # - ################## - job_publish_module: - name: 'Publishing' - if: github.ref == 'refs/heads/main' || github.ref == 'refs/heads/master' || github.event.inputs.prerelease == 'true' - runs-on: ubuntu-20.04 - needs: - - job_module_deploy_validation - steps: - - name: 'Checkout' - uses: actions/checkout@v3 - with: - fetch-depth: 0 - - name: Set environment variables - uses: ./.github/actions/templates/setEnvironmentVariables - with: - variablesPath: ${{ env.variablesPath }} - - name: 'Publishing' - uses: ./.github/actions/templates/publishModule - with: - templateFilePath: '${{ env.modulePath }}/deploy.bicep' - templateSpecsRGName: '${{ env.templateSpecsRGName }}' - templateSpecsRGLocation: '${{ env.templateSpecsRGLocation }}' - templateSpecsDescription: '${{ env.templateSpecsDescription }}' - templateSpecsDoPublish: '${{ env.templateSpecsDoPublish }}' - bicepRegistryName: '${{ env.bicepRegistryName }}' - bicepRegistryRGName: '${{ env.bicepRegistryRGName }}' - bicepRegistryRgLocation: '${{ env.bicepRegistryRgLocation }}' - bicepRegistryDoPublish: '${{ env.bicepRegistryDoPublish }}' - publishLatest: '${{ env.publishLatest }}' + uses: ./.github/workflows/template.module.yml + with: + workflowInput: '${{ needs.job_initialize_pipeline.outputs.workflowInput }}' + moduleTestFilePaths: '${{ needs.job_initialize_pipeline.outputs.moduleTestFilePaths }}' + modulePath: '${{ needs.job_initialize_pipeline.outputs.modulePath}}' + secrets: inherit diff --git a/.github/workflows/ms.sql.servers.yml b/.github/workflows/ms.sql.servers.yml index ad6f66192c..1f7f78c574 100644 --- a/.github/workflows/ms.sql.servers.yml +++ b/.github/workflows/ms.sql.servers.yml @@ -1,4 +1,4 @@ -name: 'Sql: Servers' +name: 'Sql - Servers' on: workflow_dispatch: @@ -28,6 +28,7 @@ on: - main paths: - '.github/actions/templates/**' + - '.github/workflows/template.module.yml' - '.github/workflows/ms.sql.servers.yml' - 'modules/Microsoft.Sql/servers/**' - 'utilities/pipelines/**' @@ -35,14 +36,8 @@ on: - '!*/**/readme.md' env: - variablesPath: 'settings.yml' modulePath: 'modules/Microsoft.Sql/servers' workflowPath: '.github/workflows/ms.sql.servers.yml' - AZURE_CREDENTIALS: ${{ secrets.AZURE_CREDENTIALS }} - ARM_SUBSCRIPTION_ID: '${{ secrets.ARM_SUBSCRIPTION_ID }}' - ARM_MGMTGROUP_ID: '${{ secrets.ARM_MGMTGROUP_ID }}' - ARM_TENANT_ID: '${{ secrets.ARM_TENANT_ID }}' - TOKEN_NAMEPREFIX: '${{ secrets.TOKEN_NAMEPREFIX }}' concurrency: group: ${{ github.workflow }} @@ -72,94 +67,19 @@ jobs: outputs: workflowInput: ${{ steps.get-workflow-param.outputs.workflowInput }} moduleTestFilePaths: ${{ steps.get-module-test-file-paths.outputs.moduleTestFilePaths }} + modulePath: '${{ env.modulePath }}' - ######################### - # Static validation # - ######################### - job_module_static_validation: - runs-on: ubuntu-20.04 - name: 'Static validation' - if: (fromJson(needs.job_initialize_pipeline.outputs.workflowInput)).staticValidation == 'true' - needs: - - job_initialize_pipeline - steps: - - name: 'Checkout' - uses: actions/checkout@v3 - with: - fetch-depth: 0 - - name: Set environment variables - uses: ./.github/actions/templates/setEnvironmentVariables - with: - variablesPath: ${{ env.variablesPath }} - - name: 'Run tests' - uses: ./.github/actions/templates/validateModulePester - with: - modulePath: '${{ env.modulePath }}' - moduleTestFilePath: '${{ env.moduleTestFilePath }}' - ############################# - # Deployment validation # - ############################# - job_module_deploy_validation: - runs-on: ubuntu-20.04 - name: 'Deploying' - if: | - !cancelled() && - (fromJson(needs.job_initialize_pipeline.outputs.workflowInput)).deploymentValidation == 'true' && - needs.job_module_static_validation.result != 'failure' + ############################## + # Call reusable workflow # + ############################## + call-workflow-passing-data: + name: 'Module' needs: - job_initialize_pipeline - - job_module_static_validation - strategy: - fail-fast: false - matrix: - moduleTestFilePaths: ${{ fromJson(needs.job_initialize_pipeline.outputs.moduleTestFilePaths) }} - steps: - - name: 'Checkout' - uses: actions/checkout@v3 - with: - fetch-depth: 0 - - name: Set environment variables - uses: ./.github/actions/templates/setEnvironmentVariables - with: - variablesPath: ${{ env.variablesPath }} - - name: 'Using test file [${{ matrix.moduleTestFilePaths }}]' - uses: ./.github/actions/templates/validateModuleDeployment - with: - templateFilePath: '${{ env.modulePath }}/${{ matrix.moduleTestFilePaths }}' - location: '${{ env.location }}' - subscriptionId: '${{ secrets.ARM_SUBSCRIPTION_ID }}' - managementGroupId: '${{ secrets.ARM_MGMTGROUP_ID }}' - removeDeployment: '${{ (fromJson(needs.job_initialize_pipeline.outputs.workflowInput)).removeDeployment }}' - - ################## - # Publishing # - ################## - job_publish_module: - name: 'Publishing' - if: github.ref == 'refs/heads/main' || github.ref == 'refs/heads/master' || github.event.inputs.prerelease == 'true' - runs-on: ubuntu-20.04 - needs: - - job_module_deploy_validation - steps: - - name: 'Checkout' - uses: actions/checkout@v3 - with: - fetch-depth: 0 - - name: Set environment variables - uses: ./.github/actions/templates/setEnvironmentVariables - with: - variablesPath: ${{ env.variablesPath }} - - name: 'Publishing' - uses: ./.github/actions/templates/publishModule - with: - templateFilePath: '${{ env.modulePath }}/deploy.bicep' - templateSpecsRGName: '${{ env.templateSpecsRGName }}' - templateSpecsRGLocation: '${{ env.templateSpecsRGLocation }}' - templateSpecsDescription: '${{ env.templateSpecsDescription }}' - templateSpecsDoPublish: '${{ env.templateSpecsDoPublish }}' - bicepRegistryName: '${{ env.bicepRegistryName }}' - bicepRegistryRGName: '${{ env.bicepRegistryRGName }}' - bicepRegistryRgLocation: '${{ env.bicepRegistryRgLocation }}' - bicepRegistryDoPublish: '${{ env.bicepRegistryDoPublish }}' - publishLatest: '${{ env.publishLatest }}' + uses: ./.github/workflows/template.module.yml + with: + workflowInput: '${{ needs.job_initialize_pipeline.outputs.workflowInput }}' + moduleTestFilePaths: '${{ needs.job_initialize_pipeline.outputs.moduleTestFilePaths }}' + modulePath: '${{ needs.job_initialize_pipeline.outputs.modulePath}}' + secrets: inherit diff --git a/.github/workflows/ms.storage.storageaccounts.yml b/.github/workflows/ms.storage.storageaccounts.yml index bac6d238cf..fa6088f8be 100644 --- a/.github/workflows/ms.storage.storageaccounts.yml +++ b/.github/workflows/ms.storage.storageaccounts.yml @@ -1,4 +1,4 @@ -name: 'Storage: StorageAccounts' +name: 'Storage - StorageAccounts' on: workflow_dispatch: @@ -28,6 +28,7 @@ on: - main paths: - '.github/actions/templates/**' + - '.github/workflows/template.module.yml' - '.github/workflows/ms.storage.storageaccounts.yml' - 'modules/Microsoft.Storage/storageAccounts/**' - 'utilities/pipelines/**' @@ -35,14 +36,8 @@ on: - '!*/**/readme.md' env: - variablesPath: 'settings.yml' modulePath: 'modules/Microsoft.Storage/storageAccounts' workflowPath: '.github/workflows/ms.storage.storageaccounts.yml' - AZURE_CREDENTIALS: ${{ secrets.AZURE_CREDENTIALS }} - ARM_SUBSCRIPTION_ID: '${{ secrets.ARM_SUBSCRIPTION_ID }}' - ARM_MGMTGROUP_ID: '${{ secrets.ARM_MGMTGROUP_ID }}' - ARM_TENANT_ID: '${{ secrets.ARM_TENANT_ID }}' - TOKEN_NAMEPREFIX: '${{ secrets.TOKEN_NAMEPREFIX }}' concurrency: group: ${{ github.workflow }} @@ -72,94 +67,19 @@ jobs: outputs: workflowInput: ${{ steps.get-workflow-param.outputs.workflowInput }} moduleTestFilePaths: ${{ steps.get-module-test-file-paths.outputs.moduleTestFilePaths }} + modulePath: '${{ env.modulePath }}' - ######################### - # Static validation # - ######################### - job_module_static_validation: - runs-on: ubuntu-20.04 - name: 'Static validation' - if: (fromJson(needs.job_initialize_pipeline.outputs.workflowInput)).staticValidation == 'true' - needs: - - job_initialize_pipeline - steps: - - name: 'Checkout' - uses: actions/checkout@v3 - with: - fetch-depth: 0 - - name: Set environment variables - uses: ./.github/actions/templates/setEnvironmentVariables - with: - variablesPath: ${{ env.variablesPath }} - - name: 'Run tests' - uses: ./.github/actions/templates/validateModulePester - with: - modulePath: '${{ env.modulePath }}' - moduleTestFilePath: '${{ env.moduleTestFilePath }}' - ############################# - # Deployment validation # - ############################# - job_module_deploy_validation: - runs-on: ubuntu-20.04 - name: 'Deploying' - if: | - !cancelled() && - (fromJson(needs.job_initialize_pipeline.outputs.workflowInput)).deploymentValidation == 'true' && - needs.job_module_static_validation.result != 'failure' + ############################## + # Call reusable workflow # + ############################## + call-workflow-passing-data: + name: 'Module' needs: - job_initialize_pipeline - - job_module_static_validation - strategy: - fail-fast: false - matrix: - moduleTestFilePaths: ${{ fromJson(needs.job_initialize_pipeline.outputs.moduleTestFilePaths) }} - steps: - - name: 'Checkout' - uses: actions/checkout@v3 - with: - fetch-depth: 0 - - name: Set environment variables - uses: ./.github/actions/templates/setEnvironmentVariables - with: - variablesPath: ${{ env.variablesPath }} - - name: 'Using test file [${{ matrix.moduleTestFilePaths }}]' - uses: ./.github/actions/templates/validateModuleDeployment - with: - templateFilePath: '${{ env.modulePath }}/${{ matrix.moduleTestFilePaths }}' - location: '${{ env.location }}' - subscriptionId: '${{ secrets.ARM_SUBSCRIPTION_ID }}' - managementGroupId: '${{ secrets.ARM_MGMTGROUP_ID }}' - removeDeployment: '${{ (fromJson(needs.job_initialize_pipeline.outputs.workflowInput)).removeDeployment }}' - - ################## - # Publishing # - ################## - job_publish_module: - name: 'Publishing' - if: github.ref == 'refs/heads/main' || github.ref == 'refs/heads/master' || github.event.inputs.prerelease == 'true' - runs-on: ubuntu-20.04 - needs: - - job_module_deploy_validation - steps: - - name: 'Checkout' - uses: actions/checkout@v3 - with: - fetch-depth: 0 - - name: Set environment variables - uses: ./.github/actions/templates/setEnvironmentVariables - with: - variablesPath: ${{ env.variablesPath }} - - name: 'Publishing' - uses: ./.github/actions/templates/publishModule - with: - templateFilePath: '${{ env.modulePath }}/deploy.bicep' - templateSpecsRGName: '${{ env.templateSpecsRGName }}' - templateSpecsRGLocation: '${{ env.templateSpecsRGLocation }}' - templateSpecsDescription: '${{ env.templateSpecsDescription }}' - templateSpecsDoPublish: '${{ env.templateSpecsDoPublish }}' - bicepRegistryName: '${{ env.bicepRegistryName }}' - bicepRegistryRGName: '${{ env.bicepRegistryRGName }}' - bicepRegistryRgLocation: '${{ env.bicepRegistryRgLocation }}' - bicepRegistryDoPublish: '${{ env.bicepRegistryDoPublish }}' - publishLatest: '${{ env.publishLatest }}' + uses: ./.github/workflows/template.module.yml + with: + workflowInput: '${{ needs.job_initialize_pipeline.outputs.workflowInput }}' + moduleTestFilePaths: '${{ needs.job_initialize_pipeline.outputs.moduleTestFilePaths }}' + modulePath: '${{ needs.job_initialize_pipeline.outputs.modulePath}}' + secrets: inherit diff --git a/.github/workflows/ms.synapse.privatelinkhubs.yml b/.github/workflows/ms.synapse.privatelinkhubs.yml index 0ee79da690..0518700a58 100644 --- a/.github/workflows/ms.synapse.privatelinkhubs.yml +++ b/.github/workflows/ms.synapse.privatelinkhubs.yml @@ -1,4 +1,4 @@ -name: 'Synapse: PrivateLinkHubs' +name: 'Synapse - PrivateLinkHubs' on: workflow_dispatch: @@ -28,6 +28,7 @@ on: - main paths: - '.github/actions/templates/**' + - '.github/workflows/template.module.yml' - '.github/workflows/ms.synapse.privatelinkhubs.yml' - 'modules/Microsoft.Synapse/privateLinkHubs/**' - 'utilities/pipelines/**' @@ -35,14 +36,8 @@ on: - '!*/**/readme.md' env: - variablesPath: 'settings.yml' modulePath: 'modules/Microsoft.Synapse/privateLinkHubs' workflowPath: '.github/workflows/ms.synapse.privatelinkhubs.yml' - AZURE_CREDENTIALS: ${{ secrets.AZURE_CREDENTIALS }} - ARM_SUBSCRIPTION_ID: '${{ secrets.ARM_SUBSCRIPTION_ID }}' - ARM_MGMTGROUP_ID: '${{ secrets.ARM_MGMTGROUP_ID }}' - ARM_TENANT_ID: '${{ secrets.ARM_TENANT_ID }}' - TOKEN_NAMEPREFIX: '${{ secrets.TOKEN_NAMEPREFIX }}' concurrency: group: ${{ github.workflow }} @@ -72,94 +67,19 @@ jobs: outputs: workflowInput: ${{ steps.get-workflow-param.outputs.workflowInput }} moduleTestFilePaths: ${{ steps.get-module-test-file-paths.outputs.moduleTestFilePaths }} + modulePath: '${{ env.modulePath }}' - ######################### - # Static validation # - ######################### - job_module_static_validation: - runs-on: ubuntu-20.04 - name: 'Static validation' - if: (fromJson(needs.job_initialize_pipeline.outputs.workflowInput)).staticValidation == 'true' - needs: - - job_initialize_pipeline - steps: - - name: 'Checkout' - uses: actions/checkout@v3 - with: - fetch-depth: 0 - - name: Set environment variables - uses: ./.github/actions/templates/setEnvironmentVariables - with: - variablesPath: ${{ env.variablesPath }} - - name: 'Run tests' - uses: ./.github/actions/templates/validateModulePester - with: - modulePath: '${{ env.modulePath }}' - moduleTestFilePath: '${{ env.moduleTestFilePath }}' - ############################# - # Deployment validation # - ############################# - job_module_deploy_validation: - runs-on: ubuntu-20.04 - name: 'Deploying' - if: | - !cancelled() && - (fromJson(needs.job_initialize_pipeline.outputs.workflowInput)).deploymentValidation == 'true' && - needs.job_module_static_validation.result != 'failure' + ############################## + # Call reusable workflow # + ############################## + call-workflow-passing-data: + name: 'Module' needs: - job_initialize_pipeline - - job_module_static_validation - strategy: - fail-fast: false - matrix: - moduleTestFilePaths: ${{ fromJson(needs.job_initialize_pipeline.outputs.moduleTestFilePaths) }} - steps: - - name: 'Checkout' - uses: actions/checkout@v3 - with: - fetch-depth: 0 - - name: Set environment variables - uses: ./.github/actions/templates/setEnvironmentVariables - with: - variablesPath: ${{ env.variablesPath }} - - name: 'Using test file [${{ matrix.moduleTestFilePaths }}]' - uses: ./.github/actions/templates/validateModuleDeployment - with: - templateFilePath: '${{ env.modulePath }}/${{ matrix.moduleTestFilePaths }}' - location: '${{ env.location }}' - subscriptionId: '${{ secrets.ARM_SUBSCRIPTION_ID }}' - managementGroupId: '${{ secrets.ARM_MGMTGROUP_ID }}' - removeDeployment: '${{ (fromJson(needs.job_initialize_pipeline.outputs.workflowInput)).removeDeployment }}' - - ################## - # Publishing # - ################## - job_publish_module: - name: 'Publishing' - if: github.ref == 'refs/heads/main' || github.ref == 'refs/heads/master' || github.event.inputs.prerelease == 'true' - runs-on: ubuntu-20.04 - needs: - - job_module_deploy_validation - steps: - - name: 'Checkout' - uses: actions/checkout@v3 - with: - fetch-depth: 0 - - name: Set environment variables - uses: ./.github/actions/templates/setEnvironmentVariables - with: - variablesPath: ${{ env.variablesPath }} - - name: 'Publishing' - uses: ./.github/actions/templates/publishModule - with: - templateFilePath: '${{ env.modulePath }}/deploy.bicep' - templateSpecsRGName: '${{ env.templateSpecsRGName }}' - templateSpecsRGLocation: '${{ env.templateSpecsRGLocation }}' - templateSpecsDescription: '${{ env.templateSpecsDescription }}' - templateSpecsDoPublish: '${{ env.templateSpecsDoPublish }}' - bicepRegistryName: '${{ env.bicepRegistryName }}' - bicepRegistryRGName: '${{ env.bicepRegistryRGName }}' - bicepRegistryRgLocation: '${{ env.bicepRegistryRgLocation }}' - bicepRegistryDoPublish: '${{ env.bicepRegistryDoPublish }}' - publishLatest: '${{ env.publishLatest }}' + uses: ./.github/workflows/template.module.yml + with: + workflowInput: '${{ needs.job_initialize_pipeline.outputs.workflowInput }}' + moduleTestFilePaths: '${{ needs.job_initialize_pipeline.outputs.moduleTestFilePaths }}' + modulePath: '${{ needs.job_initialize_pipeline.outputs.modulePath}}' + secrets: inherit diff --git a/.github/workflows/ms.synapse.workspaces.yml b/.github/workflows/ms.synapse.workspaces.yml index 712ea1b5e0..f108d85f5b 100644 --- a/.github/workflows/ms.synapse.workspaces.yml +++ b/.github/workflows/ms.synapse.workspaces.yml @@ -1,4 +1,4 @@ -name: 'Synapse: Workspaces' +name: 'Synapse - Workspaces' on: workflow_dispatch: @@ -28,6 +28,7 @@ on: - main paths: - '.github/actions/templates/**' + - '.github/workflows/template.module.yml' - '.github/workflows/ms.synapse.workspaces.yml' - 'modules/Microsoft.Synapse/workspaces/**' - 'utilities/pipelines/**' @@ -35,14 +36,8 @@ on: - '!*/**/readme.md' env: - variablesPath: 'settings.yml' modulePath: 'modules/Microsoft.Synapse/workspaces' workflowPath: '.github/workflows/ms.synapse.workspaces.yml' - AZURE_CREDENTIALS: ${{ secrets.AZURE_CREDENTIALS }} - ARM_SUBSCRIPTION_ID: '${{ secrets.ARM_SUBSCRIPTION_ID }}' - ARM_MGMTGROUP_ID: '${{ secrets.ARM_MGMTGROUP_ID }}' - ARM_TENANT_ID: '${{ secrets.ARM_TENANT_ID }}' - TOKEN_NAMEPREFIX: '${{ secrets.TOKEN_NAMEPREFIX }}' concurrency: group: ${{ github.workflow }} @@ -72,94 +67,19 @@ jobs: outputs: workflowInput: ${{ steps.get-workflow-param.outputs.workflowInput }} moduleTestFilePaths: ${{ steps.get-module-test-file-paths.outputs.moduleTestFilePaths }} + modulePath: '${{ env.modulePath }}' - ######################### - # Static validation # - ######################### - job_module_static_validation: - runs-on: ubuntu-20.04 - name: 'Static validation' - if: (fromJson(needs.job_initialize_pipeline.outputs.workflowInput)).staticValidation == 'true' - needs: - - job_initialize_pipeline - steps: - - name: 'Checkout' - uses: actions/checkout@v3 - with: - fetch-depth: 0 - - name: Set environment variables - uses: ./.github/actions/templates/setEnvironmentVariables - with: - variablesPath: ${{ env.variablesPath }} - - name: 'Run tests' - uses: ./.github/actions/templates/validateModulePester - with: - modulePath: '${{ env.modulePath }}' - moduleTestFilePath: '${{ env.moduleTestFilePath }}' - ############################# - # Deployment validation # - ############################# - job_module_deploy_validation: - runs-on: ubuntu-20.04 - name: 'Deploying' - if: | - !cancelled() && - (fromJson(needs.job_initialize_pipeline.outputs.workflowInput)).deploymentValidation == 'true' && - needs.job_module_static_validation.result != 'failure' + ############################## + # Call reusable workflow # + ############################## + call-workflow-passing-data: + name: 'Module' needs: - job_initialize_pipeline - - job_module_static_validation - strategy: - fail-fast: false - matrix: - moduleTestFilePaths: ${{ fromJson(needs.job_initialize_pipeline.outputs.moduleTestFilePaths) }} - steps: - - name: 'Checkout' - uses: actions/checkout@v3 - with: - fetch-depth: 0 - - name: Set environment variables - uses: ./.github/actions/templates/setEnvironmentVariables - with: - variablesPath: ${{ env.variablesPath }} - - name: 'Using test file [${{ matrix.moduleTestFilePaths }}]' - uses: ./.github/actions/templates/validateModuleDeployment - with: - templateFilePath: '${{ env.modulePath }}/${{ matrix.moduleTestFilePaths }}' - location: '${{ env.location }}' - subscriptionId: '${{ secrets.ARM_SUBSCRIPTION_ID }}' - managementGroupId: '${{ secrets.ARM_MGMTGROUP_ID }}' - removeDeployment: '${{ (fromJson(needs.job_initialize_pipeline.outputs.workflowInput)).removeDeployment }}' - - ################## - # Publishing # - ################## - job_publish_module: - name: 'Publishing' - if: github.ref == 'refs/heads/main' || github.ref == 'refs/heads/master' || github.event.inputs.prerelease == 'true' - runs-on: ubuntu-20.04 - needs: - - job_module_deploy_validation - steps: - - name: 'Checkout' - uses: actions/checkout@v3 - with: - fetch-depth: 0 - - name: Set environment variables - uses: ./.github/actions/templates/setEnvironmentVariables - with: - variablesPath: ${{ env.variablesPath }} - - name: 'Publishing' - uses: ./.github/actions/templates/publishModule - with: - templateFilePath: '${{ env.modulePath }}/deploy.bicep' - templateSpecsRGName: '${{ env.templateSpecsRGName }}' - templateSpecsRGLocation: '${{ env.templateSpecsRGLocation }}' - templateSpecsDescription: '${{ env.templateSpecsDescription }}' - templateSpecsDoPublish: '${{ env.templateSpecsDoPublish }}' - bicepRegistryName: '${{ env.bicepRegistryName }}' - bicepRegistryRGName: '${{ env.bicepRegistryRGName }}' - bicepRegistryRgLocation: '${{ env.bicepRegistryRgLocation }}' - bicepRegistryDoPublish: '${{ env.bicepRegistryDoPublish }}' - publishLatest: '${{ env.publishLatest }}' + uses: ./.github/workflows/template.module.yml + with: + workflowInput: '${{ needs.job_initialize_pipeline.outputs.workflowInput }}' + moduleTestFilePaths: '${{ needs.job_initialize_pipeline.outputs.moduleTestFilePaths }}' + modulePath: '${{ needs.job_initialize_pipeline.outputs.modulePath}}' + secrets: inherit diff --git a/.github/workflows/ms.virtualmachineimages.imagetemplates.yml b/.github/workflows/ms.virtualmachineimages.imagetemplates.yml index 421c5758ac..1f20706eb0 100644 --- a/.github/workflows/ms.virtualmachineimages.imagetemplates.yml +++ b/.github/workflows/ms.virtualmachineimages.imagetemplates.yml @@ -1,4 +1,4 @@ -name: 'VirtualMachineImages: ImageTemplates' +name: 'VirtualMachineImages - ImageTemplates' on: workflow_dispatch: @@ -28,6 +28,7 @@ on: - main paths: - '.github/actions/templates/**' + - '.github/workflows/template.module.yml' - '.github/workflows/ms.virtualmachineimages.imagetemplates.yml' - 'modules/Microsoft.VirtualMachineImages/imageTemplates/**' - 'utilities/pipelines/**' @@ -35,14 +36,8 @@ on: - '!*/**/readme.md' env: - variablesPath: 'settings.yml' modulePath: 'modules/Microsoft.VirtualMachineImages/imageTemplates' workflowPath: '.github/workflows/ms.virtualmachineimages.imagetemplates.yml' - AZURE_CREDENTIALS: ${{ secrets.AZURE_CREDENTIALS }} - ARM_SUBSCRIPTION_ID: '${{ secrets.ARM_SUBSCRIPTION_ID }}' - ARM_MGMTGROUP_ID: '${{ secrets.ARM_MGMTGROUP_ID }}' - ARM_TENANT_ID: '${{ secrets.ARM_TENANT_ID }}' - TOKEN_NAMEPREFIX: '${{ secrets.TOKEN_NAMEPREFIX }}' concurrency: group: ${{ github.workflow }} @@ -72,94 +67,19 @@ jobs: outputs: workflowInput: ${{ steps.get-workflow-param.outputs.workflowInput }} moduleTestFilePaths: ${{ steps.get-module-test-file-paths.outputs.moduleTestFilePaths }} + modulePath: '${{ env.modulePath }}' - ######################### - # Static validation # - ######################### - job_module_static_validation: - runs-on: ubuntu-20.04 - name: 'Static validation' - if: (fromJson(needs.job_initialize_pipeline.outputs.workflowInput)).staticValidation == 'true' - needs: - - job_initialize_pipeline - steps: - - name: 'Checkout' - uses: actions/checkout@v3 - with: - fetch-depth: 0 - - name: Set environment variables - uses: ./.github/actions/templates/setEnvironmentVariables - with: - variablesPath: ${{ env.variablesPath }} - - name: 'Run tests' - uses: ./.github/actions/templates/validateModulePester - with: - modulePath: '${{ env.modulePath }}' - moduleTestFilePath: '${{ env.moduleTestFilePath }}' - ############################# - # Deployment validation # - ############################# - job_module_deploy_validation: - runs-on: ubuntu-20.04 - name: 'Deploying' - if: | - !cancelled() && - (fromJson(needs.job_initialize_pipeline.outputs.workflowInput)).deploymentValidation == 'true' && - needs.job_module_static_validation.result != 'failure' + ############################## + # Call reusable workflow # + ############################## + call-workflow-passing-data: + name: 'Module' needs: - job_initialize_pipeline - - job_module_static_validation - strategy: - fail-fast: false - matrix: - moduleTestFilePaths: ${{ fromJson(needs.job_initialize_pipeline.outputs.moduleTestFilePaths) }} - steps: - - name: 'Checkout' - uses: actions/checkout@v3 - with: - fetch-depth: 0 - - name: Set environment variables - uses: ./.github/actions/templates/setEnvironmentVariables - with: - variablesPath: ${{ env.variablesPath }} - - name: 'Using test file [${{ matrix.moduleTestFilePaths }}]' - uses: ./.github/actions/templates/validateModuleDeployment - with: - templateFilePath: '${{ env.modulePath }}/${{ matrix.moduleTestFilePaths }}' - location: '${{ env.location }}' - subscriptionId: '${{ secrets.ARM_SUBSCRIPTION_ID }}' - managementGroupId: '${{ secrets.ARM_MGMTGROUP_ID }}' - removeDeployment: '${{ (fromJson(needs.job_initialize_pipeline.outputs.workflowInput)).removeDeployment }}' - - ################## - # Publishing # - ################## - job_publish_module: - name: 'Publishing' - if: github.ref == 'refs/heads/main' || github.ref == 'refs/heads/master' || github.event.inputs.prerelease == 'true' - runs-on: ubuntu-20.04 - needs: - - job_module_deploy_validation - steps: - - name: 'Checkout' - uses: actions/checkout@v3 - with: - fetch-depth: 0 - - name: Set environment variables - uses: ./.github/actions/templates/setEnvironmentVariables - with: - variablesPath: ${{ env.variablesPath }} - - name: 'Publishing' - uses: ./.github/actions/templates/publishModule - with: - templateFilePath: '${{ env.modulePath }}/deploy.bicep' - templateSpecsRGName: '${{ env.templateSpecsRGName }}' - templateSpecsRGLocation: '${{ env.templateSpecsRGLocation }}' - templateSpecsDescription: '${{ env.templateSpecsDescription }}' - templateSpecsDoPublish: '${{ env.templateSpecsDoPublish }}' - bicepRegistryName: '${{ env.bicepRegistryName }}' - bicepRegistryRGName: '${{ env.bicepRegistryRGName }}' - bicepRegistryRgLocation: '${{ env.bicepRegistryRgLocation }}' - bicepRegistryDoPublish: '${{ env.bicepRegistryDoPublish }}' - publishLatest: '${{ env.publishLatest }}' + uses: ./.github/workflows/template.module.yml + with: + workflowInput: '${{ needs.job_initialize_pipeline.outputs.workflowInput }}' + moduleTestFilePaths: '${{ needs.job_initialize_pipeline.outputs.moduleTestFilePaths }}' + modulePath: '${{ needs.job_initialize_pipeline.outputs.modulePath}}' + secrets: inherit diff --git a/.github/workflows/ms.web.connections.yml b/.github/workflows/ms.web.connections.yml index ed686f80cd..20414836fe 100644 --- a/.github/workflows/ms.web.connections.yml +++ b/.github/workflows/ms.web.connections.yml @@ -1,4 +1,4 @@ -name: 'Web: Connections' +name: 'Web - Connections' on: workflow_dispatch: @@ -28,6 +28,7 @@ on: - main paths: - '.github/actions/templates/**' + - '.github/workflows/template.module.yml' - '.github/workflows/ms.web.connections.yml' - 'modules/Microsoft.Web/connections/**' - 'utilities/pipelines/**' @@ -35,14 +36,8 @@ on: - '!*/**/readme.md' env: - variablesPath: 'settings.yml' modulePath: 'modules/Microsoft.Web/connections' workflowPath: '.github/workflows/ms.web.connections.yml' - AZURE_CREDENTIALS: ${{ secrets.AZURE_CREDENTIALS }} - ARM_SUBSCRIPTION_ID: '${{ secrets.ARM_SUBSCRIPTION_ID }}' - ARM_MGMTGROUP_ID: '${{ secrets.ARM_MGMTGROUP_ID }}' - ARM_TENANT_ID: '${{ secrets.ARM_TENANT_ID }}' - TOKEN_NAMEPREFIX: '${{ secrets.TOKEN_NAMEPREFIX }}' concurrency: group: ${{ github.workflow }} @@ -72,94 +67,19 @@ jobs: outputs: workflowInput: ${{ steps.get-workflow-param.outputs.workflowInput }} moduleTestFilePaths: ${{ steps.get-module-test-file-paths.outputs.moduleTestFilePaths }} + modulePath: '${{ env.modulePath }}' - ######################### - # Static validation # - ######################### - job_module_static_validation: - runs-on: ubuntu-20.04 - name: 'Static validation' - if: (fromJson(needs.job_initialize_pipeline.outputs.workflowInput)).staticValidation == 'true' - needs: - - job_initialize_pipeline - steps: - - name: 'Checkout' - uses: actions/checkout@v3 - with: - fetch-depth: 0 - - name: Set environment variables - uses: ./.github/actions/templates/setEnvironmentVariables - with: - variablesPath: ${{ env.variablesPath }} - - name: 'Run tests' - uses: ./.github/actions/templates/validateModulePester - with: - modulePath: '${{ env.modulePath }}' - moduleTestFilePath: '${{ env.moduleTestFilePath }}' - ############################# - # Deployment validation # - ############################# - job_module_deploy_validation: - runs-on: ubuntu-20.04 - name: 'Deploying' - if: | - !cancelled() && - (fromJson(needs.job_initialize_pipeline.outputs.workflowInput)).deploymentValidation == 'true' && - needs.job_module_static_validation.result != 'failure' + ############################## + # Call reusable workflow # + ############################## + call-workflow-passing-data: + name: 'Module' needs: - job_initialize_pipeline - - job_module_static_validation - strategy: - fail-fast: false - matrix: - moduleTestFilePaths: ${{ fromJson(needs.job_initialize_pipeline.outputs.moduleTestFilePaths) }} - steps: - - name: 'Checkout' - uses: actions/checkout@v3 - with: - fetch-depth: 0 - - name: Set environment variables - uses: ./.github/actions/templates/setEnvironmentVariables - with: - variablesPath: ${{ env.variablesPath }} - - name: 'Using test file [${{ matrix.moduleTestFilePaths }}]' - uses: ./.github/actions/templates/validateModuleDeployment - with: - templateFilePath: '${{ env.modulePath }}/${{ matrix.moduleTestFilePaths }}' - location: '${{ env.location }}' - subscriptionId: '${{ secrets.ARM_SUBSCRIPTION_ID }}' - managementGroupId: '${{ secrets.ARM_MGMTGROUP_ID }}' - removeDeployment: '${{ (fromJson(needs.job_initialize_pipeline.outputs.workflowInput)).removeDeployment }}' - - ################## - # Publishing # - ################## - job_publish_module: - name: 'Publishing' - if: github.ref == 'refs/heads/main' || github.ref == 'refs/heads/master' || github.event.inputs.prerelease == 'true' - runs-on: ubuntu-20.04 - needs: - - job_module_deploy_validation - steps: - - name: 'Checkout' - uses: actions/checkout@v3 - with: - fetch-depth: 0 - - name: Set environment variables - uses: ./.github/actions/templates/setEnvironmentVariables - with: - variablesPath: ${{ env.variablesPath }} - - name: 'Publishing' - uses: ./.github/actions/templates/publishModule - with: - templateFilePath: '${{ env.modulePath }}/deploy.bicep' - templateSpecsRGName: '${{ env.templateSpecsRGName }}' - templateSpecsRGLocation: '${{ env.templateSpecsRGLocation }}' - templateSpecsDescription: '${{ env.templateSpecsDescription }}' - templateSpecsDoPublish: '${{ env.templateSpecsDoPublish }}' - bicepRegistryName: '${{ env.bicepRegistryName }}' - bicepRegistryRGName: '${{ env.bicepRegistryRGName }}' - bicepRegistryRgLocation: '${{ env.bicepRegistryRgLocation }}' - bicepRegistryDoPublish: '${{ env.bicepRegistryDoPublish }}' - publishLatest: '${{ env.publishLatest }}' + uses: ./.github/workflows/template.module.yml + with: + workflowInput: '${{ needs.job_initialize_pipeline.outputs.workflowInput }}' + moduleTestFilePaths: '${{ needs.job_initialize_pipeline.outputs.moduleTestFilePaths }}' + modulePath: '${{ needs.job_initialize_pipeline.outputs.modulePath}}' + secrets: inherit diff --git a/.github/workflows/ms.web.hostingenvironments.yml b/.github/workflows/ms.web.hostingenvironments.yml index fb6f58bad0..91004edd9d 100644 --- a/.github/workflows/ms.web.hostingenvironments.yml +++ b/.github/workflows/ms.web.hostingenvironments.yml @@ -1,4 +1,4 @@ -name: 'Web: HostingEnvironments' +name: 'Web - HostingEnvironments' on: workflow_dispatch: @@ -28,6 +28,7 @@ on: - main paths: - '.github/actions/templates/**' + - '.github/workflows/template.module.yml' - '.github/workflows/ms.web.hostingenvironments.yml' - 'modules/Microsoft.Web/hostingEnvironments/**' - 'utilities/pipelines/**' @@ -35,14 +36,8 @@ on: - '!*/**/readme.md' env: - variablesPath: 'settings.yml' modulePath: 'modules/Microsoft.Web/hostingEnvironments' workflowPath: '.github/workflows/ms.web.hostingenvironments.yml' - AZURE_CREDENTIALS: ${{ secrets.AZURE_CREDENTIALS }} - ARM_SUBSCRIPTION_ID: '${{ secrets.ARM_SUBSCRIPTION_ID }}' - ARM_MGMTGROUP_ID: '${{ secrets.ARM_MGMTGROUP_ID }}' - ARM_TENANT_ID: '${{ secrets.ARM_TENANT_ID }}' - TOKEN_NAMEPREFIX: '${{ secrets.TOKEN_NAMEPREFIX }}' concurrency: group: ${{ github.workflow }} @@ -72,94 +67,19 @@ jobs: outputs: workflowInput: ${{ steps.get-workflow-param.outputs.workflowInput }} moduleTestFilePaths: ${{ steps.get-module-test-file-paths.outputs.moduleTestFilePaths }} + modulePath: '${{ env.modulePath }}' - ######################### - # Static validation # - ######################### - job_module_static_validation: - runs-on: ubuntu-20.04 - name: 'Static validation' - if: (fromJson(needs.job_initialize_pipeline.outputs.workflowInput)).staticValidation == 'true' - needs: - - job_initialize_pipeline - steps: - - name: 'Checkout' - uses: actions/checkout@v3 - with: - fetch-depth: 0 - - name: Set environment variables - uses: ./.github/actions/templates/setEnvironmentVariables - with: - variablesPath: ${{ env.variablesPath }} - - name: 'Run tests' - uses: ./.github/actions/templates/validateModulePester - with: - modulePath: '${{ env.modulePath }}' - moduleTestFilePath: '${{ env.moduleTestFilePath }}' - ############################# - # Deployment validation # - ############################# - job_module_deploy_validation: - runs-on: ubuntu-20.04 - name: 'Deploying' - if: | - !cancelled() && - (fromJson(needs.job_initialize_pipeline.outputs.workflowInput)).deploymentValidation == 'true' && - needs.job_module_static_validation.result != 'failure' + ############################## + # Call reusable workflow # + ############################## + call-workflow-passing-data: + name: 'Module' needs: - job_initialize_pipeline - - job_module_static_validation - strategy: - fail-fast: false - matrix: - moduleTestFilePaths: ${{ fromJson(needs.job_initialize_pipeline.outputs.moduleTestFilePaths) }} - steps: - - name: 'Checkout' - uses: actions/checkout@v3 - with: - fetch-depth: 0 - - name: Set environment variables - uses: ./.github/actions/templates/setEnvironmentVariables - with: - variablesPath: ${{ env.variablesPath }} - - name: 'Using test file [${{ matrix.moduleTestFilePaths }}]' - uses: ./.github/actions/templates/validateModuleDeployment - with: - templateFilePath: '${{ env.modulePath }}/${{ matrix.moduleTestFilePaths }}' - location: '${{ env.location }}' - subscriptionId: '${{ secrets.ARM_SUBSCRIPTION_ID }}' - managementGroupId: '${{ secrets.ARM_MGMTGROUP_ID }}' - removeDeployment: '${{ (fromJson(needs.job_initialize_pipeline.outputs.workflowInput)).removeDeployment }}' - - ################## - # Publishing # - ################## - job_publish_module: - name: 'Publishing' - if: github.ref == 'refs/heads/main' || github.ref == 'refs/heads/master' || github.event.inputs.prerelease == 'true' - runs-on: ubuntu-20.04 - needs: - - job_module_deploy_validation - steps: - - name: 'Checkout' - uses: actions/checkout@v3 - with: - fetch-depth: 0 - - name: Set environment variables - uses: ./.github/actions/templates/setEnvironmentVariables - with: - variablesPath: ${{ env.variablesPath }} - - name: 'Publishing' - uses: ./.github/actions/templates/publishModule - with: - templateFilePath: '${{ env.modulePath }}/deploy.bicep' - templateSpecsRGName: '${{ env.templateSpecsRGName }}' - templateSpecsRGLocation: '${{ env.templateSpecsRGLocation }}' - templateSpecsDescription: '${{ env.templateSpecsDescription }}' - templateSpecsDoPublish: '${{ env.templateSpecsDoPublish }}' - bicepRegistryName: '${{ env.bicepRegistryName }}' - bicepRegistryRGName: '${{ env.bicepRegistryRGName }}' - bicepRegistryRgLocation: '${{ env.bicepRegistryRgLocation }}' - bicepRegistryDoPublish: '${{ env.bicepRegistryDoPublish }}' - publishLatest: '${{ env.publishLatest }}' + uses: ./.github/workflows/template.module.yml + with: + workflowInput: '${{ needs.job_initialize_pipeline.outputs.workflowInput }}' + moduleTestFilePaths: '${{ needs.job_initialize_pipeline.outputs.moduleTestFilePaths }}' + modulePath: '${{ needs.job_initialize_pipeline.outputs.modulePath}}' + secrets: inherit diff --git a/.github/workflows/ms.web.serverfarms.yml b/.github/workflows/ms.web.serverfarms.yml index 172ca3d7ff..957b71d138 100644 --- a/.github/workflows/ms.web.serverfarms.yml +++ b/.github/workflows/ms.web.serverfarms.yml @@ -1,4 +1,4 @@ -name: 'Web: Serverfarms' +name: 'Web - Serverfarms' on: workflow_dispatch: @@ -28,6 +28,7 @@ on: - main paths: - '.github/actions/templates/**' + - '.github/workflows/template.module.yml' - '.github/workflows/ms.web.serverfarms.yml' - 'modules/Microsoft.Web/serverfarms/**' - 'utilities/pipelines/**' @@ -35,14 +36,8 @@ on: - '!*/**/readme.md' env: - variablesPath: 'settings.yml' modulePath: 'modules/Microsoft.Web/serverfarms' workflowPath: '.github/workflows/ms.web.serverfarms.yml' - AZURE_CREDENTIALS: ${{ secrets.AZURE_CREDENTIALS }} - ARM_SUBSCRIPTION_ID: '${{ secrets.ARM_SUBSCRIPTION_ID }}' - ARM_MGMTGROUP_ID: '${{ secrets.ARM_MGMTGROUP_ID }}' - ARM_TENANT_ID: '${{ secrets.ARM_TENANT_ID }}' - TOKEN_NAMEPREFIX: '${{ secrets.TOKEN_NAMEPREFIX }}' concurrency: group: ${{ github.workflow }} @@ -72,94 +67,19 @@ jobs: outputs: workflowInput: ${{ steps.get-workflow-param.outputs.workflowInput }} moduleTestFilePaths: ${{ steps.get-module-test-file-paths.outputs.moduleTestFilePaths }} + modulePath: '${{ env.modulePath }}' - ######################### - # Static validation # - ######################### - job_module_static_validation: - runs-on: ubuntu-20.04 - name: 'Static validation' - if: (fromJson(needs.job_initialize_pipeline.outputs.workflowInput)).staticValidation == 'true' - needs: - - job_initialize_pipeline - steps: - - name: 'Checkout' - uses: actions/checkout@v3 - with: - fetch-depth: 0 - - name: Set environment variables - uses: ./.github/actions/templates/setEnvironmentVariables - with: - variablesPath: ${{ env.variablesPath }} - - name: 'Run tests' - uses: ./.github/actions/templates/validateModulePester - with: - modulePath: '${{ env.modulePath }}' - moduleTestFilePath: '${{ env.moduleTestFilePath }}' - ############################# - # Deployment validation # - ############################# - job_module_deploy_validation: - runs-on: ubuntu-20.04 - name: 'Deploying' - if: | - !cancelled() && - (fromJson(needs.job_initialize_pipeline.outputs.workflowInput)).deploymentValidation == 'true' && - needs.job_module_static_validation.result != 'failure' + ############################## + # Call reusable workflow # + ############################## + call-workflow-passing-data: + name: 'Module' needs: - job_initialize_pipeline - - job_module_static_validation - strategy: - fail-fast: false - matrix: - moduleTestFilePaths: ${{ fromJson(needs.job_initialize_pipeline.outputs.moduleTestFilePaths) }} - steps: - - name: 'Checkout' - uses: actions/checkout@v3 - with: - fetch-depth: 0 - - name: Set environment variables - uses: ./.github/actions/templates/setEnvironmentVariables - with: - variablesPath: ${{ env.variablesPath }} - - name: 'Using test file [${{ matrix.moduleTestFilePaths }}]' - uses: ./.github/actions/templates/validateModuleDeployment - with: - templateFilePath: '${{ env.modulePath }}/${{ matrix.moduleTestFilePaths }}' - location: '${{ env.location }}' - subscriptionId: '${{ secrets.ARM_SUBSCRIPTION_ID }}' - managementGroupId: '${{ secrets.ARM_MGMTGROUP_ID }}' - removeDeployment: '${{ (fromJson(needs.job_initialize_pipeline.outputs.workflowInput)).removeDeployment }}' - - ################## - # Publishing # - ################## - job_publish_module: - name: 'Publishing' - if: github.ref == 'refs/heads/main' || github.ref == 'refs/heads/master' || github.event.inputs.prerelease == 'true' - runs-on: ubuntu-20.04 - needs: - - job_module_deploy_validation - steps: - - name: 'Checkout' - uses: actions/checkout@v3 - with: - fetch-depth: 0 - - name: Set environment variables - uses: ./.github/actions/templates/setEnvironmentVariables - with: - variablesPath: ${{ env.variablesPath }} - - name: 'Publishing' - uses: ./.github/actions/templates/publishModule - with: - templateFilePath: '${{ env.modulePath }}/deploy.bicep' - templateSpecsRGName: '${{ env.templateSpecsRGName }}' - templateSpecsRGLocation: '${{ env.templateSpecsRGLocation }}' - templateSpecsDescription: '${{ env.templateSpecsDescription }}' - templateSpecsDoPublish: '${{ env.templateSpecsDoPublish }}' - bicepRegistryName: '${{ env.bicepRegistryName }}' - bicepRegistryRGName: '${{ env.bicepRegistryRGName }}' - bicepRegistryRgLocation: '${{ env.bicepRegistryRgLocation }}' - bicepRegistryDoPublish: '${{ env.bicepRegistryDoPublish }}' - publishLatest: '${{ env.publishLatest }}' + uses: ./.github/workflows/template.module.yml + with: + workflowInput: '${{ needs.job_initialize_pipeline.outputs.workflowInput }}' + moduleTestFilePaths: '${{ needs.job_initialize_pipeline.outputs.moduleTestFilePaths }}' + modulePath: '${{ needs.job_initialize_pipeline.outputs.modulePath}}' + secrets: inherit diff --git a/.github/workflows/ms.web.sites.yml b/.github/workflows/ms.web.sites.yml index d287f9db8c..0705aa9f32 100644 --- a/.github/workflows/ms.web.sites.yml +++ b/.github/workflows/ms.web.sites.yml @@ -1,4 +1,4 @@ -name: 'Web: Sites' +name: 'Web - Sites' on: workflow_dispatch: @@ -28,6 +28,7 @@ on: - main paths: - '.github/actions/templates/**' + - '.github/workflows/template.module.yml' - '.github/workflows/ms.web.sites.yml' - 'modules/Microsoft.Web/sites/**' - 'utilities/pipelines/**' @@ -35,14 +36,8 @@ on: - '!*/**/readme.md' env: - variablesPath: 'settings.yml' modulePath: 'modules/Microsoft.Web/sites' workflowPath: '.github/workflows/ms.web.sites.yml' - AZURE_CREDENTIALS: ${{ secrets.AZURE_CREDENTIALS }} - ARM_SUBSCRIPTION_ID: '${{ secrets.ARM_SUBSCRIPTION_ID }}' - ARM_MGMTGROUP_ID: '${{ secrets.ARM_MGMTGROUP_ID }}' - ARM_TENANT_ID: '${{ secrets.ARM_TENANT_ID }}' - TOKEN_NAMEPREFIX: '${{ secrets.TOKEN_NAMEPREFIX }}' concurrency: group: ${{ github.workflow }} @@ -72,94 +67,19 @@ jobs: outputs: workflowInput: ${{ steps.get-workflow-param.outputs.workflowInput }} moduleTestFilePaths: ${{ steps.get-module-test-file-paths.outputs.moduleTestFilePaths }} + modulePath: '${{ env.modulePath }}' - ######################### - # Static validation # - ######################### - job_module_static_validation: - runs-on: ubuntu-20.04 - name: 'Static validation' - if: (fromJson(needs.job_initialize_pipeline.outputs.workflowInput)).staticValidation == 'true' - needs: - - job_initialize_pipeline - steps: - - name: 'Checkout' - uses: actions/checkout@v3 - with: - fetch-depth: 0 - - name: Set environment variables - uses: ./.github/actions/templates/setEnvironmentVariables - with: - variablesPath: ${{ env.variablesPath }} - - name: 'Run tests' - uses: ./.github/actions/templates/validateModulePester - with: - modulePath: '${{ env.modulePath }}' - moduleTestFilePath: '${{ env.moduleTestFilePath }}' - ############################# - # Deployment validation # - ############################# - job_module_deploy_validation: - runs-on: ubuntu-20.04 - name: 'Deploying' - if: | - !cancelled() && - (fromJson(needs.job_initialize_pipeline.outputs.workflowInput)).deploymentValidation == 'true' && - needs.job_module_static_validation.result != 'failure' + ############################## + # Call reusable workflow # + ############################## + call-workflow-passing-data: + name: 'Module' needs: - job_initialize_pipeline - - job_module_static_validation - strategy: - fail-fast: false - matrix: - moduleTestFilePaths: ${{ fromJson(needs.job_initialize_pipeline.outputs.moduleTestFilePaths) }} - steps: - - name: 'Checkout' - uses: actions/checkout@v3 - with: - fetch-depth: 0 - - name: Set environment variables - uses: ./.github/actions/templates/setEnvironmentVariables - with: - variablesPath: ${{ env.variablesPath }} - - name: 'Using test file [${{ matrix.moduleTestFilePaths }}]' - uses: ./.github/actions/templates/validateModuleDeployment - with: - templateFilePath: '${{ env.modulePath }}/${{ matrix.moduleTestFilePaths }}' - location: '${{ env.location }}' - subscriptionId: '${{ secrets.ARM_SUBSCRIPTION_ID }}' - managementGroupId: '${{ secrets.ARM_MGMTGROUP_ID }}' - removeDeployment: '${{ (fromJson(needs.job_initialize_pipeline.outputs.workflowInput)).removeDeployment }}' - - ################## - # Publishing # - ################## - job_publish_module: - name: 'Publishing' - if: github.ref == 'refs/heads/main' || github.ref == 'refs/heads/master' || github.event.inputs.prerelease == 'true' - runs-on: ubuntu-20.04 - needs: - - job_module_deploy_validation - steps: - - name: 'Checkout' - uses: actions/checkout@v3 - with: - fetch-depth: 0 - - name: Set environment variables - uses: ./.github/actions/templates/setEnvironmentVariables - with: - variablesPath: ${{ env.variablesPath }} - - name: 'Publishing' - uses: ./.github/actions/templates/publishModule - with: - templateFilePath: '${{ env.modulePath }}/deploy.bicep' - templateSpecsRGName: '${{ env.templateSpecsRGName }}' - templateSpecsRGLocation: '${{ env.templateSpecsRGLocation }}' - templateSpecsDescription: '${{ env.templateSpecsDescription }}' - templateSpecsDoPublish: '${{ env.templateSpecsDoPublish }}' - bicepRegistryName: '${{ env.bicepRegistryName }}' - bicepRegistryRGName: '${{ env.bicepRegistryRGName }}' - bicepRegistryRgLocation: '${{ env.bicepRegistryRgLocation }}' - bicepRegistryDoPublish: '${{ env.bicepRegistryDoPublish }}' - publishLatest: '${{ env.publishLatest }}' + uses: ./.github/workflows/template.module.yml + with: + workflowInput: '${{ needs.job_initialize_pipeline.outputs.workflowInput }}' + moduleTestFilePaths: '${{ needs.job_initialize_pipeline.outputs.moduleTestFilePaths }}' + modulePath: '${{ needs.job_initialize_pipeline.outputs.modulePath}}' + secrets: inherit diff --git a/.github/workflows/ms.web.staticsites.yml b/.github/workflows/ms.web.staticsites.yml index ce332c324a..2dd4edc72c 100644 --- a/.github/workflows/ms.web.staticsites.yml +++ b/.github/workflows/ms.web.staticsites.yml @@ -1,4 +1,4 @@ -name: 'Web: StaticSites' +name: 'Web - StaticSites' on: workflow_dispatch: @@ -28,6 +28,7 @@ on: - main paths: - '.github/actions/templates/**' + - '.github/workflows/template.module.yml' - '.github/workflows/ms.web.staticsites.yml' - 'modules/Microsoft.Web/staticSites/**' - 'utilities/pipelines/**' @@ -35,14 +36,8 @@ on: - '!*/**/readme.md' env: - variablesPath: 'settings.yml' modulePath: 'modules/Microsoft.Web/staticSites' workflowPath: '.github/workflows/ms.web.staticsites.yml' - AZURE_CREDENTIALS: ${{ secrets.AZURE_CREDENTIALS }} - ARM_SUBSCRIPTION_ID: '${{ secrets.ARM_SUBSCRIPTION_ID }}' - ARM_MGMTGROUP_ID: '${{ secrets.ARM_MGMTGROUP_ID }}' - ARM_TENANT_ID: '${{ secrets.ARM_TENANT_ID }}' - TOKEN_NAMEPREFIX: '${{ secrets.TOKEN_NAMEPREFIX }}' concurrency: group: ${{ github.workflow }} @@ -72,94 +67,19 @@ jobs: outputs: workflowInput: ${{ steps.get-workflow-param.outputs.workflowInput }} moduleTestFilePaths: ${{ steps.get-module-test-file-paths.outputs.moduleTestFilePaths }} + modulePath: '${{ env.modulePath }}' - ######################### - # Static validation # - ######################### - job_module_static_validation: - runs-on: ubuntu-20.04 - name: 'Static validation' - if: (fromJson(needs.job_initialize_pipeline.outputs.workflowInput)).staticValidation == 'true' - needs: - - job_initialize_pipeline - steps: - - name: 'Checkout' - uses: actions/checkout@v3 - with: - fetch-depth: 0 - - name: Set environment variables - uses: ./.github/actions/templates/setEnvironmentVariables - with: - variablesPath: ${{ env.variablesPath }} - - name: 'Run tests' - uses: ./.github/actions/templates/validateModulePester - with: - modulePath: '${{ env.modulePath }}' - moduleTestFilePath: '${{ env.moduleTestFilePath }}' - ############################# - # Deployment validation # - ############################# - job_module_deploy_validation: - runs-on: ubuntu-20.04 - name: 'Deploying' - if: | - !cancelled() && - (fromJson(needs.job_initialize_pipeline.outputs.workflowInput)).deploymentValidation == 'true' && - needs.job_module_static_validation.result != 'failure' + ############################## + # Call reusable workflow # + ############################## + call-workflow-passing-data: + name: 'Module' needs: - job_initialize_pipeline - - job_module_static_validation - strategy: - fail-fast: false - matrix: - moduleTestFilePaths: ${{ fromJson(needs.job_initialize_pipeline.outputs.moduleTestFilePaths) }} - steps: - - name: 'Checkout' - uses: actions/checkout@v3 - with: - fetch-depth: 0 - - name: Set environment variables - uses: ./.github/actions/templates/setEnvironmentVariables - with: - variablesPath: ${{ env.variablesPath }} - - name: 'Using test file [${{ matrix.moduleTestFilePaths }}]' - uses: ./.github/actions/templates/validateModuleDeployment - with: - templateFilePath: '${{ env.modulePath }}/${{ matrix.moduleTestFilePaths }}' - location: '${{ env.location }}' - subscriptionId: '${{ secrets.ARM_SUBSCRIPTION_ID }}' - managementGroupId: '${{ secrets.ARM_MGMTGROUP_ID }}' - removeDeployment: '${{ (fromJson(needs.job_initialize_pipeline.outputs.workflowInput)).removeDeployment }}' - - ################## - # Publishing # - ################## - job_publish_module: - name: 'Publishing' - if: github.ref == 'refs/heads/main' || github.ref == 'refs/heads/master' || github.event.inputs.prerelease == 'true' - runs-on: ubuntu-20.04 - needs: - - job_module_deploy_validation - steps: - - name: 'Checkout' - uses: actions/checkout@v3 - with: - fetch-depth: 0 - - name: Set environment variables - uses: ./.github/actions/templates/setEnvironmentVariables - with: - variablesPath: ${{ env.variablesPath }} - - name: 'Publishing' - uses: ./.github/actions/templates/publishModule - with: - templateFilePath: '${{ env.modulePath }}/deploy.bicep' - templateSpecsRGName: '${{ env.templateSpecsRGName }}' - templateSpecsRGLocation: '${{ env.templateSpecsRGLocation }}' - templateSpecsDescription: '${{ env.templateSpecsDescription }}' - templateSpecsDoPublish: '${{ env.templateSpecsDoPublish }}' - bicepRegistryName: '${{ env.bicepRegistryName }}' - bicepRegistryRGName: '${{ env.bicepRegistryRGName }}' - bicepRegistryRgLocation: '${{ env.bicepRegistryRgLocation }}' - bicepRegistryDoPublish: '${{ env.bicepRegistryDoPublish }}' - publishLatest: '${{ env.publishLatest }}' + uses: ./.github/workflows/template.module.yml + with: + workflowInput: '${{ needs.job_initialize_pipeline.outputs.workflowInput }}' + moduleTestFilePaths: '${{ needs.job_initialize_pipeline.outputs.moduleTestFilePaths }}' + modulePath: '${{ needs.job_initialize_pipeline.outputs.modulePath}}' + secrets: inherit diff --git a/.github/workflows/template.module.yml b/.github/workflows/template.module.yml new file mode 100644 index 0000000000..4ed84c4daf --- /dev/null +++ b/.github/workflows/template.module.yml @@ -0,0 +1,114 @@ +name: '.Template - Module Pipeline' + +on: + workflow_call: + inputs: + workflowInput: + type: string + description: 'Input from the workflow caller in JSON format' + required: true + moduleTestFilePaths: + type: string + description: 'List of relative path to the module test files in JSON format' + required: true + modulePath: + type: string + description: 'Relative path to the module folder' + required: true + +env: + variablesPath: 'settings.yml' + AZURE_CREDENTIALS: ${{ secrets.AZURE_CREDENTIALS }} + ARM_SUBSCRIPTION_ID: '${{ secrets.ARM_SUBSCRIPTION_ID }}' + ARM_MGMTGROUP_ID: '${{ secrets.ARM_MGMTGROUP_ID }}' + ARM_TENANT_ID: '${{ secrets.ARM_TENANT_ID }}' + TOKEN_NAMEPREFIX: '${{ secrets.TOKEN_NAMEPREFIX }}' + +jobs: + ######################### + # Static validation # + ######################### + job_module_static_validation: + runs-on: ubuntu-20.04 + name: 'Static validation' + if: (fromJson(inputs.workflowInput)).staticValidation == 'true' + steps: + - name: 'Checkout' + uses: actions/checkout@v3 + with: + fetch-depth: 0 + - name: Set environment variables + uses: ./.github/actions/templates/setEnvironmentVariables + with: + variablesPath: ${{ env.variablesPath }} + - name: 'Run tests' + uses: ./.github/actions/templates/validateModulePester + with: + modulePath: '${{ inputs.modulePath }}' + moduleTestFilePath: '${{ env.moduleTestFilePath }}' + + ############################# + # Deployment validation # + ############################# + job_module_deploy_validation: + runs-on: ubuntu-20.04 + name: 'Deployment validation' + if: | + !cancelled() && + (fromJson(inputs.workflowInput)).deploymentValidation == 'true' && + needs.job_module_static_validation.result != 'failure' + needs: + - job_module_static_validation + strategy: + fail-fast: false + matrix: + moduleTestFilePaths: ${{ fromJson(inputs.moduleTestFilePaths) }} + steps: + - name: 'Checkout' + uses: actions/checkout@v3 + with: + fetch-depth: 0 + - name: Set environment variables + uses: ./.github/actions/templates/setEnvironmentVariables + with: + variablesPath: ${{ env.variablesPath }} + - name: 'Using test file [${{ matrix.moduleTestFilePaths }}]' + uses: ./.github/actions/templates/validateModuleDeployment + with: + templateFilePath: '${{ inputs.modulePath }}/${{ matrix.moduleTestFilePaths }}' + location: '${{ env.location }}' + subscriptionId: '${{ secrets.ARM_SUBSCRIPTION_ID }}' + managementGroupId: '${{ secrets.ARM_MGMTGROUP_ID }}' + removeDeployment: '${{ fromJson(inputs.workflowInput).removeDeployment }}' + + ################## + # Publishing # + ################## + job_publish_module: + name: 'Publishing' + if: github.ref == 'refs/heads/main' || github.ref == 'refs/heads/master' || fromJson(inputs.workflowInput).prerelease == 'true' + runs-on: ubuntu-20.04 + needs: + - job_module_deploy_validation + steps: + - name: 'Checkout' + uses: actions/checkout@v3 + with: + fetch-depth: 0 + - name: Set environment variables + uses: ./.github/actions/templates/setEnvironmentVariables + with: + variablesPath: ${{ env.variablesPath }} + - name: 'Publishing' + uses: ./.github/actions/templates/publishModule + with: + templateFilePath: '${{ inputs.modulePath }}/deploy.bicep' + templateSpecsRGName: '${{ env.templateSpecsRGName }}' + templateSpecsRGLocation: '${{ env.templateSpecsRGLocation }}' + templateSpecsDescription: '${{ env.templateSpecsDescription }}' + templateSpecsDoPublish: '${{ env.templateSpecsDoPublish }}' + bicepRegistryName: '${{ env.bicepRegistryName }}' + bicepRegistryRGName: '${{ env.bicepRegistryRGName }}' + bicepRegistryRgLocation: '${{ env.bicepRegistryRgLocation }}' + bicepRegistryDoPublish: '${{ env.bicepRegistryDoPublish }}' + publishLatest: '${{ env.publishLatest }}'