diff --git a/.github/actions/setup-dotnet-build/action.yml b/.github/actions/setup-dotnet-build/action.yml new file mode 100644 index 0000000..c428223 --- /dev/null +++ b/.github/actions/setup-dotnet-build/action.yml @@ -0,0 +1,33 @@ +name: 'Setup .NET and Build' +description: 'Sets up .NET environment, restores dependencies, and builds the project' +inputs: + dotnet-version: + description: '.NET versions to install' + required: false + default: | + 3.1.x + 6.x + configuration: + description: 'Build configuration' + required: false + default: 'Release' + build-args: + description: 'Additional build arguments' + required: false + default: '-p:ContinuousIntegrationBuild=True --no-restore' + +runs: + using: 'composite' + steps: + - name: Setup .NET + uses: actions/setup-dotnet@v4 + with: + dotnet-version: ${{ inputs.dotnet-version }} + + - name: Restore dependencies + run: dotnet restore + shell: pwsh + + - name: Build + run: dotnet build --configuration ${{ inputs.configuration }} ${{ inputs.build-args }} + shell: pwsh \ No newline at end of file diff --git a/.github/workflows/build-and-test.yml b/.github/workflows/build-and-test.yml index 25ae520..ebe46b2 100644 --- a/.github/workflows/build-and-test.yml +++ b/.github/workflows/build-and-test.yml @@ -20,16 +20,8 @@ jobs: os: [ubuntu-latest, windows-latest, macOS-latest] steps: - uses: actions/checkout@v4 - - name: Setup .NET - uses: actions/setup-dotnet@v4 - with: - dotnet-version: | - 3.1.x - 6.x - - name: Restore dependencies - run: dotnet restore - - name: Build - run: dotnet build -p:ContinuousIntegrationBuild=True --no-restore --configuration Release + - name: Setup .NET and Build + uses: ./.github/actions/setup-dotnet-build - name: Test run: dotnet test --no-build --configuration Release --verbosity normal diff --git a/.github/workflows/copilot-setup-steps.yml b/.github/workflows/copilot-setup-steps.yml new file mode 100644 index 0000000..00a894b --- /dev/null +++ b/.github/workflows/copilot-setup-steps.yml @@ -0,0 +1,37 @@ +name: Copilot Setup Steps + +on: + push: + paths: + - '.github/workflows/copilot-setup-steps.yml' + pull_request: + paths: + - '.github/workflows/copilot-setup-steps.yml' + workflow_dispatch: + +defaults: + run: + shell: pwsh + +jobs: + copilot-setup-steps: + name: copilot-setup-steps + runs-on: ubuntu-latest + + permissions: + contents: read + + steps: + - name: Checkout code + uses: actions/checkout@v5 + + - name: Setup .NET and Build + uses: ./.github/actions/setup-dotnet-build + with: + configuration: 'Debug' + + - name: Setup Copilot environment + run: | + echo "Setting up Copilot-specific environment variables..." + echo "COPILOT_SETUP_COMPLETE=true" >> $env:GITHUB_ENV + echo "Copilot environment setup completed" \ No newline at end of file