Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
finnpedersenkazes committed Jul 10, 2024
2 parents 18f783b + 11ebc2e commit 715dd8f
Show file tree
Hide file tree
Showing 5 changed files with 132 additions and 18 deletions.
38 changes: 31 additions & 7 deletions .github/workflows/CICD.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ permissions:
pages: read

env:
workflowDepth: 1
workflowDepth: 2
ALGoOrgSettings: ${{ vars.ALGoOrgSettings }}
ALGoRepoSettings: ${{ vars.ALGoRepoSettings }}

Expand Down Expand Up @@ -141,7 +141,7 @@ jobs:
templateUrl: ${{ env.templateUrl }}
downloadLatest: true

Build:
Build1:
needs: [ Initialization ]
if: (!failure()) && (!cancelled()) && fromJson(needs.Initialization.outputs.buildOrderJson)[0].projectsCount > 0
strategy:
Expand All @@ -165,6 +165,30 @@ jobs:
signArtifacts: true
useArtifactCache: true

Build:
needs: [ Initialization, Build1 ]
if: (!failure()) && (!cancelled()) && (needs.Build1.result == 'success' || needs.Build1.result == 'skipped') && fromJson(needs.Initialization.outputs.buildOrderJson)[1].projectsCount > 0
strategy:
matrix:
include: ${{ fromJson(needs.Initialization.outputs.buildOrderJson)[1].buildDimensions }}
fail-fast: false
name: Build ${{ matrix.projectName }} (${{ matrix.buildMode }})
uses: ./.github/workflows/_BuildALGoProject.yaml
secrets: inherit
with:
shell: ${{ needs.Initialization.outputs.githubRunnerShell }}
runsOn: ${{ needs.Initialization.outputs.githubRunner }}
parentTelemetryScopeJson: ${{ needs.Initialization.outputs.telemetryScopeJson }}
project: ${{ matrix.project }}
projectName: ${{ matrix.projectName }}
buildMode: ${{ matrix.buildMode }}
projectDependenciesJson: ${{ needs.Initialization.outputs.projectDependenciesJson }}
secrets: 'licenseFileUrl,codeSignCertificateUrl,*codeSignCertificatePassword,keyVaultCertificateUrl,*keyVaultCertificatePassword,keyVaultClientId,gitHubPackagesContext,applicationInsightsConnectionString'
publishThisBuildArtifacts: ${{ needs.Initialization.outputs.workflowDepth > 1 }}
publishArtifacts: ${{ github.ref_name == 'main' || startswith(github.ref_name, 'release/') || startswith(github.ref_name, 'releases/') || needs.Initialization.outputs.deliveryTargetsJson != '[]' || needs.Initialization.outputs.environmentCount > 0 }}
signArtifacts: true
useArtifactCache: true

DeployALDoc:
needs: [ Initialization, Build ]
if: (!cancelled()) && needs.Build.result == 'Success' && needs.Initialization.outputs.generateALDocArtifact == 1 && github.ref_name == 'main'
Expand Down Expand Up @@ -213,8 +237,8 @@ jobs:
uses: actions/deploy-pages@v4

Deploy:
needs: [ Initialization, Build ]
if: (!cancelled()) && (needs.Build.result == 'success' || needs.Build.result == 'skipped') && needs.Initialization.outputs.environmentCount > 0
needs: [ Initialization, Build1, Build ]
if: (!cancelled()) && (needs.Build1.result == 'success' || needs.Build1.result == 'skipped') && (needs.Build.result == 'success' || needs.Build.result == 'skipped') && needs.Initialization.outputs.environmentCount > 0
strategy: ${{ fromJson(needs.Initialization.outputs.environmentsMatrixJson) }}
runs-on: ${{ fromJson(matrix.os) }}
name: Deploy to ${{ matrix.environment }}
Expand Down Expand Up @@ -278,8 +302,8 @@ jobs:
deploymentEnvironmentsJson: ${{ needs.Initialization.outputs.deploymentEnvironmentsJson }}

Deliver:
needs: [ Initialization, Build ]
if: (!cancelled()) && (needs.Build.result == 'success' || needs.Build.result == 'skipped') && needs.Initialization.outputs.deliveryTargetsJson != '[]'
needs: [ Initialization, Build1, Build ]
if: (!cancelled()) && (needs.Build1.result == 'success' || needs.Build1.result == 'skipped') && (needs.Build.result == 'success' || needs.Build.result == 'skipped') && needs.Initialization.outputs.deliveryTargetsJson != '[]'
strategy:
matrix:
deliveryTarget: ${{ fromJson(needs.Initialization.outputs.deliveryTargetsJson) }}
Expand Down Expand Up @@ -320,7 +344,7 @@ jobs:
artifacts: '.artifacts'

PostProcess:
needs: [ Initialization, Build, Deploy, Deliver, DeployALDoc ]
needs: [ Initialization, Build1, Build, Deploy, Deliver, DeployALDoc ]
if: (!cancelled())
runs-on: [ windows-latest ]
steps:
Expand Down
28 changes: 25 additions & 3 deletions .github/workflows/Current.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ defaults:
shell: powershell

