Set .NET 9 for tests on build-and-tests.yml #129
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: build-and-tests | |
on: | |
push: | |
branches: [ "*" ] | |
pull_request: | |
types: ["opened", "synchronize", "reopened"] | |
jobs: | |
build-and-test: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout the code | |
uses: actions/checkout@v4 | |
- name: Check Docker version | |
run: docker --version | |
- name: Start Docker Compose | |
run: docker compose -f docker-compose.yml up -d | |
- name: Setup .NET 8 | |
uses: actions/setup-dotnet@v4 | |
with: | |
dotnet-version: 8.0.x | |
- name: Setup .NET 9 | |
uses: actions/setup-dotnet@v4 | |
with: | |
dotnet-version: 9.0.x | |
- name: Restore dependencies | |
run: dotnet restore | |
- name: Build solution | |
run: dotnet build --configuration Release --no-restore | |
- name: Wait for services availability | |
run: sleep 15s | |
shell: bash | |
- name: Check containers | |
run: docker ps -a | |
- name: Run tests (.NET 8) | |
run: dotnet test --framework net8.0 --configuration Release --no-build --verbosity normal --logger GitHubActions | |
- name: Run tests (.NET 9) | |
run: dotnet test --framework net9.0 --configuration Release --no-build --verbosity normal --logger GitHubActions | |
- name: Stop Docker Compose | |
run: docker compose -f docker-compose.yml down | |
build-and-publish: | |
needs: build-and-test | |
if: github.ref == 'refs/heads/main' | |
uses: ./.github/workflows/build-and-publish.yml | |
with: | |
PROJECT: Confluent.Kafka.Core | |
secrets: | |
NUGET_API_KEY: ${{ secrets.NUGET_API_KEY }} | |
NUGET_SOURCE: ${{ secrets.NUGET_SOURCE }} |