Skip to content

Commit

Permalink
set matrix
Browse files Browse the repository at this point in the history
  • Loading branch information
arturcic committed Oct 31, 2024
1 parent 5076b25 commit de40def
Show file tree
Hide file tree
Showing 9 changed files with 57 additions and 99 deletions.
4 changes: 3 additions & 1 deletion .github/workflows/_artifacts_linux.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,9 @@ jobs:
runs-on: ${{ inputs.runner }}
strategy:
fail-fast: false
matrix: ${{fromJson(needs.matrix.outputs.matrix)}}
matrix:
dockerDistro: ${{fromJson(needs.matrix.outputs.dockerDistros)}}
dotnetVersion: ${{fromJson(needs.matrix.outputs.dotnetVersions)}}
steps:
-
name: Checkout
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/_jobs_matrix.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,4 +25,4 @@ jobs:
name: '[Matrix]'
id: matrix
shell: pwsh
run: dotnet run/config.dll --target=DockerMatrix
run: dotnet run/config.dll --target=SetMatrix
58 changes: 31 additions & 27 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -49,11 +49,11 @@ jobs:
needs: [ prepare ]
uses: ./.github/workflows/_build.yml

unit_test:
name: Test
needs: [ prepare ]
uses: ./.github/workflows/_unit_tests.yml
secrets: inherit
# unit_test:
# name: Test
# needs: [ prepare ]
# uses: ./.github/workflows/_unit_tests.yml
# secrets: inherit
#
# artifacts_windows_test:
# name: Artifacts Windows
Expand All @@ -76,29 +76,33 @@ jobs:
runner: ${{ matrix.runner }}
arch: ${{ matrix.arch }}

docker_linux_images:
needs: [ build ]
name: Docker Images (${{ matrix.arch }})
strategy:
fail-fast: false
matrix:
include:
- arch: amd64
runner: ubuntu-latest
- arch: arm64
runner: ubuntu-latest

uses: ./.github/workflows/_docker.yml
with:
runner: ${{ matrix.runner }}
arch: ${{ matrix.arch }}
secrets: inherit
# docker_linux_images:
# needs: [ build ]
# name: Docker Images (${{ matrix.arch }})
# strategy:
# fail-fast: false
# matrix:
# include:
# - arch: amd64
# runner: ubuntu-latest
# - arch: arm64
# runner: ubuntu-latest
#
# uses: ./.github/workflows/_docker.yml
# with:
# runner: ${{ matrix.runner }}
# arch: ${{ matrix.arch }}
# secrets: inherit

docker_linux_manifests:
needs: [ docker_linux_images ]
name: Docker Manifests
uses: ./.github/workflows/_docker_manifests.yml
secrets: inherit
# docker_linux_manifests:
# needs: [ docker_linux_images ]
# name: Docker Manifests
# strategy:
# fail-fast: false
# matrix:
# runner: ubuntu-latest
# uses: ./.github/workflows/_docker_manifests.yml
# secrets: inherit

# publish:
# name: Publish
Expand Down
20 changes: 0 additions & 20 deletions build/.run/DockerMatrix.run.xml

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<component name="ProjectRunConfigurationManager">
<configuration default="false" name="TestMatrix" type="DotNetProject" factoryName=".NET Project" folderName="Config">
<configuration default="false" name="SetMatrix" type="DotNetProject" factoryName=".NET Project" folderName="Config">
<option name="EXE_PATH" value="$PROJECT_DIR$/../run/config" />
<option name="PROGRAM_PARAMETERS" value="--target=TestMatrix" />
<option name="PROGRAM_PARAMETERS" value="--target=SetMatrix" />
<option name="WORKING_DIRECTORY" value="$PROJECT_DIR$/.." />
<option name="PASS_PARENT_ENVS" value="1" />
<option name="USE_EXTERNAL_CONSOLE" value="0" />
Expand Down
25 changes: 0 additions & 25 deletions build/config/Tasks/BaseMatrix.cs

This file was deleted.

12 changes: 0 additions & 12 deletions build/config/Tasks/DockerMatrix.cs

This file was deleted.

20 changes: 20 additions & 0 deletions build/config/Tasks/SetMatrix.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
using Cake.Json;

namespace Config.Tasks;

public class SetMatrix : FrostingTask<BuildContext>
{
public override void Run(BuildContext context)
{
if (context.BuildSystem().IsRunningOnGitHubActions)
{
context.GitHubActions().Commands.SetOutputParameter("dockerDistros", context.SerializeJson(Constants.DockerDistros));
context.GitHubActions().Commands.SetOutputParameter("dotnetVersions", context.SerializeJson(Constants.DotnetVersions));
}
else
{
context.Information("Docker Distros: {0}", context.SerializeJson(Constants.DockerDistros));
context.Information("Dotnet Versions: {0}", context.SerializeJson(Constants.DotnetVersions));
}
}
}
11 changes: 0 additions & 11 deletions build/config/Tasks/TestMatrix.cs

This file was deleted.

0 comments on commit de40def

Please sign in to comment.