env:
workflowDepth: 1
workflowDepth: 2
ALGoOrgSettings: ${{ vars.ALGoOrgSettings }}
ALGoRepoSettings: ${{ vars.ALGoRepoSettings }}

Expand Down Expand Up @@ -64,7 +64,7 @@ jobs:
shell: powershell
maxBuildDepth: ${{ env.workflowDepth }}

Build:
Build1:
needs: [ Initialization ]
if: (!failure()) && (!cancelled()) && fromJson(needs.Initialization.outputs.buildOrderJson)[0].projectsCount > 0
strategy:
Expand All @@ -86,8 +86,30 @@ jobs:
publishThisBuildArtifacts: ${{ needs.Initialization.outputs.workflowDepth > 1 }}
artifactsNameSuffix: 'Current'

Build:
needs: [ Initialization, Build1 ]
if: (!failure()) && (!cancelled()) && (needs.Build1.result == 'success' || needs.Build1.result == 'skipped') && fromJson(needs.Initialization.outputs.buildOrderJson)[1].projectsCount > 0
strategy:
matrix:
include: ${{ fromJson(needs.Initialization.outputs.buildOrderJson)[1].buildDimensions }}
fail-fast: false
name: Build ${{ matrix.projectName }} (${{ matrix.buildMode }})
uses: ./.github/workflows/_BuildALGoProject.yaml
secrets: inherit
with:
shell: ${{ needs.Initialization.outputs.githubRunnerShell }}
runsOn: ${{ needs.Initialization.outputs.githubRunner }}
parentTelemetryScopeJson: ${{ needs.Initialization.outputs.telemetryScopeJson }}
project: ${{ matrix.project }}
projectName: ${{ matrix.projectName }}
buildMode: ${{ matrix.buildMode }}
projectDependenciesJson: ${{ needs.Initialization.outputs.projectDependenciesJson }}
secrets: 'licenseFileUrl,codeSignCertificateUrl,*codeSignCertificatePassword,keyVaultCertificateUrl,*keyVaultCertificatePassword,keyVaultClientId,gitHubPackagesContext,applicationInsightsConnectionString'
publishThisBuildArtifacts: ${{ needs.Initialization.outputs.workflowDepth > 1 }}
artifactsNameSuffix: 'Current'

PostProcess:
needs: [ Initialization, Build ]
needs: [ Initialization, Build1, Build ]
if: always()
runs-on: [ windows-latest ]
steps:
Expand Down
28 changes: 25 additions & 3 deletions .github/workflows/NextMajor.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ defaults:
shell: powershell

env:
workflowDepth: 1
workflowDepth: 2
ALGoOrgSettings: ${{ vars.ALGoOrgSettings }}
ALGoRepoSettings: ${{ vars.ALGoRepoSettings }}

Expand Down Expand Up @@ -64,7 +64,7 @@ jobs:
shell: powershell
maxBuildDepth: ${{ env.workflowDepth }}

Build:
Build1:
needs: [ Initialization ]
if: (!failure()) && (!cancelled()) && fromJson(needs.Initialization.outputs.buildOrderJson)[0].projectsCount > 0
strategy:
Expand All @@ -86,8 +86,30 @@ jobs:
publishThisBuildArtifacts: ${{ needs.Initialization.outputs.workflowDepth > 1 }}
artifactsNameSuffix: 'NextMajor'

Build:
needs: [ Initialization, Build1 ]
if: (!failure()) && (!cancelled()) && (needs.Build1.result == 'success' || needs.Build1.result == 'skipped') && fromJson(needs.Initialization.outputs.buildOrderJson)[1].projectsCount > 0
strategy:
matrix:
include: ${{ fromJson(needs.Initialization.outputs.buildOrderJson)[1].buildDimensions }}
fail-fast: false
name: Build ${{ matrix.projectName }} (${{ matrix.buildMode }})
uses: ./.github/workflows/_BuildALGoProject.yaml
secrets: inherit
with:
shell: ${{ needs.Initialization.outputs.githubRunnerShell }}
runsOn: ${{ needs.Initialization.outputs.githubRunner }}
parentTelemetryScopeJson: ${{ needs.Initialization.outputs.telemetryScopeJson }}
project: ${{ matrix.project }}
projectName: ${{ matrix.projectName }}
buildMode: ${{ matrix.buildMode }}
projectDependenciesJson: ${{ needs.Initialization.outputs.projectDependenciesJson }}
secrets: 'licenseFileUrl,codeSignCertificateUrl,*codeSignCertificatePassword,keyVaultCertificateUrl,*keyVaultCertificatePassword,keyVaultClientId,gitHubPackagesContext,applicationInsightsConnectionString'
publishThisBuildArtifacts: ${{ needs.Initialization.outputs.workflowDepth > 1 }}
artifactsNameSuffix: 'NextMajor'

PostProcess:
needs: [ Initialization, Build ]
needs: [ Initialization, Build1, Build ]
if: always()
runs-on: [ windows-latest ]
steps:
Expand Down
28 changes: 25 additions & 3 deletions .github/workflows/NextMinor.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ defaults:
shell: powershell

