Skip to content

Commit

Permalink
Setting up CI/CD with GitHub Actions using a standard .NET workflow (#…
Browse files Browse the repository at this point in the history
…2254)

* Create dotnet.yml
* Update dotnet.yml: Add target solution
* Update dotnet.yml: Restore Ocelot.sln
* Update dotnet.yml: .NET 9
* Update dotnet.yml: Setup .NET with multiple SDK versions
* Update dotnet.yml: Split target frameworks
* Update dotnet.yml: Unit Tests step
* Update dotnet.yml: 3 testing steps
* Add DotNet workflow config to VS-solution items
* Update dotnet.yml: Build on push, pull_request
  • Loading branch information
raman-m authored Jan 22, 2025
1 parent 68090bc commit c0afa42
Show file tree
Hide file tree
Showing 3 changed files with 41 additions and 0 deletions.
39 changes: 39 additions & 0 deletions .github/workflows/dotnet.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
# This workflow will build a .NET project
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-net

name: .NET

#on:
# push:
# branches: [ "develop" ]
# pull_request:
# branches: [ "develop" ]
on: [push, pull_request]

jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
dotnet-version: [ '8.0', '9.0' ]

steps:
- uses: actions/checkout@v4
- name: Setup .NET ${{ matrix.dotnet-version }}
uses: actions/setup-dotnet@v3
with:
dotnet-version: ${{ matrix.dotnet-version }}.x
# - name: Display dotnet version
# run: dotnet --version
- name: Restore
run: dotnet restore ./Ocelot.sln -p:TargetFramework=net${{ matrix.dotnet-version }}
- name: Build
run: dotnet build --no-restore ./Ocelot.sln --framework net${{ matrix.dotnet-version }}
# - name: Test
# run: dotnet test --no-build --verbosity normal ./Ocelot.sln --framework net${{ matrix.dotnet-version }}
- name: Unit Tests
run: dotnet test --no-restore --no-build --verbosity minimal --framework net${{ matrix.dotnet-version }} ./test/Ocelot.UnitTests/Ocelot.UnitTests.csproj
- name: Integration Tests
run: dotnet test --no-restore --no-build --verbosity minimal --framework net${{ matrix.dotnet-version }} ./test/Ocelot.IntegrationTests/Ocelot.IntegrationTests.csproj
- name: Acceptance Tests
run: dotnet test --no-restore --no-build --verbosity minimal --framework net${{ matrix.dotnet-version }} ./test/Ocelot.AcceptanceTests/Ocelot.AcceptanceTests.csproj
1 change: 1 addition & 0 deletions Ocelot.Release.sln
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution
.readthedocs.yaml = .readthedocs.yaml
build.cake = build.cake
codeanalysis.ruleset = codeanalysis.ruleset
.github\workflows\dotnet.yml = .github\workflows\dotnet.yml
GitVersion.yml = GitVersion.yml
LICENSE.md = LICENSE.md
README.md = README.md
Expand Down
1 change: 1 addition & 0 deletions Ocelot.sln
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution
.readthedocs.yaml = .readthedocs.yaml
build.cake = build.cake
codeanalysis.ruleset = codeanalysis.ruleset
.github\workflows\dotnet.yml = .github\workflows\dotnet.yml
GitVersion.yml = GitVersion.yml
LICENSE.md = LICENSE.md
README.md = README.md
Expand Down

0 comments on commit c0afa42

Please sign in to comment.