-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add new reusable workflow for matrix testing scenarios (#36)
- Loading branch information
1 parent
12d8cde
commit 78a92b4
Showing
7 changed files
with
602 additions
and
73 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,74 @@ | ||
name: ci-matrix | ||
on: | ||
pull_request: | ||
branches: | ||
- main | ||
workflow_dispatch: | ||
inputs: | ||
forcePublish: | ||
description: When true the Publish stage will always be run, otherwise it only runs for tagged versions. | ||
required: false | ||
default: false | ||
type: boolean | ||
skipCleanup: | ||
description: When true the pipeline clean-up stage will not be run. For example, the cache used between pipeline stages will be retained. | ||
required: false | ||
default: false | ||
type: boolean | ||
|
||
concurrency: | ||
group: ${{ github.workflow }}-${{ github.ref }} | ||
cancel-in-progress: true | ||
|
||
permissions: | ||
actions: write # enable cache clean-up | ||
checks: write # enable test result annotations | ||
contents: write # enable creating releases | ||
issues: read | ||
packages: write # enable publishing packages | ||
pull-requests: write # enable test result annotations | ||
|
||
jobs: | ||
prepareConfig: | ||
name: Prepare Configuration | ||
runs-on: ubuntu-latest | ||
outputs: | ||
RESOLVED_ENV_VARS: ${{ steps.prepareEnvVarsAndSecrets.outputs.environmentVariablesYamlBase64 }} | ||
RESOLVED_SECRETS: ${{ steps.prepareEnvVarsAndSecrets.outputs.secretsYamlBase64 }} | ||
steps: | ||
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1 | ||
with: | ||
fetch-depth: 0 | ||
|
||
# Declare any environment variables and/or secrets that need to be available inside the build process | ||
- uses: ./actions/prepare-env-vars-and-secrets | ||
id: prepareEnvVarsAndSecrets | ||
with: | ||
environmentVariablesYaml: | | ||
BUILDVAR_NuGetPublishSource: "${{ startsWith(github.ref, 'refs/tags/') && 'https://api.nuget.org/v3/index.json' || 'https://nuget.pkg.github.com/endjin/index.json' }}" | ||
secretsYaml: | | ||
NUGET_API_KEY: "${{ startsWith(github.ref, 'refs/tags/') && secrets.ENDJIN_NUGET_APIKEY || secrets.ENDJIN_GITHUB_PUBLISHER_PAT }}" | ||
SBOM_ANALYSIS_RELEASE_READER_PAT: "${{ secrets.ENDJIN_GITHUB_READER_PAT }}" | ||
build: | ||
needs: prepareConfig | ||
uses: ./.github/workflows/scripted-build-matrix-pipeline.yml | ||
with: | ||
netSdkVersion: '8.x' | ||
# workflow_dispatch inputs are always strings, the type property is just for the UI | ||
forcePublish: ${{ github.event.inputs.forcePublish == 'true' }} | ||
skipCleanup: ${{ github.event.inputs.skipCleanup == 'true' }} | ||
publishPhaseEnv: ${{ needs.prepareConfig.outputs.RESOLVED_ENV_VARS }} | ||
additionalCachePaths: | | ||
tests | ||
enableCrossOsCaching: true | ||
testPhaseMatrixJson: | | ||
{ | ||
"os": ["ubuntu-latest", "windows-latest"], | ||
"dotnetFramework": ["net8.0"], | ||
"exclude": [] | ||
} | ||
secrets: | ||
compilePhaseAzureCredentials: ${{ secrets.ENDJIN_PROD_ACR_READER_CREDENTIALS }} | ||
compilePhaseSecrets: ${{ needs.prepareConfig.outputs.RESOLVED_SECRETS }} | ||
publishPhaseSecrets: ${{ needs.prepareConfig.outputs.RESOLVED_SECRETS }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.