env:
workflowDepth: 1
workflowDepth: 2
ALGoOrgSettings: ${{ vars.ALGoOrgSettings }}
ALGoRepoSettings: ${{ vars.ALGoRepoSettings }}

Expand Down Expand Up @@ -64,7 +64,7 @@ jobs:
shell: powershell
maxBuildDepth: ${{ env.workflowDepth }}

Build:
Build1:
needs: [ Initialization ]
if: (!failure()) && (!cancelled()) && fromJson(needs.Initialization.outputs.buildOrderJson)[0].projectsCount > 0
strategy:
Expand All @@ -86,8 +86,30 @@ jobs:
publishThisBuildArtifacts: ${{ needs.Initialization.outputs.workflowDepth > 1 }}
artifactsNameSuffix: 'NextMinor'

Build:
needs: [ Initialization, Build1 ]
if: (!failure()) && (!cancelled()) && (needs.Build1.result == 'success' || needs.Build1.result == 'skipped') && fromJson(needs.Initialization.outputs.buildOrderJson)[1].projectsCount > 0
strategy:
matrix:
include: ${{ fromJson(needs.Initialization.outputs.buildOrderJson)[1].buildDimensions }}
fail-fast: false
name: Build ${{ matrix.projectName }} (${{ matrix.buildMode }})
uses: ./.github/workflows/_BuildALGoProject.yaml
secrets: inherit
with:
shell: ${{ needs.Initialization.outputs.githubRunnerShell }}
runsOn: ${{ needs.Initialization.outputs.githubRunner }}
parentTelemetryScopeJson: ${{ needs.Initialization.outputs.telemetryScopeJson }}
project: ${{ matrix.project }}
projectName: ${{ matrix.projectName }}
buildMode: ${{ matrix.buildMode }}
projectDependenciesJson: ${{ needs.Initialization.outputs.projectDependenciesJson }}
secrets: 'licenseFileUrl,codeSignCertificateUrl,*codeSignCertificatePassword,keyVaultCertificateUrl,*keyVaultCertificatePassword,keyVaultClientId,gitHubPackagesContext,applicationInsightsConnectionString'
publishThisBuildArtifacts: ${{ needs.Initialization.outputs.workflowDepth > 1 }}
artifactsNameSuffix: 'NextMinor'

PostProcess:
needs: [ Initialization, Build ]
needs: [ Initialization, Build1, Build ]
if: always()
runs-on: [ windows-latest ]
steps:
Expand Down
28 changes: 26 additions & 2 deletions .github/workflows/PullRequestHandler.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ permissions:
pull-requests: read

env:
workflowDepth: 1
workflowDepth: 2
ALGoOrgSettings: ${{ vars.ALGoOrgSettings }}
ALGoRepoSettings: ${{ vars.ALGoRepoSettings }}

Expand Down Expand Up @@ -79,7 +79,7 @@ jobs:
shell: powershell
maxBuildDepth: ${{ env.workflowDepth }}

Build:
Build1:
needs: [ Initialization ]
if: (!failure()) && (!cancelled()) && fromJson(needs.Initialization.outputs.buildOrderJson)[0].projectsCount > 0
strategy:
Expand All @@ -103,6 +103,30 @@ jobs:
publishThisBuildArtifacts: ${{ needs.Initialization.outputs.workflowDepth > 1 }}
artifactsNameSuffix: 'PR${{ github.event.number }}'

Build:
needs: [ Initialization, Build1 ]
if: (!failure()) && (!cancelled()) && (needs.Build1.result == 'success' || needs.Build1.result == 'skipped') && fromJson(needs.Initialization.outputs.buildOrderJson)[1].projectsCount > 0
strategy:
matrix:
include: ${{ fromJson(needs.Initialization.outputs.buildOrderJson)[1].buildDimensions }}
fail-fast: false
name: Build ${{ matrix.projectName }} (${{ matrix.buildMode }})
uses: ./.github/workflows/_BuildALGoProject.yaml
secrets: inherit
with:
shell: ${{ needs.Initialization.outputs.githubRunnerShell }}
runsOn: ${{ needs.Initialization.outputs.githubRunner }}
checkoutRef: refs/pull/${{ github.event.number }}/merge
parentTelemetryScopeJson: ${{ needs.Initialization.outputs.telemetryScopeJson }}
project: ${{ matrix.project }}
projectName: ${{ matrix.projectName }}
buildMode: ${{ matrix.buildMode }}
projectDependenciesJson: ${{ needs.Initialization.outputs.projectDependenciesJson }}
baselineWorkflowRunId: ${{ needs.Initialization.outputs.baselineWorkflowRunId }}
secrets: 'licenseFileUrl,keyVaultCertificateUrl,*keyVaultCertificatePassword,keyVaultClientId,gitHubPackagesContext,applicationInsightsConnectionString'
publishThisBuildArtifacts: ${{ needs.Initialization.outputs.workflowDepth > 1 }}
artifactsNameSuffix: 'PR${{ github.event.number }}'

StatusCheck:
needs: [ Initialization, Build ]
if: (!cancelled())
Expand Down

0 comments on commit 715dd8f

Please sign in to comment.