diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml new file mode 100644 index 0000000..eb57d9d --- /dev/null +++ b/.github/workflows/main.yml @@ -0,0 +1,15 @@ +name: Main workflow + +on: + push: + branches: + - main + pull_request: + branches: + - main + +jobs: + call-workflow: + uses: ./.github/workflows/reusable.yml + with: + dotnetVersions: '["6.0", "8.0"]' \ No newline at end of file diff --git a/.github/workflows/reusable.yml b/.github/workflows/reusable.yml new file mode 100644 index 0000000..8b28a79 --- /dev/null +++ b/.github/workflows/reusable.yml @@ -0,0 +1,21 @@ +name: Matrix from Input Example +on: + workflow_call: + inputs: + dotnetVersions: + type: string + default: '["3.1", "5.0", "6.0"]' + +jobs: + build: + runs-on: ubuntu-latest + strategy: + matrix: + dotnet: ${{fromJson(github.event.inputs.dotnetVersions)}} + steps: + - name: Setup .NET + uses: actions/setup-dotnet@v1 + with: + dotnet-version: ${{ matrix.dotnet }} + - name: Build + run: dotnet build --configuration Release