From e7b756ccd4acd62ced4f330a764bd15fb181cdad Mon Sep 17 00:00:00 2001 From: "M.P. Korstanje" Date: Fri, 1 May 2026 01:32:16 +0200 Subject: [PATCH] Extract common parts of .Net build --- .github/actions/prepare-dotnet/action.yaml | 15 +++++++++++++++ .github/workflows/codeql-dotnet.yaml | 12 ++++-------- .github/workflows/test-dotnet.yml | 9 +-------- 3 files changed, 20 insertions(+), 16 deletions(-) create mode 100644 .github/actions/prepare-dotnet/action.yaml diff --git a/.github/actions/prepare-dotnet/action.yaml b/.github/actions/prepare-dotnet/action.yaml new file mode 100644 index 00000000..796d5d08 --- /dev/null +++ b/.github/actions/prepare-dotnet/action.yaml @@ -0,0 +1,15 @@ +name: Prepare .Net +description: Setups local NUGET source and pack the Cucumber.CCK project +runs: + using: "composite" + steps: + # Setup local NUGET source + - name: Setup local NUGET source + run: mkdir -p ./bin/Release/NuGet + shell: bash + working-directory: dotnet/Cucumber.CCK + # Pack the Cucumber.CCK project first + - name: Pack Cucumber.CCK + run: dotnet pack -c Release + shell: bash + working-directory: dotnet/Cucumber.CCK diff --git a/.github/workflows/codeql-dotnet.yaml b/.github/workflows/codeql-dotnet.yaml index e44f9a88..a267dde8 100644 --- a/.github/workflows/codeql-dotnet.yaml +++ b/.github/workflows/codeql-dotnet.yaml @@ -43,14 +43,10 @@ jobs: - uses: actions/setup-dotnet@c2fa09f4bde5ebb9d1777cf28262a3eb3db3ced7 # v5.2.0 with: dotnet-version: '10.0.x' - # Setup local NUGET source - - name: Setup local NUGET source - run: mkdir -p ./bin/Release/NuGet - working-directory: dotnet/Cucumber.CCK - # Pack the Cucumber.CCK project first - - name: Pack Cucumber.CCK - run: dotnet pack -c Release - working-directory: dotnet/Cucumber.CCK + - uses: ./.github/actions/prepare-dotnet + - name: Build + run: dotnet build + working-directory: dotnet - uses: github/codeql-action/analyze@95e58e9a2cdfd71adc6e0353d5c52f41a045d225 # v4.35.2 with: category: "/language:csharp" diff --git a/.github/workflows/test-dotnet.yml b/.github/workflows/test-dotnet.yml index b6e36b01..b4534d37 100644 --- a/.github/workflows/test-dotnet.yml +++ b/.github/workflows/test-dotnet.yml @@ -29,14 +29,7 @@ jobs: - uses: actions/setup-dotnet@c2fa09f4bde5ebb9d1777cf28262a3eb3db3ced7 # v5.2.0 with: dotnet-version: '10.0.x' - # Setup local NUGET source - - name: Setup local NUGET source - run: mkdir -p ./bin/Release/NuGet - working-directory: dotnet/Cucumber.CCK - # Pack the Cucumber.CCK project first - - name: Pack Cucumber.CCK - run: dotnet pack -c Release - working-directory: dotnet/Cucumber.CCK + - uses: ./.github/actions/prepare-dotnet # Run tests which will use locally packed package - name: Run tests run: dotnet test -c Release